Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
aa17eb9
Add lazy spaCy CLI loading and static launcher
honnibal Mar 9, 2026
c7d7a72
Fix lazy load on modules where the function shadows
honnibal Mar 9, 2026
126deac
Update manifest
honnibal Mar 9, 2026
5c559fc
Fix manifest
honnibal Mar 9, 2026
cfa1d3a
fix: ensure memory_zone cleanup runs on exception (#13924) (#13932)
kvr06-ai Mar 15, 2026
4168448
Update test_cli_launcher
honnibal Mar 20, 2026
37b4a74
Switch dependency back from `typer-slim` to `typer` (#13922)
svlandeg Mar 20, 2026
2f6142b
Require weasel 1.0
honnibal Mar 20, 2026
c6c78d6
Allow use of uv as a fallback to pip in spacy download
honnibal Mar 20, 2026
ed20f79
Require confection
honnibal Mar 20, 2026
f22ff91
Fix vuln scan by not calling test file requirements requirements.txt
honnibal Mar 20, 2026
21439ec
Migrate from pydantic v1 to v2, require pydantic>=2.0.0
honnibal Mar 20, 2026
d41afc2
isort
honnibal Mar 20, 2026
2afc3fd
Escape braces in TokenPatternOperatorMinMax regex for Rust regex engine
honnibal Mar 20, 2026
60a19cb
Revert to confection <1 and allow pydantic v1
honnibal Mar 20, 2026
4f19800
Revert to weasel <0.5
honnibal Mar 20, 2026
3154ede
Revert pydantic v2 migration, restore v1 compat imports
honnibal Mar 20, 2026
d5f67dc
Update spaCy pydantic imports from v1 compat to v2 native API
honnibal Mar 20, 2026
f835985
Increment version
honnibal Mar 20, 2026
b8bade1
Update spaCy to pydantic v2 native API
honnibal Mar 20, 2026
501ccfd
Fix pydantic v2 pattern validation error counts and attributeruler ty…
honnibal Mar 20, 2026
fd99ed3
Replace black, isort, and flake8 with ruff for linting and formatting
honnibal Mar 21, 2026
adeb162
Remove W503 from ruff ignore list (not a valid ruff rule)
honnibal Mar 21, 2026
a7f629b
Fix ruff isort config: replace unsupported profile with equivalent se…
honnibal Mar 21, 2026
32c4b63
Format with ruff
honnibal Mar 21, 2026
79b5f81
Update CI validation workflow: replace black, isort, flake8 with ruff
honnibal Mar 21, 2026
86f7ce3
Limit CI ruff lint to isort-only checks for now
honnibal Mar 21, 2026
47b5504
Autofix autofixable things from ruff
honnibal Mar 21, 2026
8e6bd6d
Apply ruff formatting to 8 files
honnibal Mar 21, 2026
24255bd
Fix import sorting for ruff isort compliance
honnibal Mar 21, 2026
f175a51
Fully migrate to Pydantic v2 (#13940)
honnibal Mar 23, 2026
188c90d
Add lazy spaCy CLI loading and static launcher
honnibal Mar 9, 2026
0a45289
Fix lazy load on modules where the function shadows
honnibal Mar 9, 2026
f0abcf7
Update manifest
honnibal Mar 9, 2026
8a318db
Fix manifest
honnibal Mar 9, 2026
4967496
Update test_cli_launcher
honnibal Mar 20, 2026
7bb0938
Merge branch 'faster-cli' of https://github.com/explosion/spaCy into …
honnibal Mar 23, 2026
93547fe
Fix lint issues across PR files
honnibal Mar 23, 2026
c5bcffd
Fix import sorting (ruff I001) for CI validation
honnibal Mar 23, 2026
ec786c8
Add local lint script matching CI validate + mypy checks
honnibal Mar 23, 2026
cb67fe1
Regenerate CLI manifest for typer 0.24.1 plain-text output
honnibal Mar 23, 2026
1041f8b
Debug: dump manifest diff in test_manifest_is_current
honnibal Mar 23, 2026
66b1691
Debug: show per-key manifest diffs in test_manifest_is_current
honnibal Mar 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ on:
# ** matches 'zero or more of any character'
- 'release-v[0-9]+.[0-9]+.[0-9]+**'
- 'prerelease-v[0-9]+.[0-9]+.[0-9]+**'

permissions: {}

jobs:
build_wheels:
uses: explosion/gha-cibuildwheel/.github/workflows/cibuildwheel.yml@main
uses: explosion/gha-cibuildwheel/.github/workflows/cibuildwheel.yml@2c98f757f13d112cf73fcf4b627249f1fffb5aae # main
permissions:
contents: write
actions: read
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/explosionbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- created
- edited

permissions: {}

jobs:
explosion-bot:
if: github.repository_owner == 'explosion'
Expand All @@ -15,13 +17,15 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
- name: Install and run explosion-bot
run: |
pip install git+https://${{ secrets.EXPLOSIONBOT_TOKEN }}@github.com/explosion/explosion-bot
git config --global url."https://x-access-token:${EXPLOSIONBOT_TOKEN}@github.com/".insteadOf "https://github.com/"
pip install git+https://github.com/explosion/explosion-bot
python -m explosionbot
env:
EXPLOSIONBOT_TOKEN: ${{ secrets.EXPLOSIONBOT_TOKEN }}
INPUT_TOKEN: ${{ secrets.EXPLOSIONBOT_TOKEN }}
INPUT_BK_TOKEN: ${{ secrets.BUILDKITE_SECRET }}
ENABLED_COMMANDS: "test_gpu,test_slow,test_slow_gpu"
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/issue-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ on:
types:
- labeled

permissions: {}

jobs:
issue-manager:
permissions:
issues: write
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- uses: tiangolo/issue-manager@0.4.0
- uses: tiangolo/issue-manager@4d1b7e05935a404dc8337d30bd23be46be8bb8e5 # 0.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
config: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v5
- uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5
with:
process-only: 'issues'
issue-inactive-days: '30'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
types:
- published

permissions: {}

jobs:
upload_pypi:
runs-on: ubuntu-latest
Expand All @@ -21,7 +23,7 @@ jobs:
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: robinraju/release-downloader@v1
- uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1
with:
tag: ${{ github.event.release.tag_name }}
fileName: '*'
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/spacy_universe_alert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@ on:
paths:
- "website/meta/universe.json"

permissions: {}

jobs:
build:
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest

steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
PR_NUMBER: ${{github.event.number}}
run: |
echo "$GITHUB_CONTEXT"

- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.10'
- name: Install Bernadette app dependency and send an alert
Expand Down
39 changes: 15 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,56 +19,47 @@ on:
- "*.mdx"
- "website/**"

permissions: {}

jobs:
validate:
name: Validate
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Configure Python version
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.10"

- name: black
run: |
python -m pip install black -c requirements.txt
python -m black spacy --check
- name: isort
- name: ruff format
run: |
python -m pip install isort -c requirements.txt
python -m isort spacy --check
- name: flake8
python -m pip install ruff -c requirements.txt
python -m ruff format spacy --check
- name: ruff isort
run: |
python -m pip install flake8==5.0.4
python -m flake8 spacy --count --select=E901,E999,F821,F822,F823,W605 --show-source --statistics
# Unfortunately cython-lint isn't working after the shift to Cython 3.
#- name: cython-lint
# run: |
# python -m pip install cython-lint -c requirements.txt
# # E501: line too log, W291: trailing whitespace, E266: too many leading '#' for block comment
# cython-lint spacy --ignore E501,W291,E266
python -m ruff check spacy --select I

tests:
name: Test
needs: Validate
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_version: ["3.10", "3.11", "3.12", "3.13"]
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

runs-on: ${{ matrix.os }}

steps:
- name: Check out repo
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Configure Python version
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python_version }}

Expand Down Expand Up @@ -104,7 +95,7 @@ jobs:
shell: bash

- name: Test import
run: python -W error -c "import spacy"
run: python -W error -W 'ignore:Core Pydantic V1:UserWarning:pydantic' -c "import spacy"

- name: "Test download CLI"
run: |
Expand Down Expand Up @@ -165,7 +156,7 @@ jobs:

- name: "Run CPU tests"
run: |
python -m pytest --pyargs spacy -W error
python -m pytest --pyargs spacy -W error -W 'ignore:Core Pydantic V1:UserWarning:pydantic'
if: "!(startsWith(matrix.os, 'macos') && matrix.python_version == '3.11')"

- name: "Run CPU tests with thinc-apple-ops"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/universe_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ on:
paths:
- "website/meta/universe.json"

permissions: {}

jobs:
validate:
name: Validate
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Configure Python version
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.7"

Expand Down
16 changes: 5 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
repos:
- repo: https://github.com/ambv/black
rev: 22.3.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.0
hooks:
- id: black
language_version: python3.7
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
args:
- "--config=setup.cfg"
- id: ruff
args: ['--fix']
- id: ruff-format
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
recursive-include spacy *.pyi *.pyx *.pxd *.txt *.cfg *.jinja *.toml *.hh
recursive-include spacy_cli *.json
include LICENSE
include README.md
include pyproject.toml
Expand Down
37 changes: 37 additions & 0 deletions lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Local lint script matching the CI Validate job + mypy type checks.
# Fixes formatting and import sorting in-place, then re-verifies in
# check mode to catch any conflicts between the two, and runs mypy.
set -euo pipefail

err=0

echo "==> ruff format (auto-fixing)"
python -m ruff format spacy

echo "==> ruff isort (auto-fixing)"
python -m ruff check spacy --select I --fix

echo "==> ruff format (verify)"
if ! python -m ruff format spacy --check; then
echo "FAIL: isort fix broke formatting"
err=1
fi

echo "==> ruff isort (verify)"
if ! python -m ruff check spacy --select I; then
echo "FAIL: format fix broke import sorting"
err=1
fi

echo "==> mypy"
if ! python -m mypy spacy; then
err=1
fi

if [ "$err" -ne 0 ]; then
echo "FAIL: see errors above"
exit 1
fi

echo "OK: all checks passed"
14 changes: 11 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires = [
"cymem>=2.0.2,<2.1.0",
"preshed>=3.0.2,<3.1.0",
"murmurhash>=0.28.0,<1.1.0",
"thinc>=8.3.4,<8.4.0",
"thinc>=8.3.12,<8.4.0",
"numpy>=2.0.0,<3.0.0"
]
build-backend = "setuptools.build_meta"
Expand Down Expand Up @@ -62,5 +62,13 @@ repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest
[tool.cibuildwheel.pyodide]


[tool.isort]
profile = "black"
[tool.ruff]
line-length = 88

[tool.ruff.lint]
select = ["E", "F", "W", "C", "B", "B9"]
ignore = ["E203", "E266", "E501", "E731", "E741", "F541"]

[tool.ruff.lint.isort]
combine-as-imports = true
split-on-trailing-comma = true
17 changes: 8 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ spacy-legacy>=3.0.11,<3.1.0
spacy-loggers>=1.0.0,<2.0.0
cymem>=2.0.2,<2.1.0
preshed>=3.0.2,<3.1.0
thinc>=8.3.4,<8.4.0
ml_datasets>=0.2.0,<0.3.0
thinc>=8.3.12,<8.4.0
ml_datasets>=0.2.1,<0.3.0
murmurhash>=0.28.0,<1.1.0
wasabi>=0.9.1,<1.2.0
srsly>=2.4.3,<3.0.0
srsly>=2.5.3,<3.0.0
catalogue>=2.0.6,<2.1.0
typer-slim>=0.3.0,<1.0.0
weasel>=0.4.2,<0.5.0
typer>=0.3.0,<1.0.0
weasel>=1.0.0,<2.0.0
# Third party dependencies
numpy>=2.0.0,<3.0.0
requests>=2.13.0,<3.0.0
tqdm>=4.38.0,<5.0.0
pydantic>=1.7.4,!=1.8,!=1.8.1,<3.0.0
pydantic>=2.0.0,<3.0.0
jinja2
# Official Python utilities
setuptools
Expand All @@ -26,13 +26,12 @@ cython>=3.0,<4.0
pytest>=5.2.0,!=7.1.0
pytest-timeout>=1.3.0,<2.0.0
mock>=2.0.0,<3.0.0
flake8>=3.8.0,<6.0.0
hypothesis>=3.27.0,<7.0.0
mypy>=1.5.0,<1.6.0; platform_machine != "aarch64" and python_version >= "3.8"
types-mock>=0.1.1
types-setuptools>=57.0.0
types-requests
types-setuptools>=57.0.0
black>=25.0.0
ruff>=0.9.0
cython-lint>=0.15.0
isort>=5.0,<6.0
confection>=1.1.0,<2.0.0
Loading
Loading