From d2e15875ef124f3ea4a2d938da2d8b6c9c76db95 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Tue, 18 Nov 2025 11:18:27 +0000 Subject: [PATCH 1/3] Tweak CI --- .github/workflows/cibuildwheel.yml | 20 ++++++++++++------- .github/workflows/tests.yml | 32 ++++++++++++++---------------- pyproject.toml | 4 ++-- setup.cfg | 1 + 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 8116a0f..c8dcbab 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,12 +1,18 @@ -name: Build +name: Build wheels on: push: - tags: - # ytf did they invent their own syntax that's almost regex? - # ** matches 'zero or more of any character' - - 'release-v[0-9]+.[0-9]+.[0-9]+**' - - 'prerelease-v[0-9]+.[0-9]+.[0-9]+**' + branches: [master] + pull_request: + branches: ["*"] + workflow_dispatch: # allows you to trigger manually + +# When this workflow is queued, automatically cancel any previous running +# or pending jobs from the same branch +concurrency: + group: Build-${{ github.ref }} + cancel-in-progress: true + jobs: build_wheels: uses: explosion/gha-cibuildwheel/.github/workflows/cibuildwheel.yml@main @@ -16,6 +22,6 @@ jobs: with: wheel-name-pattern: "srsly-*.whl" pure-python: false + create-release: ${{ startsWith(github.ref, 'refs/tags/release-') || startsWith(github.ref, 'refs/tags/prerelease-') }} secrets: gh-token: ${{ secrets.GITHUB_TOKEN }} - diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edc1211..4533c41 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,39 +1,37 @@ -name: tests +name: Test on: push: - tags-ignore: - - '**' - paths-ignore: - - "*.md" - - ".github/cibuildwheel.yml" - - ".github/publish_pypi.yml" + branches: [master] pull_request: - types: [opened, synchronize, reopened, edited] - paths-ignore: - - "*.md" - - ".github/cibuildwheel.yml" - - ".github/publish_pypi.yml" + branches: ["*"] + workflow_dispatch: # allows you to trigger manually + +# When this workflow is queued, automatically cancel any previous running +# or pending jobs from the same branch +concurrency: + group: Test-${{ github.ref }} + cancel-in-progress: true + env: MODULE_NAME: 'srsly' RUN_MYPY: 'false' jobs: tests: - name: Test - if: github.repository_owner == 'explosion' strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python_version: ["3.9", "3.10", "3.11", "3.12"] + python_version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] runs-on: ${{ matrix.os }} steps: - name: Check out repo - uses: actions/checkout@v3 + uses: actions/checkout@v5 + - name: Configure Python version - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python_version }} architecture: x64 diff --git a/pyproject.toml b/pyproject.toml index 1566455..125eee8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ [build-system] requires = [ "setuptools", - "cython>=0.25", + "cython>=0.29.1", ] build-backend = "setuptools.build_meta" [tool.cibuildwheel] build = "*" -skip = "cp38*" +skip = ["cp38*", "cp314t-*"] test-skip = "" archs = ["native"] diff --git a/setup.cfg b/setup.cfg index fe5f34a..293e9e2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 [options] From 06582bfeecdd2d9b618dd3e1fae2521657364438 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Tue, 18 Nov 2025 11:55:09 +0000 Subject: [PATCH 2/3] Disable 3.14; fix 3.13 --- .github/workflows/tests.yml | 3 ++- pyproject.toml | 6 +++++- setup.cfg | 4 ++-- srsly/tests/cloudpickle/cloudpickle_test.py | 6 +++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4533c41..2bfc614 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python_version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + # FIXME: ujson segfault on 3.14 + python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"] runs-on: ${{ matrix.os }} steps: diff --git a/pyproject.toml b/pyproject.toml index 125eee8..483235c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,11 @@ build-backend = "setuptools.build_meta" [tool.cibuildwheel] build = "*" -skip = ["cp38*", "cp314t-*"] +skip = [ + "cp38*", # Obsolete + "cp314-*", # FIXME ujson segfaults + "cp314t-*", # TODO free-threading support (note: 3.13t is skipped by default) +] test-skip = "" archs = ["native"] diff --git a/setup.cfg b/setup.cfg index 293e9e2..2b3679a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,13 +22,13 @@ classifiers = Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 Programming Language :: Python :: 3.13 - Programming Language :: Python :: 3.14 Topic :: Scientific/Engineering [options] zip_safe = true include_package_data = true -python_requires = >=3.9,<3.15 +# FIXME ujson segfaults on 3.14 +python_requires = >=3.9,<3.14 setup_requires = cython>=0.29.1 install_requires = diff --git a/srsly/tests/cloudpickle/cloudpickle_test.py b/srsly/tests/cloudpickle/cloudpickle_test.py index e4dba00..6d31e13 100644 --- a/srsly/tests/cloudpickle/cloudpickle_test.py +++ b/srsly/tests/cloudpickle/cloudpickle_test.py @@ -112,7 +112,11 @@ def method_c(self): return "c" clsdict = _extract_class_dict(C) - assert sorted(clsdict.keys()) == ["C_CONSTANT", "__doc__", "method_c"] + if sys.version_info >= (3, 13): + expected_keys = ["C_CONSTANT", "__doc__", "__firstlineno__", "method_c"] + else: + expected_keys = ["C_CONSTANT", "__doc__", "method_c"] + assert sorted(clsdict.keys()) == expected_keys assert clsdict["C_CONSTANT"] == 43 assert clsdict["__doc__"] is None assert clsdict["method_c"](C()) == C().method_c() From 922bbf71f47243c3ab18e396b30a6c519fc7b395 Mon Sep 17 00:00:00 2001 From: Guido Imperiale Date: Wed, 19 Nov 2025 11:23:41 +0000 Subject: [PATCH 3/3] Update srsly/tests/cloudpickle/cloudpickle_test.py Co-authored-by: Christian Clauss --- srsly/tests/cloudpickle/cloudpickle_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsly/tests/cloudpickle/cloudpickle_test.py b/srsly/tests/cloudpickle/cloudpickle_test.py index 6d31e13..25451df 100644 --- a/srsly/tests/cloudpickle/cloudpickle_test.py +++ b/srsly/tests/cloudpickle/cloudpickle_test.py @@ -116,7 +116,7 @@ def method_c(self): expected_keys = ["C_CONSTANT", "__doc__", "__firstlineno__", "method_c"] else: expected_keys = ["C_CONSTANT", "__doc__", "method_c"] - assert sorted(clsdict.keys()) == expected_keys + assert sorted(clsdict) == expected_keys assert clsdict["C_CONSTANT"] == 43 assert clsdict["__doc__"] is None assert clsdict["method_c"](C()) == C().method_c()