diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8629b93..5141cd2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -102,7 +102,12 @@ jobs: - "3.10" - "3.11" - "3.12" - os: [ubuntu-20.04, macos-11] + os: [ubuntu-latest, macos-latest, windows-latest] + - os: macos-latest + python-version: "3.7" + include: + - python-version: "3.7" + os: macos-12 steps: - name: checkout @@ -117,15 +122,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 + - 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- @@ -133,7 +155,7 @@ jobs: - name: Install Build Dependencies run: | pip install -U pip - pip install -U setuptools wheel twine cffi + pip install -U "setuptools<69" wheel twine - name: Build AccessControl (macOS x86_64, Python 3.8+) if: > @@ -209,14 +231,14 @@ jobs: with: name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/*whl - - name: Publish package to PyPI (mac) - # We cannot 'uses: pypa/gh-action-pypi-publish@v1.4.1' because - # that's apparently a container action, and those don't run on - # the Mac. + - name: Publish package to PyPI (Non-Linux) + # We cannot use pypa/gh-action-pypi-publish because that + # is a container action, and those don't run on macOS + # or Windows GHA runners. if: > github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - && startsWith(runner.os, 'Mac') + && !startsWith(runner.os, 'Linux') && !startsWith(matrix.python-version, 'pypy') env: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} @@ -236,7 +258,12 @@ jobs: - "3.10" - "3.11" - "3.12" - os: [ubuntu-20.04, macos-11] + os: [ubuntu-latest, macos-latest, windows-latest] + - os: macos-latest + python-version: "3.7" + include: + - python-version: "3.7" + os: macos-12 steps: - name: checkout @@ -251,15 +278,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 + - 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- @@ -271,7 +315,7 @@ jobs: path: dist/ - name: Install AccessControl run: | - pip install -U wheel setuptools + pip install -U wheel "setuptools<69" pip install -U coverage pip install -U 'cffi; platform_python_implementation == "CPython"' # Unzip into src/ so that testrunner can find the .so files @@ -286,7 +330,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 @@ -300,7 +346,7 @@ jobs: coveralls_finish: needs: test - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Coveralls Finished uses: AndreMiras/coveralls-python-action@develop @@ -313,7 +359,7 @@ jobs: strategy: matrix: python-version: ["3.9"] - os: [ubuntu-20.04] + os: [ubuntu-latest] steps: - name: checkout @@ -328,15 +374,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 + - 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- @@ -360,7 +423,7 @@ jobs: # python -m pylint --limit-inference-results=1 --rcfile=.pylintrc AccessControl -f parseable -r n manylinux: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name # We use a regular Python matrix entry to share as much code as possible. strategy: @@ -381,15 +444,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 + - 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- @@ -427,7 +507,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: > @@ -436,5 +516,5 @@ jobs: with: user: __token__ password: ${{ secrets.TWINE_PASSWORD }} - skip_existing: true - packages_dir: wheelhouse/ + skip-existing: true + packages-dir: wheelhouse/ diff --git a/.manylinux-install.sh b/.manylinux-install.sh index c2fbd1f..bc779a3 100755 --- a/.manylinux-install.sh +++ b/.manylinux-install.sh @@ -41,12 +41,12 @@ tox_env_map() { # Compile wheels for PYBIN in /opt/python/*/bin; do if \ - [[ "${PYBIN}" == *"cp311"* ]] || \ - [[ "${PYBIN}" == *"cp312"* ]] || \ - [[ "${PYBIN}" == *"cp37"* ]] || \ - [[ "${PYBIN}" == *"cp38"* ]] || \ - [[ "${PYBIN}" == *"cp39"* ]] || \ - [[ "${PYBIN}" == *"cp310"* ]] ; then + [[ "${PYBIN}" == *"cp311/"* ]] || \ + [[ "${PYBIN}" == *"cp312/"* ]] || \ + [[ "${PYBIN}" == *"cp37/"* ]] || \ + [[ "${PYBIN}" == *"cp38/"* ]] || \ + [[ "${PYBIN}" == *"cp39/"* ]] || \ + [[ "${PYBIN}" == *"cp310/"* ]] ; then "${PYBIN}/pip" install -e /io/ "${PYBIN}/pip" wheel /io/ -w wheelhouse/ if [ `uname -m` == 'aarch64' ]; then diff --git a/.meta.toml b/.meta.toml index 988b4d8..48ee12f 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,15 +2,16 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "1351c95d" +commit-id = "4dc0484e" [python] -with-appveyor = true -with-windows = false +with-appveyor = false +with-windows = true with-pypy = false with-future-python = false with-sphinx-doctests = false with-macos = false +with-docs = false [tox] use-flake8 = true @@ -36,14 +37,3 @@ additional-rules = [ "recursive-include src *.h", "recursive-include src *.zcml", ] - -[appveyor] -global-env-vars = [ - "# Currently the builds use @dataflake's Appveyor account. The PyPI token belongs", - "# to zope.wheelbuilder, which is managed by @mgedmin and @dataflake.", - "", - "global:", - " TWINE_USERNAME: __token__", - " TWINE_PASSWORD:", - " secure: vSlDBj79vziJOA5k3z16r1OSr/7Jq6uCf23VKErSsXWb2dGJMUxR6GQ6tRs53GfiyxBQdpdfOA5QuVS4G4W3rVLwD/YXCidpidwBF3pKk4J2Nnk88HpZID6lQOV713DA/kkEuoO97Ty1BRYeaca9bA0P0KmRYU7Iy30p4xBUnmNKYnfilH0/waASYEDwpkrl49DiUh1+bMQjE5LKIBeaF0LLquzHGYETQf4BgpywUIV/8dQnc0vL/RXCa6PrWOxg/8S6ponIYyJ32Y4OoprZ1Q==", - ] diff --git a/CHANGES.rst b/CHANGES.rst index cba7b56..8907d9e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,8 @@ For changes before version 3.0, see ``HISTORY.rst``. 6.4 (unreleased) ---------------- +- Build Windows wheels on GHA. + - Make dict views (`.keys()`, `.items()` and `.values()`) behave like their unrestricted versions. (`#147 `_) diff --git a/MANIFEST.in b/MANIFEST.in index 892ccdf..1644588 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 src *.py diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c52887a..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/c-code -environment: - # Currently the builds use @dataflake's Appveyor account. The PyPI token belongs - # to zope.wheelbuilder, which is managed by @mgedmin and @dataflake. - - global: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: - secure: vSlDBj79vziJOA5k3z16r1OSr/7Jq6uCf23VKErSsXWb2dGJMUxR6GQ6tRs53GfiyxBQdpdfOA5QuVS4G4W3rVLwD/YXCidpidwBF3pKk4J2Nnk88HpZID6lQOV713DA/kkEuoO97Ty1BRYeaca9bA0P0KmRYU7Iy30p4xBUnmNKYnfilH0/waASYEDwpkrl49DiUh1+bMQjE5LKIBeaF0LLquzHGYETQf4BgpywUIV/8dQnc0vL/RXCa6PrWOxg/8S6ponIYyJ32Y4OoprZ1Q== - - matrix: - - python: 37-x64 - - python: 38-x64 - - python: 39-x64 - - python: 310-x64 - - python: 311-x64 - - python: 312-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 -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/tox.ini b/tox.ini index b6e7d09..581d03c 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,7 @@ envlist = [testenv] usedevelop = true deps = + setuptools < 69 setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0