diff --git a/.github/workflows/external-zstd.yml b/.github/workflows/external-zstd.yml index 9b09f215..a73e8d83 100644 --- a/.github/workflows/external-zstd.yml +++ b/.github/workflows/external-zstd.yml @@ -61,4 +61,11 @@ jobs: - name: Build run: | + # Homebrew's prefix (/opt/homebrew on Apple Silicon) isn't on the + # default compiler search paths, and its libzstd is arm64 only, so + # don't build the universal2 binary the Python framework asks for. + ZSTD_PREFIX="$(brew --prefix zstd)" + export CFLAGS="-I${ZSTD_PREFIX}/include" + export LDFLAGS="-L${ZSTD_PREFIX}/lib" + export ARCHFLAGS="-arch arm64" python -m pip install --config-settings=--global-option=--system-zstd . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce563e4c..e64eafb3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,8 @@ jobs: - '3.13t' - '3.14' - '3.14t' + - '3.15' + - '3.15t' arch: - 'arm64' - 'x86' diff --git a/.github/workflows/typing.yml b/.github/workflows/typing.yml index 926b5933..f147b949 100644 --- a/.github/workflows/typing.yml +++ b/.github/workflows/typing.yml @@ -22,6 +22,8 @@ jobs: - '3.13t' - '3.14' - '3.14t' + - '3.15' + - '3.15t' runs-on: 'ubuntu-24.04' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index a7a8ea29..bcf3efed 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -22,6 +22,8 @@ jobs: - 'cp313' - 'cp314' - 'cp314t' + - 'cp315' + - 'cp315t' arch: - 'aarch64' - 'i686' @@ -66,11 +68,19 @@ jobs: image: 'manylinux2014' - py: 'cp314t' image: 'manylinux2014' + - py: 'cp315' + image: 'manylinux2014' + - py: 'cp315t' + image: 'manylinux2014' # Drop support for musllinux_1_1 on 3.14+ - py: 'cp314' image: 'musllinux_1_1' - py: 'cp314t' image: 'musllinux_1_1' + - py: 'cp315' + image: 'musllinux_1_1' + - py: 'cp315t' + image: 'musllinux_1_1' runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} env: CIBW_ARCHS: ${{ matrix.arch }} @@ -104,7 +114,7 @@ jobs: - name: Build wheels run: | - uvx -p 3.13 cibuildwheel@4.1.0 + uvx -p 3.13 cibuildwheel@4.3.1 - name: Upload Wheel if: ${{ !endsWith(matrix.py, 't') }} @@ -124,6 +134,8 @@ jobs: - 'cp313' - 'cp314' - 'cp314t' + - 'cp315' + - 'cp315t' arch: - 'arm64' - 'x86_64' @@ -144,7 +156,7 @@ jobs: - name: Build wheels run: | - uvx -p 3.13 cibuildwheel@4.1.0 + uvx -p 3.13 cibuildwheel@4.3.1 - name: Upload Wheel if: ${{ !endsWith(matrix.py, 't') }} @@ -164,6 +176,8 @@ jobs: - 'cp313' - 'cp314' - 'cp314t' + - 'cp315' + - 'cp315t' arch: - 'win32' - 'win_amd64' @@ -188,7 +202,7 @@ jobs: - name: Build wheels run: | - uvx -p 3.13 cibuildwheel@4.1.0 + uvx -p 3.13 cibuildwheel@4.3.1 - name: Upload Wheel if: ${{ !endsWith(matrix.py, 't') }} diff --git a/ci/conda/meta.yaml b/ci/conda/meta.yaml index cbea594a..2311ac3b 100644 --- a/ci/conda/meta.yaml +++ b/ci/conda/meta.yaml @@ -1,8 +1,12 @@ -{% set data = load_setup_py_data() %} +# Don't use load_setup_py_data(): it runs setup.py inside the conda-build +# process, and setup.py's sys.path.insert(0, ".") then makes the unbuilt +# zstandard package in the source tree shadow the zstandard bindings that +# conda-package-handling needs for .conda support. +{% set version_match = load_file_regex(load_file="../../c-ext/python-zstandard.h", regex_pattern='PYTHON_ZSTANDARD_VERSION "([^"]+)"', from_recipe_dir=True) %} package: name: zstandard - version: "{{ data.get('version') }}" + version: "{{ version_match.group(1) }}" source: path: ../../ diff --git a/docs/installing.rst b/docs/installing.rst index c2f0e72b..8391f899 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -22,10 +22,10 @@ this package with ``conda``. Requirements ============ -This package is designed to run with Python 3.10, 3.11, 3.12, 3.13, and 3.14 -on common platforms (Linux, Windows, and OS X). On PyPy (both PyPy2 and PyPy3) -we support version 6.0.0 and above. x86 and x86_64 are well-tested on Windows. -Only x86_64 is well-tested on Linux and macOS. +This package is designed to run with Python 3.10, 3.11, 3.12, 3.13, 3.14, +and 3.15 on common platforms (Linux, Windows, and OS X). On PyPy (both PyPy2 +and PyPy3) we support version 6.0.0 and above. x86 and x86_64 are well-tested +on Windows. Only x86_64 is well-tested on Linux and macOS. CFFI Backend ============ diff --git a/docs/news.rst b/docs/news.rst index ff7a4f54..f0abafd8 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -19,6 +19,13 @@ Backwards Compatibility Notes * cibuildwheel upgrade required us to drop generating the CPython 3.13 free-threaded wheels. +Changes +------- + +* Python 3.15 support. We build wheels (including free-threaded ``cp315t`` + wheels) and have CI test coverage. Like 3.14, Linux wheels are built with + ``manylinux_2_28`` and ``musllinux_1_2``. + 0.25.0 (released 2025-09-14) ============================ diff --git a/pyproject.toml b/pyproject.toml index b358a7f5..b2b74145 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Programming Language :: Python :: Free Threading :: 1 - Unstable", ] keywords = ["zstandard", "zstd", "compression"] @@ -42,14 +43,20 @@ requires = [ build-backend = "setuptools.build_meta" [dependency-groups] -dev = [ +# Dependencies needed to run the test suite. cibuildwheel installs this group +# unlocked inside its build containers, so keep it free of packages (like mypy) +# without wheels for every platform we build. +test = [ "cffi~=1.17; platform_python_implementation != 'PyPy' and python_version < '3.14'", "cffi>=2.0.0b; platform_python_implementation != 'PyPy' and python_version >= '3.14'", "hypothesis==6.111.0", - "mypy>=1.17.1", "pytest>=8.4.1", "pytest-xdist>=3.8.0", ] +dev = [ + { include-group = "test" }, + "mypy>=1.17.1", +] [tool.pytest.ini_options] testpaths = ["tests"] @@ -71,7 +78,7 @@ test-command = [ "pytest -v --numprocesses=auto", "PYTHON_ZSTANDARD_IMPORT_POLICY=cffi pytest -v --numprocesses=auto", ] -test-groups = ["dev"] +test-groups = ["test"] test-sources = ["tests"] [tool.cibuildwheel.linux] diff --git a/tests/conftest.py b/tests/conftest.py index 84e71215..dcba0693 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,9 @@ def pytest_configure(config): default_settings = hypothesis.settings(deadline=10000) hypothesis.settings.register_profile("default", default_settings) - ci_settings = hypothesis.settings(deadline=20000, max_examples=1000) + # Shared CI runners (notably the Intel macOS ones) are slow and noisy + # enough that per-example deadlines only produce flaky failures. + ci_settings = hypothesis.settings(deadline=None, max_examples=1000) hypothesis.settings.register_profile("ci", ci_settings) expensive_settings = hypothesis.settings(deadline=None, max_examples=10000) diff --git a/uv.lock b/uv.lock index 89fdd450..717aa37f 100644 --- a/uv.lock +++ b/uv.lock @@ -420,6 +420,13 @@ dev = [ { name = "pytest" }, { name = "pytest-xdist" }, ] +test = [ + { name = "cffi", version = "1.17.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14' and platform_python_implementation != 'PyPy'" }, + { name = "cffi", version = "2.0.0b1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.14' and platform_python_implementation != 'PyPy'" }, + { name = "hypothesis" }, + { name = "pytest" }, + { name = "pytest-xdist" }, +] [package.metadata] requires-dist = [ @@ -437,3 +444,10 @@ dev = [ { name = "pytest", specifier = ">=8.4.1" }, { name = "pytest-xdist", specifier = ">=3.8.0" }, ] +test = [ + { name = "cffi", marker = "python_full_version < '3.14' and platform_python_implementation != 'PyPy'", specifier = "~=1.17" }, + { name = "cffi", marker = "python_full_version >= '3.14' and platform_python_implementation != 'PyPy'", specifier = ">=2.0.0b0" }, + { name = "hypothesis", specifier = "==6.111.0" }, + { name = "pytest", specifier = ">=8.4.1" }, + { name = "pytest-xdist", specifier = ">=3.8.0" }, +]