Skip to content

Commit 7c7aa6d

Browse files
committed
Merge branch 'master' into pr/13416
2 parents d2a3be4 + 7fbbb20 commit 7c7aa6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+5533
-1080
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
tags:
6+
# ytf did they invent their own syntax that's almost regex?
7+
# ** matches 'zero or more of any character'
8+
- 'release-v[0-9]+.[0-9]+.[0-9]+**'
9+
- 'prerelease-v[0-9]+.[0-9]+.[0-9]+**'
10+
jobs:
11+
build_wheels:
12+
name: Build wheels on ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
# macos-13 is an intel runner, macos-14 is apple silicon
17+
os: [ubuntu-latest, windows-latest, macos-13]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Build wheels
22+
uses: pypa/cibuildwheel@v2.19.1
23+
env:
24+
CIBW_SOME_OPTION: value
25+
with:
26+
package-dir: .
27+
output-dir: wheelhouse
28+
config-file: "{package}/pyproject.toml"
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
32+
path: ./wheelhouse/*.whl
33+
34+
build_sdist:
35+
name: Build source distribution
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Build sdist
41+
run: pipx run build --sdist
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: cibw-sdist
45+
path: dist/*.tar.gz
46+
create_release:
47+
needs: [build_wheels, build_sdist]
48+
runs-on: ubuntu-latest
49+
permissions:
50+
contents: write
51+
checks: write
52+
actions: read
53+
issues: read
54+
packages: write
55+
pull-requests: read
56+
repository-projects: read
57+
statuses: read
58+
steps:
59+
- name: Get the tag name and determine if it's a prerelease
60+
id: get_tag_info
61+
run: |
62+
FULL_TAG=${GITHUB_REF#refs/tags/}
63+
if [[ $FULL_TAG == release-* ]]; then
64+
TAG_NAME=${FULL_TAG#release-}
65+
IS_PRERELEASE=false
66+
elif [[ $FULL_TAG == prerelease-* ]]; then
67+
TAG_NAME=${FULL_TAG#prerelease-}
68+
IS_PRERELEASE=true
69+
else
70+
echo "Tag does not match expected patterns" >&2
71+
exit 1
72+
fi
73+
echo "FULL_TAG=$TAG_NAME" >> $GITHUB_ENV
74+
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
75+
echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV
76+
- uses: actions/download-artifact@v4
77+
with:
78+
# unpacks all CIBW artifacts into dist/
79+
pattern: cibw-*
80+
path: dist
81+
merge-multiple: true
82+
- name: Create Draft Release
83+
id: create_release
84+
uses: softprops/action-gh-release@v2
85+
if: startsWith(github.ref, 'refs/tags/')
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
with:
89+
name: ${{ env.TAG_NAME }}
90+
draft: true
91+
prerelease: ${{ env.IS_PRERELEASE }}
92+
files: "./dist/*"

.github/workflows/explosionbot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
env:
1616
GITHUB_CONTEXT: ${{ toJson(github) }}
1717
run: echo "$GITHUB_CONTEXT"
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- uses: actions/setup-python@v4
2020
- name: Install and run explosion-bot
2121
run: |

.github/workflows/lock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: github.repository_owner == 'explosion'
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: dessant/lock-threads@v4
19+
- uses: dessant/lock-threads@v5
2020
with:
2121
process-only: 'issues'
2222
issue-inactive-days: '30'

.github/workflows/publish_pypi.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# The cibuildwheel action triggers on creation of a release, this
2+
# triggers on publication.
3+
# The expected workflow is to create a draft release and let the wheels
4+
# upload, and then hit 'publish', which uploads to PyPi.
5+
6+
on:
7+
release:
8+
types:
9+
- published
10+
11+
jobs:
12+
upload_pypi:
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/spacy
17+
permissions:
18+
id-token: write
19+
contents: read
20+
if: github.event_name == 'release' && github.event.action == 'published'
21+
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
22+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
23+
steps:
24+
- uses: robinraju/release-downloader@v1
25+
with:
26+
tag: ${{ github.event.release.tag_name }}
27+
fileName: '*'
28+
out-file-path: 'dist'
29+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/slowtests.yml renamed to .github/workflows/slowtests.yml.disabled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
with:
1919
ref: ${{ matrix.branch }}
2020
- name: Get commits from past 24 hours

.github/workflows/spacy_universe_alert.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
echo "$GITHUB_CONTEXT"
2020
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
- uses: actions/setup-python@v4
2323
with:
2424
python-version: '3.10'

.github/workflows/tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Check out repo
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929

3030
- name: Configure Python version
3131
uses: actions/setup-python@v4
3232
with:
3333
python-version: "3.7"
34-
architecture: x64
3534

3635
- name: black
3736
run: |
@@ -75,13 +74,12 @@ jobs:
7574

7675
steps:
7776
- name: Check out repo
78-
uses: actions/checkout@v3
77+
uses: actions/checkout@v4
7978

8079
- name: Configure Python version
8180
uses: actions/setup-python@v4
8281
with:
8382
python-version: ${{ matrix.python_version }}
84-
architecture: x64
8583

8684
- name: Install dependencies
8785
run: |

.github/workflows/universe_validation.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Check out repo
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424

2525
- name: Configure Python version
2626
uses: actions/setup-python@v4
2727
with:
2828
python-version: "3.7"
29-
architecture: x64
3029

3130
- name: Validate website/meta/universe.json
3231
run: |

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (C) 2016-2023 ExplosionAI GmbH, 2016 spaCy GmbH, 2015 Matthew Honnibal
3+
Copyright (C) 2016-2024 ExplosionAI GmbH, 2016 spaCy GmbH, 2015 Matthew Honnibal
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

pyproject.toml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,58 @@ requires = [
1111
]
1212
build-backend = "setuptools.build_meta"
1313

14+
[tool.cibuildwheel]
15+
build = "*"
16+
skip = "pp* cp36* cp37* cp38* *-win32"
17+
test-skip = ""
18+
free-threaded-support = false
19+
20+
archs = ["native"]
21+
22+
build-frontend = "default"
23+
config-settings = {}
24+
dependency-versions = "pinned"
25+
environment = { PIP_CONSTRAINT = "build-constraints.txt" }
26+
27+
environment-pass = []
28+
build-verbosity = 0
29+
30+
before-all = "curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable"
31+
before-build = "pip install -r requirements.txt && python setup.py clean"
32+
repair-wheel-command = ""
33+
34+
test-command = ""
35+
before-test = ""
36+
test-requires = []
37+
test-extras = []
38+
39+
container-engine = "docker"
40+
41+
manylinux-x86_64-image = "manylinux2014"
42+
manylinux-i686-image = "manylinux2014"
43+
manylinux-aarch64-image = "manylinux2014"
44+
manylinux-ppc64le-image = "manylinux2014"
45+
manylinux-s390x-image = "manylinux2014"
46+
manylinux-pypy_x86_64-image = "manylinux2014"
47+
manylinux-pypy_i686-image = "manylinux2014"
48+
manylinux-pypy_aarch64-image = "manylinux2014"
49+
50+
musllinux-x86_64-image = "musllinux_1_2"
51+
musllinux-i686-image = "musllinux_1_2"
52+
musllinux-aarch64-image = "musllinux_1_2"
53+
musllinux-ppc64le-image = "musllinux_1_2"
54+
musllinux-s390x-image = "musllinux_1_2"
55+
56+
[tool.cibuildwheel.linux]
57+
repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}"
58+
59+
[tool.cibuildwheel.macos]
60+
repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
61+
62+
[tool.cibuildwheel.windows]
63+
64+
[tool.cibuildwheel.pyodide]
65+
66+
1467
[tool.isort]
1568
profile = "black"

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ murmurhash>=0.28.0,<1.1.0
99
wasabi>=0.9.1,<1.2.0
1010
srsly>=2.4.3,<3.0.0
1111
catalogue>=2.0.6,<2.1.0
12-
typer>=0.3.0,<0.10.0
12+
typer>=0.3.0,<1.0.0
1313
weasel>=0.1.0,<0.5.0
1414
# Third party dependencies
1515
numpy>=1.15.0; python_version < "3.9"
@@ -22,7 +22,6 @@ langcodes>=3.2.0,<4.0.0
2222
# Official Python utilities
2323
setuptools
2424
packaging>=20.0
25-
typing_extensions>=3.7.4.1,<4.5.0; python_version < "3.8"
2625
# Development dependencies
2726
pre-commit>=2.13.0
2827
cython>=0.25,<3.0

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ classifiers =
2222
Programming Language :: Python :: 3.9
2323
Programming Language :: Python :: 3.10
2424
Programming Language :: Python :: 3.11
25+
Programming Language :: Python :: 3.12
2526
Topic :: Scientific/Engineering
2627
project_urls =
2728
Release notes = https://github.com/explosion/spaCy/releases
@@ -55,7 +56,7 @@ install_requires =
5556
catalogue>=2.0.6,<2.1.0
5657
weasel>=0.1.0,<0.5.0
5758
# Third-party dependencies
58-
typer>=0.3.0,<0.10.0
59+
typer>=0.3.0,<1.0.0
5960
tqdm>=4.38.0,<5.0.0
6061
numpy>=1.15.0; python_version < "3.9"
6162
numpy>=1.19.0; python_version >= "3.9"
@@ -65,7 +66,6 @@ install_requires =
6566
# Official Python utilities
6667
setuptools
6768
packaging>=20.0
68-
typing_extensions>=3.7.4.1,<4.5.0; python_version < "3.8"
6969
langcodes>=3.2.0,<4.0.0
7070

7171
[options.entry_points]

spacy/about.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# fmt: off
22
__title__ = "spacy"
3-
__version__ = "3.7.4"
3+
__version__ = "3.8.0.dev0"
44
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
55
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"

spacy/cli/find_threshold.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def find_threshold_cli(
3939
# fmt: on
4040
):
4141
"""
42-
Runs prediction trials for a trained model with varying tresholds to maximize
42+
Runs prediction trials for a trained model with varying thresholds to maximize
4343
the specified metric. The search space for the threshold is traversed linearly
4444
from 0 to 1 in `n_trials` steps. Results are displayed in a table on `stdout`
4545
(the corresponding API call to `spacy.cli.find_threshold.find_threshold()`
@@ -81,7 +81,7 @@ def find_threshold(
8181
silent: bool = True,
8282
) -> Tuple[float, float, Dict[float, float]]:
8383
"""
84-
Runs prediction trials for models with varying tresholds to maximize the specified metric.
84+
Runs prediction trials for models with varying thresholds to maximize the specified metric.
8585
model (Union[str, Path]): Pipeline to evaluate. Can be a package or a path to a data directory.
8686
data_path (Path): Path to file with DocBin with docs to use for threshold search.
8787
pipe_name (str): Name of pipe to examine thresholds for.

spacy/lang/bo/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from ...language import BaseDefaults, Language
2+
from .lex_attrs import LEX_ATTRS
3+
from .stop_words import STOP_WORDS
4+
5+
6+
class TibetanDefaults(BaseDefaults):
7+
lex_attr_getters = LEX_ATTRS
8+
stop_words = STOP_WORDS
9+
10+
11+
class Tibetan(Language):
12+
lang = "bo"
13+
Defaults = TibetanDefaults
14+
15+
16+
__all__ = ["Tibetan"]

spacy/lang/bo/examples.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Example sentences to test spaCy and its language models.
3+
4+
>>> from spacy.lang.bo.examples import sentences
5+
>>> docs = nlp.pipe(sentences)
6+
"""
7+
8+
9+
sentences = [
10+
"དོན་དུ་རྒྱ་མཚོ་བླ་མ་ཞེས་བྱ་ཞིང༌།",
11+
"ཏཱ་ལའི་ཞེས་པ་ནི་སོག་སྐད་ཡིན་པ་དེ་བོད་སྐད་དུ་རྒྱ་མཚོའི་དོན་དུ་འཇུག",
12+
"སོག་པོ་ཨལ་ཐན་རྒྱལ་པོས་རྒྱལ་དབང་བསོད་ནམས་རྒྱ་མཚོར་ཆེ་བསྟོད་ཀྱི་མཚན་གསོལ་བ་ཞིག་ཡིན་ཞིང༌།",
13+
"རྗེས་སུ་རྒྱལ་བ་དགེ་འདུན་གྲུབ་དང༌། དགེ་འདུན་རྒྱ་མཚོ་སོ་སོར་ཡང་ཏཱ་ལའི་བླ་མའི་སྐུ་ཕྲེང་དང་པོ་དང༌།",
14+
"གཉིས་པའི་མཚན་དེ་གསོལ་ཞིང༌།༸རྒྱལ་དབང་སྐུ་ཕྲེང་ལྔ་པས་དགའ་ལྡན་ཕོ་བྲང་གི་སྲིད་དབང་བཙུགས་པ་ནས་ཏཱ་ལའི་བླ་མ་ནི་བོད་ཀྱི་ཆོས་སྲིད་གཉིས་ཀྱི་དབུ་ཁྲིད་དུ་གྱུར་ཞིང་།",
15+
"ད་ལྟའི་བར་ཏཱ་ལའི་བླ་མ་སྐུ་ཕྲེང་བཅུ་བཞི་བྱོན་ཡོད།",
16+
]

0 commit comments

Comments
 (0)