Skip to content

Commit

Permalink
Merge pull request #76 from zopefoundation/config-with-c-code-templat…
Browse files Browse the repository at this point in the history
…e-4dc0484e

Build Windows wheels on GHA
  • Loading branch information
dataflake committed May 25, 2024
2 parents dc8bfce + bbb3c2b commit 8ecbd46
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 50 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
70 changes: 45 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,16 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
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 @@ -115,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 @@ -151,15 +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 cffi
pip install -U "setuptools<69" wheel twine
- name: Install Build Dependencies
if: matrix.python-version != '3.13'
run: |
pip install -U pip
pip install -U setuptools wheel twine cffi
pip install -U "setuptools<69" wheel twine
- name: Build ExtensionClass (macOS x86_64, Python 3.8+)
if: >
Expand Down Expand Up @@ -200,14 +208,15 @@ jobs:
python setup.py build_ext -i
python setup.py bdist_wheel
- name: Install ExtensionClass and dependencies (3.13.0-alpha - 3.13.0)
if: matrix.python-version == '3.13.0-alpha - 3.13.0'
- name: Install ExtensionClass 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 ExtensionClass and dependencies
if: matrix.python-version != '3.13'
run: |
# Install to collect dependencies into the (pip) cache.
pip install .[test]
Expand Down Expand Up @@ -242,15 +251,16 @@ jobs:
with:
name: ExtensionClass-${{ 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')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
Expand All @@ -270,10 +280,16 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
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 @@ -282,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 @@ -323,10 +340,10 @@ jobs:
with:
name: ExtensionClass-${{ runner.os }}-${{ matrix.python-version }}.whl
path: dist/
- name: Install ExtensionClass 3.13.0-alpha - 3.13.0 ${{ matrix.python-version }}
if: matrix.python-version == '3.13.0-alpha - 3.13.0'
- name: Install ExtensionClass 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 @@ -336,10 +353,11 @@ jobs:
unzip -n dist/ExtensionClass-*whl -d src
# Use "--pre" here because dependencies with support for this future
# Python release may only be available as pre-releases
txt pip install --pre -U -e .[test]
pip install --pre -U -e .[test]
- name: Install ExtensionClass
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 @@ -370,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 @@ -383,7 +401,7 @@ jobs:
strategy:
matrix:
python-version: ["3.9"]
os: [ubuntu-20.04]
os: [ubuntu-latest]

steps:
- name: checkout
Expand All @@ -392,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 @@ -447,7 +466,7 @@ jobs:
# python -m pylint --limit-inference-results=1 --rcfile=.pylintrc ExtensionClass -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:
Expand All @@ -462,6 +481,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 @@ -540,5 +560,5 @@ jobs:
with:
user: __token__
password: ${{ secrets.TWINE_PASSWORD }}
skip_existing: true
packages_dir: wheelhouse/
skip-existing: true
packages-dir: wheelhouse/
23 changes: 15 additions & 8 deletions .manylinux-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ yum -y install libffi-devel

tox_env_map() {
case $1 in
*"cp313"*) echo 'py313';;
*"cp37"*) echo 'py37';;
*"cp38"*) echo 'py38';;
*"cp39"*) echo 'py39';;
Expand All @@ -41,14 +42,20 @@ 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}/pip" install -e /io/
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
[[ "${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
if [ `uname -m` == 'aarch64' ]; then
cd /io/
${PYBIN}/pip install tox
Expand Down
19 changes: 3 additions & 16 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[meta]
template = "c-code"
commit-id = "8daa034c"
commit-id = "4dc0484e"

[python]
with-appveyor = false
with-windows = true
with-pypy = true
with-sphinx-doctests = false
with-future-python = false
with-future-python = true
with-macos = false
with-docs = false

Expand All @@ -24,17 +25,3 @@ additional-rules = [
"recursive-include src *.c",
"recursive-include src *.h",
]

[appveyor]
global-env-vars = [
"# Currently the builds use @dataflake's Appveyor account. The PyPI token",
"# belongs to zope.wheelbuilder, managed by @mgedmin and @dataflake.",
"",
"global:",
" TWINE_USERNAME: __token__",
" TWINE_PASSWORD:",
" secure: vSlDBj79vziJOA5k3z16r+g2o8qgGdqRpJVY3YveTMjA87uX1OCZ14dtAzko9qt4mUGGnm66Ps3w0me/5dU1ufMR5kSaAhX0g1m1oSkJ/Ti2AyvygqlsMzC7r/atGXSXUrlb7UFz5WKpWedUic7193xIFxG23EFCrxsgQziucw1eQLXebsB4LvmF7wrJy+9LUgTgsvy6B/fc37SRKE+611+H8HVo8SmPVp+dyDyeDX+hpnt5Qhp1kbPCqlJfJoy3CHxX+slUu7ZUS28BUT5vHA==",
]
build-script = [
"- python -W ignore setup.py -q bdist_wheel",
]
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

- Build Windows wheels on GHA.

- Add preliminary support for Python 3.13.
- Add preliminary support for Python 3.13 as of 3.13b1.


5.1 (2023-10-05)
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ envlist =
py310,py310-pure
py311,py311-pure
py312,py312-pure
py313,py313-pure
pypy3
coverage

[testenv]
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 8ecbd46

Please sign in to comment.