Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
932727a
Update dependency pins: thinc 8.3.12, confection 1.1, weasel 1.0
honnibal Mar 21, 2026
e5fc4d6
Format
honnibal Mar 21, 2026
a84a2e6
Replace black, isort, and flake8 with ruff for linting and formatting
honnibal Mar 21, 2026
e9d7df6
Remove W503 from ruff ignore list (not a valid ruff rule)
honnibal Mar 21, 2026
200a364
Fix ruff isort config: replace unsupported profile with equivalent se…
honnibal Mar 21, 2026
041f47b
Format
honnibal Mar 21, 2026
30faae5
Merge branch 'master' into confection1.1
honnibal Mar 21, 2026
4cf4e9e
Ignore mypy errors (for now)
honnibal Mar 21, 2026
e684b0c
Apply ruff formatting to find_threshold.py and language.py
honnibal Mar 21, 2026
e17f2e6
Replace deprecated pydantic Field(help=...) with Field(title=...)
honnibal Mar 21, 2026
a0f5d7b
Fix EntityLinker_v1 import to use legacy module
honnibal Mar 21, 2026
dfba77b
Fix import sorting in factories.py
honnibal Mar 21, 2026
abb0414
Replace deprecated pydantic .dict() with .model_dump()
honnibal Mar 21, 2026
b11a6e3
Add ruff to test ignore list and filter pydantic deprecation warnings…
honnibal Mar 21, 2026
d434682
Fix tests for confection 1.1+: warning filters, zh segmenter test, la…
honnibal Mar 21, 2026
8b42d87
Monkeypatch _get_pip_install_cmd in download test for envs without pi…
honnibal Mar 21, 2026
326df3b
Remove pydantic deprecation warning filters (fixed in confection)
honnibal Mar 21, 2026
4f59963
Fix import sorting in test_textcat.py
honnibal Mar 21, 2026
00d26d0
Add Python 3.14 to CI matrix and classifiers
honnibal Mar 21, 2026
ff1bced
Set python_requires upper bound to <3.15
honnibal Mar 21, 2026
990577a
Fix mangled YAML in tests.yml and remove remaining pydantic warning f…
honnibal Mar 21, 2026
3ed48a2
Filter pydantic v1 incompatibility warning for Python 3.14 support
honnibal Mar 21, 2026
45db7d7
Skip Python 3.14 in CI until dependencies have wheels
honnibal Mar 21, 2026
eab3119
Fix zh tokenizer test: expect ConfigValidationError for invalid segme…
honnibal Mar 22, 2026
27199bc
Enable Python 3.14 in CI test matrix
honnibal Mar 23, 2026
953ee38
Set fail-fast: false to get full 3.14 CI results across all platforms
honnibal Mar 23, 2026
b05ff52
Require pydantic v2 (>=2.0.0) now that confection 1.1 has dropped pyd…
honnibal Mar 23, 2026
1c40afd
Require srsly v3 (>=3.0.0) for Python 3.14 cloudpickle fix
honnibal Mar 23, 2026
ac0c3fe
Bump ml_datasets pin to >=0.2.1 for srsly v3 compatibility
honnibal Mar 23, 2026
34f43bd
Revert srsly pin to >=2.4.3,<3.0.0 (srsly v3 has msgpack strict_map_k…
honnibal Mar 23, 2026
9abb59c
Fix secret exposure in explosionbot workflow pip install command
honnibal Mar 23, 2026
7b9fe93
Harden GitHub Actions: pin actions to SHA, add least-privilege permis…
honnibal Mar 23, 2026
9725c1a
Require srsly >=2.5.3 for Python 3.14 cloudpickle fix
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
18 changes: 10 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ 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"

Expand All @@ -45,19 +47,19 @@ jobs:
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 @@ -93,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 @@ -154,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
2 changes: 1 addition & 1 deletion 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
12 changes: 6 additions & 6 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>=0.3.0,<1.0.0
weasel>=0.4.2,<0.5.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 @@ -34,4 +34,4 @@ types-requests
types-setuptools>=57.0.0
ruff>=0.9.0
cython-lint>=0.15.0
confection>=0.0.4,<1.0.0
confection>=1.1.0,<2.0.0
16 changes: 10 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers =
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14
Topic :: Scientific/Engineering
project_urls =
Release notes = https://github.com/explosion/spaCy/releases
Expand All @@ -41,27 +42,27 @@ setup_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
install_requires =
# Our libraries
spacy-legacy>=3.0.11,<3.1.0
spacy-loggers>=1.0.0,<2.0.0
murmurhash>=0.28.0,<1.1.0
cymem>=2.0.2,<2.1.0
preshed>=3.0.2,<3.1.0
thinc>=8.3.4,<8.4.0
thinc>=8.3.12,<8.4.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
weasel>=0.4.2,<0.5.0
confection>=0.0.4,<1.0.0
weasel>=1.0.0,<2.0.0
confection>=1.1.0,<2.0.0
# Third-party dependencies
typer>=0.3.0,<1.0.0
tqdm>=4.38.0,<5.0.0
numpy>=1.15.0; python_version < "3.9"
numpy>=1.19.0; python_version >= "3.9"
requests>=2.13.0,<3.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 Down Expand Up @@ -135,6 +136,9 @@ formats = gztar
markers =
slow: mark a test as slow
issue: reference specific issue
filterwarnings =
error
ignore:Core Pydantic V1:UserWarning:pydantic

[mypy]
ignore_missing_imports = True
Expand Down
2 changes: 1 addition & 1 deletion spacy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
ConfigSchemaInit,
ConfigSchema,
):
_schema.model_rebuild(_types_namespace=_rebuild_ns)
_schema.model_rebuild(_types_namespace=_rebuild_ns) # type: ignore[attr-defined]

