diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 596a5f8..546e311 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -103,8 +103,7 @@ jobs: - "3.10" - "3.11" - "3.12" - - "3.13.0-alpha - 3.13.0" - os: [ubuntu-20.04, macos-11] + os: [ubuntu-20.04, macos-11, windows-latest] exclude: - os: macos-11 python-version: "pypy-3.10" @@ -122,31 +121,37 @@ jobs: # to save the cache. So it must come before the thing we want to use # the cache. ### - - name: Get pip cache dir - id: pip-cache + - name: Get pip cache dir (default) + id: pip-cache-default + if: ${{ !startsWith(runner.os, 'Windows') }} run: | echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - - name: pip cache - uses: actions/cache@v3 + - name: Get pip cache dir (Windows) + id: pip-cache-windows + if: ${{ startsWith(runner.os, 'Windows') }} + run: | + echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT + + - name: pip cache (default) + uses: actions/cache@v4 + if: ${{ !startsWith(runner.os, 'Windows') }} with: - path: ${{ steps.pip-cache.outputs.dir }} + path: ${{ steps.pip-cache-default.outputs.dir }} + key: ${{ runner.os }}-pip-${{ matrix.python-version }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: pip cache (Windows) + uses: actions/cache@v4 + 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- - - name: Install Build Dependencies (3.13.0-alpha - 3.13.0) - if: matrix.python-version == '3.13.0-alpha - 3.13.0' - run: | - pip install -U pip - pip install -U setuptools wheel twine - # cffi will probably have no public release until a Python 3.13 beta - # or even RC release, see https://github.com/python-cffi/cffi/issues/23 - pip install -U "cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip" - # twine has no release for 3.13, yet, see https://github.com/pypa/twine/issues/1030 - pip install -U "git+https://github.com/pypa/twine.git#egg=twine" - name: Install Build Dependencies - if: matrix.python-version != '3.13.0-alpha - 3.13.0' run: | pip install -U pip pip install -U setuptools wheel twine cffi @@ -190,15 +195,7 @@ jobs: python setup.py build_ext -i python setup.py bdist_wheel - - name: Install persistent and dependencies (3.13.0-alpha - 3.13.0) - if: matrix.python-version == '3.13.0-alpha - 3.13.0' - run: | - # Install to collect dependencies into the (pip) cache. - # Use "--pre" here because dependencies with support for this future - # Python release may only be available as pre-releases - pip install --pre .[test] - name: Install persistent and dependencies - if: matrix.python-version != '3.13.0-alpha - 3.13.0' run: | # Install to collect dependencies into the (pip) cache. pip install .[test] @@ -242,7 +239,6 @@ jobs: && startsWith(github.ref, 'refs/tags') && startsWith(runner.os, 'Mac') && !startsWith(matrix.python-version, 'pypy') - && !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') env: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: | @@ -262,8 +258,7 @@ jobs: - "3.10" - "3.11" - "3.12" - - "3.13.0-alpha - 3.13.0" - os: [ubuntu-20.04, macos-11] + os: [ubuntu-20.04, macos-11, windows-latest] exclude: - os: macos-11 python-version: "pypy-3.10" @@ -281,15 +276,32 @@ jobs: # to save the cache. So it must come before the thing we want to use # the cache. ### - - name: Get pip cache dir - id: pip-cache + - name: Get pip cache dir (default) + id: pip-cache-default + if: ${{ !startsWith(runner.os, 'Windows') }} run: | echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - - name: pip cache - uses: actions/cache@v3 + - name: Get pip cache dir (Windows) + id: pip-cache-windows + if: ${{ startsWith(runner.os, 'Windows') }} + run: | + echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT + + - name: pip cache (default) + uses: actions/cache@v4 + 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- + + - name: pip cache (Windows) + uses: actions/cache@v4 + if: ${{ startsWith(runner.os, 'Windows') }} with: - path: ${{ steps.pip-cache.outputs.dir }} + path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-pip-${{ matrix.python-version }} restore-keys: | ${{ runner.os }}-pip- @@ -299,25 +311,7 @@ jobs: with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ - - name: Install persistent 3.13.0-alpha - 3.13.0 - if: ${{ startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }} - run: | - pip install -U wheel setuptools - # cffi will probably have no public release until a beta or even RC - # version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23 - pip install -U 'cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip ; platform_python_implementation == "CPython"' - # coverage has a wheel on PyPI for a future python version which is - # not ABI compatible with the current one, so build it from sdist: - pip install -U --no-binary :all: coverage - # Unzip into src/ so that testrunner can find the .so files - # when we ask it to load tests from that directory. This - # might also save some build time? - unzip -n dist/persistent-*whl -d src - # Use "--pre" here because dependencies with support for this future - # Python release may only be available as pre-releases - pip install --pre -U -e .[test] - name: Install persistent - if: ${{ !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }} run: | pip install -U wheel setuptools pip install -U coverage @@ -334,7 +328,9 @@ jobs: - name: Run tests without C extensions run: # coverage makes PyPy run about 3x slower! - PURE_PYTHON=1 python -m coverage run -p -m zope.testrunner --test-path=src --auto-color --auto-progress + python -m coverage run -p -m zope.testrunner --test-path=src --auto-color --auto-progress + env: + PURE_PYTHON: 1 - name: Report Coverage run: | coverage combine @@ -376,15 +372,32 @@ jobs: # to save the cache. So it must come before the thing we want to use # the cache. ### - - name: Get pip cache dir - id: pip-cache + - name: Get pip cache dir (default) + id: pip-cache-default + if: ${{ !startsWith(runner.os, 'Windows') }} run: | echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - - name: pip cache - uses: actions/cache@v3 + - name: Get pip cache dir (Windows) + id: pip-cache-windows + if: ${{ startsWith(runner.os, 'Windows') }} + run: | + echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT + + - name: pip cache (default) + uses: actions/cache@v4 + 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- + + - name: pip cache (Windows) + uses: actions/cache@v4 + if: ${{ startsWith(runner.os, 'Windows') }} with: - path: ${{ steps.pip-cache.outputs.dir }} + path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-pip-${{ matrix.python-version }} restore-keys: | ${{ runner.os }}-pip- @@ -427,15 +440,32 @@ jobs: # to save the cache. So it must come before the thing we want to use # the cache. ### - - name: Get pip cache dir - id: pip-cache + - name: Get pip cache dir (default) + id: pip-cache-default + if: ${{ !startsWith(runner.os, 'Windows') }} run: | echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - - name: pip cache - uses: actions/cache@v3 + - name: Get pip cache dir (Windows) + id: pip-cache-windows + if: ${{ startsWith(runner.os, 'Windows') }} + run: | + echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT + + - name: pip cache (default) + uses: actions/cache@v4 + if: ${{ !startsWith(runner.os, 'Windows') }} with: - path: ${{ steps.pip-cache.outputs.dir }} + path: ${{ steps.pip-cache-default.outputs.dir }} + key: ${{ runner.os }}-pip-${{ matrix.python-version }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: pip cache (Windows) + uses: actions/cache@v4 + 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- @@ -480,15 +510,32 @@ jobs: # to save the cache. So it must come before the thing we want to use # the cache. ### - - name: Get pip cache dir - id: pip-cache + - name: Get pip cache dir (default) + id: pip-cache-default + if: ${{ !startsWith(runner.os, 'Windows') }} run: | echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - - name: pip cache - uses: actions/cache@v3 + - name: Get pip cache dir (Windows) + id: pip-cache-windows + if: ${{ startsWith(runner.os, 'Windows') }} + run: | + echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT + + - name: pip cache (default) + uses: actions/cache@v4 + 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 + if: ${{ startsWith(runner.os, 'Windows') }} with: - path: ${{ steps.pip-cache.outputs.dir }} + path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} restore-keys: | ${{ runner.os }}-pip- @@ -526,7 +573,7 @@ jobs: path: wheelhouse/*whl name: manylinux_${{ matrix.image }}_wheels.zip - name: Restore pip cache permissions - run: sudo chown -R $(whoami) ${{ steps.pip-cache.outputs.dir }} + run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }} - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 if: > diff --git a/.manylinux-install.sh b/.manylinux-install.sh index 804f2e3..c0e755e 100755 --- a/.manylinux-install.sh +++ b/.manylinux-install.sh @@ -28,7 +28,6 @@ yum -y install libffi-devel tox_env_map() { case $1 in - *"cp313"*) echo 'py313';; *"cp37"*) echo 'py37';; *"cp38"*) echo 'py38';; *"cp39"*) echo 'py39';; @@ -42,20 +41,14 @@ tox_env_map() { # Compile wheels for PYBIN in /opt/python/*/bin; do if \ - [[ "${PYBIN}" == *"cp313"* ]] || \ [[ "${PYBIN}" == *"cp311"* ]] || \ [[ "${PYBIN}" == *"cp312"* ]] || \ [[ "${PYBIN}" == *"cp37"* ]] || \ [[ "${PYBIN}" == *"cp38"* ]] || \ [[ "${PYBIN}" == *"cp39"* ]] || \ [[ "${PYBIN}" == *"cp310"* ]] ; then - if [[ "${PYBIN}" == *"cp313"* ]] ; then - "${PYBIN}/pip" install --pre -e /io/ - "${PYBIN}/pip" wheel /io/ --pre -w wheelhouse/ - else - "${PYBIN}/pip" install -e /io/ - "${PYBIN}/pip" wheel /io/ -w wheelhouse/ - fi + "${PYBIN}/pip" install -e /io/ + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ if [ `uname -m` == 'aarch64' ]; then cd /io/ ${PYBIN}/pip install tox diff --git a/.meta.toml b/.meta.toml index 81e47b3..eadb91d 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,19 +2,19 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "0160ca3b" +commit-id = "905c2a64" [python] with-appveyor = true -with-windows = false +with-windows = true with-pypy = true -with-future-python = true +with-future-python = false with-docs = true with-sphinx-doctests = true with-macos = false [tox] -use-flake8 = false +use-flake8 = true coverage-command = [ "coverage run -m zope.testrunner --test-path=src {posargs:-vc}", "python -c 'import os, subprocess; subprocess.check_call(\"coverage run -a -m zope.testrunner --test-path=src\", env=dict(os.environ, PURE_PYTHON=\"1\"), shell=True)'", diff --git a/CHANGES.rst b/CHANGES.rst index 0e368a9..ffdbfb8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,9 @@ 5.3 (unreleased) ================ -- Nothing changed yet. +- Remove premature support for Python 3.13. + +- Build Windows wheels on GHA. 5.2 (2024-02-16) diff --git a/MANIFEST.in b/MANIFEST.in index 2657cbe..e6615af 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,7 +5,6 @@ include *.rst include *.txt include buildout.cfg include tox.ini -include appveyor.yml include .coveragerc recursive-include docs *.py diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c20525e..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/c-code -environment: - # Currently the builds use @mgedmin's Appveyor account. The PyPI token belongs - # to zope.wheelbuilder, which is managed by @mgedmin and @dataflake. - - global: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: - secure: aoZC/+rvJKg8B5GMGIxd1WN5nlr8JpHkzvR9PeQFNDJjz6AQ4dSfbdAxcUzjgusof0wqc7W2m4XhdWQdXVPQ8D62xeizEEG/ONwTczHdE6dfl87VZ23egxbGmsQtcf/Rxa1jvEsHAFAYFMGndArmZ3slMSeQCwEfc/blpNlVi7VcLYcCbKqh9q41DPhIuq3HcLypdocMu9aooDzwqia69n1e7ZkFpBnQu53YxZhuFQmzoY2pBJAM3uI4+6yrH3wUw9QF0ySzrgpgN9oLE2RVUg== - - matrix: - - python: 37-x64 - - python: 38-x64 - - python: 39-x64 - - python: 310-x64 - - python: 311-x64 - - python: 312-x64 - # `multibuild` cannot install non-final versions as they are not on - # ftp.python.org, so we skip Python 3.13 until its final release: - # - python: 313-x64 - -install: - - "SET PYTHONVERSION=%PYTHON%" - - "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%" - - ps: | - $env:PYTHON = "C:\\Python${env:PYTHON}" - if (-not (Test-Path $env:PYTHON)) { - curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/11a389d78892cf90addac8f69433d5e22bfa422a/install_python.ps1 - .\install_python.ps1 - } - - ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" } - - echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat" - - python -m pip install -U pip - - pip install -U setuptools wheel - - pip install cffi - - pip install -U -e .[test] - -matrix: - fast_finish: true - -build_script: - - python -W ignore setup.py -q bdist_wheel - -test_script: - - zope-testrunner --test-path=src -artifacts: - - path: 'dist\*.whl' - name: wheel - -deploy_script: - - ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE) { pip install twine; twine upload --skip-existing dist\*.whl } - -deploy: on diff --git a/setup.cfg b/setup.cfg index 8e94b86..d818cbe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,5 @@ # Generated from: # https://github.com/zopefoundation/meta/tree/master/config/c-code -[bdist_wheel] -universal = 0 [zest.releaser] create-wheel = no diff --git a/tox.ini b/tox.ini index 2ff11e8..00acbe7 100644 --- a/tox.ini +++ b/tox.ini @@ -10,17 +10,14 @@ envlist = py310,py310-pure py311,py311-pure py312,py312-pure - py313,py313-pure pypy3 docs coverage [testenv] usedevelop = true -pip_pre = py313: true deps = py37: urllib3 < 2 - Sphinx setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0 @@ -62,7 +59,7 @@ deps = commands_pre = commands = check-manifest - check-python-versions + check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml python -m build --sdist --no-isolation twine check dist/* @@ -71,8 +68,10 @@ basepython = python3 skip_install = true deps = isort + flake8 commands = isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py + flake8 src setup.py [testenv:isort-apply] basepython = python3