From bfa31c8c4618bbd66e4c7926574d2557ca697924 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Mon, 27 May 2024 10:57:35 -0400 Subject: [PATCH] Configuring for c-code --- .coveragerc | 1 + .github/workflows/tests.yml | 81 +++++++++++++++++++++---------------- .manylinux-install.sh | 16 ++++---- .meta.toml | 2 +- tox.ini | 1 + 5 files changed, 57 insertions(+), 44 deletions(-) diff --git a/.coveragerc b/.coveragerc index 4470c06..643e461 100644 --- a/.coveragerc +++ b/.coveragerc @@ -15,6 +15,7 @@ source = [report] show_missing = true precision = 2 +ignore_errors = True exclude_lines = except ImportError: if __name__ == '__main__': diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84305b2..9cae6bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -103,11 +103,16 @@ jobs: - "3.10" - "3.11" - "3.12" - - "3.13.0-alpha - 3.13.0" - os: [ubuntu-20.04, macos-11, windows-latest] + - "3.13" + os: [ubuntu-latest, macos-latest, windows-latest] exclude: - - os: macos-11 + - os: macos-latest + python-version: "3.7" + - os: macos-latest python-version: "pypy-3.10" + include: + - python-version: "3.7" + os: macos-12 steps: - name: checkout @@ -116,6 +121,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -152,16 +158,16 @@ jobs: 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' + - name: Install Build Dependencies (3.13) + if: matrix.python-version == '3.13' run: | pip install -U pip - pip install -U setuptools wheel twine + pip install -U "setuptools<69" wheel twine - name: Install Build Dependencies - if: matrix.python-version != '3.13.0-alpha - 3.13.0' + if: matrix.python-version != '3.13' run: | pip install -U pip - pip install -U setuptools wheel twine + pip install -U "setuptools<69" wheel twine - name: Build zodbpickle (macOS x86_64, Python 3.8+) if: > @@ -202,15 +208,15 @@ jobs: python setup.py build_ext -i python setup.py bdist_wheel - - name: Install zodbpickle and dependencies (3.13.0-alpha - 3.13.0) - if: matrix.python-version == '3.13.0-alpha - 3.13.0' + - name: Install zodbpickle and dependencies (3.13) + if: matrix.python-version == '3.13' 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 zodbpickle and dependencies - if: matrix.python-version != '3.13.0-alpha - 3.13.0' + if: matrix.python-version != '3.13' run: | # Install to collect dependencies into the (pip) cache. pip install .[test] @@ -245,16 +251,16 @@ jobs: with: name: zodbpickle-${{ 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') - && !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') + && !startsWith(matrix.python-version, '3.13') env: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: | @@ -274,11 +280,16 @@ jobs: - "3.10" - "3.11" - "3.12" - - "3.13.0-alpha - 3.13.0" - os: [ubuntu-20.04, macos-11, windows-latest] + - "3.13" + os: [ubuntu-latest, macos-latest, windows-latest] exclude: - - os: macos-11 + - os: macos-latest + python-version: "3.7" + - os: macos-latest python-version: "pypy-3.10" + include: + - python-version: "3.7" + os: macos-12 steps: - name: checkout @@ -287,6 +298,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -328,10 +340,10 @@ jobs: with: name: zodbpickle-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ - - name: Install zodbpickle 3.13.0-alpha - 3.13.0 ${{ matrix.python-version }} - if: matrix.python-version == '3.13.0-alpha - 3.13.0' + - name: Install zodbpickle 3.13 ${{ matrix.python-version }} + if: matrix.python-version == '3.13' run: | - pip install -U wheel setuptools + pip install -U wheel "setuptools<69" # coverage might have 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 @@ -343,9 +355,9 @@ jobs: # Python release may only be available as pre-releases pip install --pre -U -e .[test] - name: Install zodbpickle - if: ${{ !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }} + if: matrix.python-version != '3.13' 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 @@ -376,7 +388,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 @@ -389,7 +401,7 @@ jobs: strategy: matrix: python-version: ["3.9"] - os: [ubuntu-20.04] + os: [ubuntu-latest] steps: - name: checkout @@ -398,6 +410,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -445,15 +458,12 @@ jobs: pip install -U wheel pip install -U `ls dist/zodbpickle-*`[test] - name: Lint - # We only need to do this on one version, and it should be Python 3, because - # pylint has stopped updating for Python 2. - # TODO: Pick a linter and configuration and make this step right. run: | - pip install -U pylint - # python -m pylint --limit-inference-results=1 --rcfile=.pylintrc zodbpickle -f parseable -r n + pip install -U tox + tox -e lint 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: @@ -468,6 +478,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -546,5 +557,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 d8e6422..6028f54 100755 --- a/.manylinux-install.sh +++ b/.manylinux-install.sh @@ -42,14 +42,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}" == *"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 diff --git a/.meta.toml b/.meta.toml index 57f6fef..08bc93a 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "8daa034c" +commit-id = "1c0f31f5" [python] with-appveyor = true diff --git a/tox.ini b/tox.ini index c828791..5e22ccf 100644 --- a/tox.ini +++ b/tox.ini @@ -18,6 +18,7 @@ envlist = usedevelop = true pip_pre = py313: true deps = + setuptools < 69 setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0