diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f5caa14..2737e95 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -94,10 +94,14 @@ jobs: - "3.12" - "3.13" - "3.14" - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] exclude: - os: macos-latest python-version: "pypy-3.11" + - os: windows-11-arm + python-version: "pypy-3.11" + - os: windows-11-arm + python-version: "3.10" include: - python-version: "3.14t" os: ubuntu-latest @@ -131,27 +135,24 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} + - name: Install Build Dependencies run: | pip install -U pip - pip install -U "setuptools >= 78.1.1,< 81" wheel twine + pip install -U "setuptools >= 78.1.1,< 82" wheel twine - name: Build persistent (macOS x86_64) if: > @@ -189,10 +190,17 @@ jobs: python setup.py build_ext -i python setup.py bdist_wheel + - name: Create persistent sdist + if: > + startsWith(runner.os, 'Linux') + && matrix.python-version == '3.14' + run: | + python setup.py sdist + - name: Install persistent and dependencies run: | # Install to collect dependencies into the (pip) cache. - pip install -U pip "setuptools >= 78.1.1,< 81" + pip install -U pip "setuptools >= 78.1.1,< 82" pip install .[test] - name: Check persistent build @@ -202,7 +210,7 @@ jobs: - name: Upload persistent wheel (macOS x86_64) if: > startsWith(runner.os, 'Mac') - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: # The x86_64 wheel is uploaded with a different name just so it can be # manually downloaded when desired. The wheel itself *cannot* be tested @@ -213,18 +221,33 @@ jobs: if: > startsWith(runner.os, 'Mac') && !startsWith(matrix.python-version, 'pypy') - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/*arm64.whl - - name: Upload persistent wheel (all other platforms) - if: > - !startsWith(runner.os, 'Mac') - uses: actions/upload-artifact@v4 + - name: Upload persistent wheel (Windows) + if: startsWith(runner.os, 'Windows') + uses: actions/upload-artifact@v7 + with: + name: persistent-${{ runner.os }}-${{ matrix.python-version }}-${{ runner.arch }}.whl + path: dist/*whl + + - name: Upload persistent wheel (Linux) + if: startsWith(runner.os, 'Linux') + uses: actions/upload-artifact@v7 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/*whl + - name: Upload persistent sdist + if: > + startsWith(runner.os, 'Linux') + && matrix.python-version == '3.14' + uses: actions/upload-artifact@v7 + with: + name: persistent.tar.gz + path: dist/*gz + test: needs: build-package runs-on: ${{ matrix.os }} @@ -238,10 +261,14 @@ jobs: - "3.12" - "3.13" - "3.14" - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] exclude: - os: macos-latest python-version: "pypy-3.11" + - os: windows-11-arm + python-version: "pypy-3.11" + - os: windows-11-arm + python-version: "3.10" include: - python-version: "3.14t" os: ubuntu-latest @@ -275,31 +302,35 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - - name: Download persistent wheel - uses: actions/download-artifact@v4 + - name: Download persistent wheel (Linux/macOS) + if: "!startsWith(runner.os, 'Windows')" + uses: actions/download-artifact@v8 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ + + - name: Download persistent wheel (Windows) + if: startsWith(runner.os, 'Windows') + uses: actions/download-artifact@v8 + with: + name: persistent-${{ runner.os }}-${{ matrix.python-version }}-${{ runner.arch }}.whl + path: dist/ - name: Install persistent run: | - pip install -U wheel "setuptools >= 78.1.1,< 81" + pip install -U wheel "setuptools >= 78.1.1,< 82" pip install -U coverage[toml] pip install -U 'cffi; platform_python_implementation == "CPython"' # Unzip into src/ so that testrunner can find the .so files @@ -375,25 +406,21 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - name: Download persistent wheel - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ @@ -446,25 +473,21 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - name: Download persistent wheel - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ @@ -524,22 +547,19 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- + - name: Update pip run: pip install -U pip @@ -562,7 +582,7 @@ jobs: bash .manylinux.sh - name: Upload persistent wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: path: wheelhouse/*whl name: manylinux_${{ matrix.image }}_wheels.zip @@ -586,7 +606,7 @@ jobs: steps: - name: Download all wheel artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: path: dist/ pattern: '*' diff --git a/.meta.toml b/.meta.toml index 89c34c2..4596477 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/c-code [meta] template = "c-code" -commit-id = "2dc4f53b" +commit-id = "2c0272ea" [python] with-windows = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1e0027..59609e1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ minimum_pre_commit_version: '3.6' repos: - repo: https://github.com/pycqa/isort - rev: "7.0.0" + rev: "8.0.1" hooks: - id: isort - repo: https://github.com/hhatto/autopep8 @@ -20,6 +20,7 @@ repos: rev: 0.4.3 hooks: - id: teyit + language_version: python3.13 - repo: https://github.com/PyCQA/flake8 rev: "7.3.0" hooks: diff --git a/CHANGES.rst b/CHANGES.rst index f2efa48..61005d7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,10 @@ Change log 6.6 (unreleased) ---------------- +- Add support for automatically building and publishing Windows/ARM64 wheels. + +- Add support for automatically building and publishing source distributions. + - Fix compilation on free-threaded Python 3.14t: replace direct ``ob_refcnt``/``ob_type`` struct access with ``Py_REFCNT()``/``Py_TYPE()`` API macros, fix ``Py_BuildValue`` format strings for ``Py_ssize_t``. diff --git a/pyproject.toml b/pyproject.toml index 130b5fc..3f212ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,3 +97,7 @@ source = [ [tool.setuptools.dynamic] readme = {file = ["README.rst", "CHANGES.rst"]} + +[tool.zest-releaser] +create-wheel = false +upload-pypi = false diff --git a/setup.cfg b/setup.cfg index 0555033..e5546af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,9 +1,5 @@ # Generated with zope.meta (https://zopemeta.readthedocs.io/) from: # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/c-code - -[zest.releaser] -create-wheel = no - [flake8] doctests = 1 diff --git a/tox.ini b/tox.ini index 7490f9e..f4878c4 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ envlist = [testenv] deps = - setuptools >= 78.1.1,< 81 + setuptools >= 78.1.1,< 82 setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0 @@ -60,12 +60,12 @@ deps = twine build check-manifest - check-python-versions >= 0.20.0 + check-python-versions >= 0.24.2 wheel commands_pre = commands = check-manifest - check-python-versions --only pyproject.toml,setup.py,tox.ini + check-python-versions --only pyproject.toml,setup.py,tox.ini,.github/workflows/tests.yml python -m build --sdist --no-isolation twine check dist/*