Skip to content

Commit

Permalink
Configuring for c-code
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed May 27, 2024
1 parent a83e3ab commit bfa31c8
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 44 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ source =
[report]
show_missing = true
precision = 2
ignore_errors = True
exclude_lines =
except ImportError:
if __name__ == '__main__':
Expand Down
81 changes: 46 additions & 35 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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: >
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -389,7 +401,7 @@ jobs:
strategy:
matrix:
python-version: ["3.9"]
os: [ubuntu-20.04]
os: [ubuntu-latest]

steps:
- name: checkout
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -546,5 +557,5 @@ jobs:
with:
user: __token__
password: ${{ secrets.TWINE_PASSWORD }}
skip_existing: true
packages_dir: wheelhouse/
skip-existing: true
packages-dir: wheelhouse/
16 changes: 8 additions & 8 deletions .manylinux-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ envlist =
usedevelop = true
pip_pre = py313: true
deps =
setuptools < 69
setenv =
pure: PURE_PYTHON=1
!pure-!pypy3: PURE_PYTHON=0
Expand Down

0 comments on commit bfa31c8

Please sign in to comment.