if sys.maxunicode == 65535:
raise SystemError(Errors.E130)
Expand Down
4 changes: 2 additions & 2 deletions spacy/cli/debug_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ def debug_config(
config = nlp.config.interpolate()
msg.divider("Config validation for [initialize]")
with show_validation_error(config_path):
T = registry.resolve(config["initialize"], schema=ConfigSchemaInit)
T = registry.resolve(config["initialize"], schema=ConfigSchemaInit) # type: ignore[arg-type]
msg.divider("Config validation for [training]")
with show_validation_error(config_path):
T = registry.resolve(config["training"], schema=ConfigSchemaTraining)
T = registry.resolve(config["training"], schema=ConfigSchemaTraining) # type: ignore[arg-type]
dot_names = [T["train_corpus"], T["dev_corpus"]]
util.resolve_dot_names(config, dot_names)
msg.good("Config is valid")
Expand Down
2 changes: 1 addition & 1 deletion spacy/cli/debug_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def debug_data(
cfg = util.load_config(config_path, overrides=config_overrides)
nlp = util.load_model_from_config(cfg)
config = nlp.config.interpolate()
T = registry.resolve(config["training"], schema=ConfigSchemaTraining)
T = registry.resolve(config["training"], schema=ConfigSchemaTraining) # type: ignore[arg-type]
# Use original config here, not resolved version
sourced_components = get_sourced_components(cfg)
frozen_components = T["frozen_components"]
Expand Down
2 changes: 1 addition & 1 deletion spacy/cli/debug_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def debug_model_cli(
with show_validation_error(config_path):
nlp = util.load_model_from_config(raw_config)
config = nlp.config.interpolate()
T = registry.resolve(config["training"], schema=ConfigSchemaTraining)
T = registry.resolve(config["training"], schema=ConfigSchemaTraining) # type: ignore[arg-type]
seed = T["seed"]
if seed is not None:
msg.info(f"Fixing random seed: {seed}")
Expand Down
6 changes: 4 additions & 2 deletions spacy/cli/find_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ def filter_config(
),
)
if hasattr(pipe, "cfg"):
nlp.get_pipe(pipe_name).cfg = set_nested_item(
pipe.cfg, config_keys, threshold
nlp.get_pipe(pipe_name).cfg = set_nested_item( # type: ignore[attr-defined]
pipe.cfg,
config_keys,
threshold, # type: ignore[attr-defined]
)

eval_scores = nlp.evaluate(dev_dataset)
Expand Down
2 changes: 1 addition & 1 deletion spacy/cli/init_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def init_config(
# Filter out duplicates since tok2vec and transformer are added by template
pipeline = [pipe for pipe in pipeline if pipe not in ("tok2vec", "transformer")]
defaults = RECOMMENDATIONS["__default__"]
reco = RecommendationSchema(**RECOMMENDATIONS.get(lang, defaults)).dict()
reco = RecommendationSchema(**RECOMMENDATIONS.get(lang, defaults)).model_dump()
variables = {
"lang": lang,
"components": pipeline,
Expand Down
4 changes: 2 additions & 2 deletions spacy/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
try: # Python 3.8+
import importlib.metadata as importlib_metadata
except ImportError:
from catalogue import (
_importlib_metadata as importlib_metadata, # type: ignore[no-redef] # noqa: F401
from catalogue import ( # type: ignore[no-redef]
_importlib_metadata as importlib_metadata, # noqa: F401
)

from thinc.api import Optimizer # noqa: F401
Expand Down
2 changes: 1 addition & 1 deletion spacy/lang/es/lemmatizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def lemmatize_verb_pron(
rule = self.select_rule("verb", features)
verb_lemma = self.lemmatize_verb(
verb,
features - {"PronType=Prs"},
features - {"PronType=Prs"}, # type: ignore[operator]
rule,
index, # type: ignore[operator]
)[0]
Expand Down
Loading