Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
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
#
# EditorConfig Configuration file, for more details see:
# http://EditorConfig.org
# https://EditorConfig.org
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
# file types
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: 3.x
python-version: '3.13'
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1
with:
extra_args: --all-files --show-diff-on-failure
Expand Down
136 changes: 79 additions & 57 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ jobs:
matrix:
python-version:
- "pypy-3.11"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.15"
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: macos-latest
Expand All @@ -110,7 +110,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down Expand Up @@ -150,16 +150,16 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-

- name: Install Build Dependencies (3.14)
if: matrix.python-version == '3.14'
- name: Install Build Dependencies (3.15)
if: matrix.python-version == '3.15'
run: |
pip install -U pip
pip install -U "setuptools == 78.1.1" wheel twine
pip install -U "setuptools >= 78.1.1,< 81" wheel twine
- name: Install Build Dependencies
if: matrix.python-version != '3.14'
if: matrix.python-version != '3.15'
run: |
pip install -U pip
pip install -U "setuptools == 78.1.1" wheel twine
pip install -U "setuptools >= 78.1.1,< 81" wheel twine

- name: Build zope.proxy (macOS x86_64)
if: >
Expand Down Expand Up @@ -197,18 +197,18 @@ jobs:
python setup.py build_ext -i
python setup.py bdist_wheel

- name: Install zope.proxy and dependencies (3.14)
if: matrix.python-version == '3.14'
- name: Install zope.proxy and dependencies (3.15)
if: matrix.python-version == '3.15'
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 zope.proxy and dependencies
if: matrix.python-version != '3.14'
if: matrix.python-version != '3.15'
run: |
# Install to collect dependencies into the (pip) cache.
pip install -U pip "setuptools == 78.1.1"
pip install -U pip "setuptools >= 78.1.1,< 81"
pip install .[test]

- name: Check zope.proxy build
Expand Down Expand Up @@ -240,20 +240,6 @@ jobs:
with:
name: zope.proxy-${{ runner.os }}-${{ matrix.python-version }}.whl
path: dist/*whl
- 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, 'Linux')
&& !startsWith(matrix.python-version, 'pypy')
&& !startsWith(matrix.python-version, '3.14')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
twine upload --skip-existing dist/*

test:
needs: build-package
Expand All @@ -263,12 +249,12 @@ jobs:
matrix:
python-version:
- "pypy-3.11"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.15"
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: macos-latest
Expand All @@ -280,7 +266,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down Expand Up @@ -326,9 +312,9 @@ jobs:
name: zope.proxy-${{ runner.os }}-${{ matrix.python-version }}.whl
path: dist/
- name: Install zope.proxy ${{ matrix.python-version }}
if: matrix.python-version == '3.14'
if: matrix.python-version == '3.15'
run: |
pip install -U wheel "setuptools == 78.1.1"
pip install -U wheel "setuptools >= 78.1.1,< 81"
# 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[toml]
Expand All @@ -341,9 +327,9 @@ jobs:
# Python release may only be available as pre-releases
pip install --pre -e .[test]
- name: Install zope.proxy
if: matrix.python-version != '3.14'
if: matrix.python-version != '3.15'
run: |
pip install -U wheel "setuptools == 78.1.1"
pip install -U wheel "setuptools >= 78.1.1,< 81"
pip install -U coverage[toml]
pip install -U 'cffi; platform_python_implementation == "CPython"'
# Unzip into src/ so that testrunner can find the .so files
Expand Down Expand Up @@ -387,7 +373,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.13"]
os: [ubuntu-latest]

steps:
Expand All @@ -396,7 +382,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down Expand Up @@ -458,7 +444,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.13"]
os: [ubuntu-latest]

steps:
Expand All @@ -467,7 +453,7 @@ jobs:
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down Expand Up @@ -524,21 +510,28 @@ jobs:
tox -e release-check

manylinux:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
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.
# We use a matrix to share as much code as possible.
strategy:
matrix:
python-version: ["3.11"]
image: [manylinux2014_x86_64, manylinux2014_i686, manylinux2014_aarch64]

include:
- os: ubuntu-latest
image: manylinux2014_x86_64
python-version: "3.13"
- os: ubuntu-latest
image: manylinux2014_i686
python-version: "3.13"
- os: ubuntu-24.04-arm
image: manylinux2014_aarch64
python-version: "3.13"
steps:
- name: checkout
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down Expand Up @@ -580,8 +573,9 @@ jobs:

- name: Update pip
run: pip install -U pip
- name: Build zope.proxy (x86_64)
if: matrix.image == 'manylinux2014_x86_64'

- name: Build zope.proxy
if: matrix.image != 'manylinux2014_i686'
# An alternate way to do this is to run the container directly with a uses:
# and then the script runs inside it. That may work better with caching.
# See https://github.com/pyca/bcrypt/blob/f6b5ee2eda76d077c531362ac65e16f045cf1f29/.github/workflows/wheel-builder.yml
Expand All @@ -596,31 +590,59 @@ jobs:
PRE_CMD: linux32
run: |
bash .manylinux.sh
- name: Build zope.proxy (aarch64)
if: matrix.image == 'manylinux2014_aarch64'
env:
DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }}
run: |
# First we must enable emulation
docker run --rm --privileged hypriot/qemu-register
bash .manylinux.sh

- name: Upload zope.proxy wheels
uses: actions/upload-artifact@v4
with:
path: wheelhouse/*whl
name: manylinux_${{ matrix.image }}_wheels.zip

- name: Restore pip cache permissions
run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }}

- name: Prevent publishing wheels for unreleased Python versions
run: VER=$(echo '3.14' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse
- name: Publish package to PyPI
run: VER=$(echo '3.15' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
# Only publish on tag pushes
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# Wait for both build jobs to complete
needs: [build-package, manylinux]
permissions:
contents: read

steps:
- name: Download all wheel artifacts
uses: actions/download-artifact@v4
with:
path: dist/
pattern: '*'
merge-multiple: true

- name: Display structure of downloaded files
run: |
ls -lR dist/
echo "Total wheel files:"
find dist/ -name "*.whl" | wc -l

- name: Remove undesired wheels (if any were downloaded)
run: |
# PyPy wheels shouldn't be uploaded, remove them if present
find dist/ -name "*pypy*" -type f -delete || true
find dist/ -name "*none-any*" -type f -delete || true
# Wheels for the no-yet-supported future Python version need to go
find dist/ -name "*3.15*" -type f -delete || true
find dist/ -name "*cp315*" -type f -delete || true
# For Linux, we only want the manylinux wheels
find dist/ -name "*linux_x86_64*" -type f -delete || true

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: >
github.event_name == 'push'
&& startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.TWINE_PASSWORD }}
skip-existing: true
packages-dir: wheelhouse/
packages-dir: dist/
verbose: true
13 changes: 8 additions & 5 deletions .manylinux-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ yum -y install libffi-devel

tox_env_map() {
case $1 in
*"cp39"*) echo 'py39';;
*"cp310"*) echo 'py310';;
*"cp311"*) echo 'py311';;
*"cp312"*) echo 'py312';;
*"cp313"*) echo 'py313';;
*"cp314"*) echo 'py314';;
*"cp315"*) echo 'py315';;
*) echo 'py';;
esac
}

# Compile wheels
for PYBIN in /opt/python/*/bin; do
if \
[[ "${PYBIN}" == *"cp39/"* ]] || \
[[ "${PYBIN}" == *"cp310/"* ]] || \
[[ "${PYBIN}" == *"cp311/"* ]] || \
[[ "${PYBIN}" == *"cp312/"* ]] || \
[[ "${PYBIN}" == *"cp313/"* ]] || \
[[ "${PYBIN}" == *"cp314/"* ]] ; then
if [[ "${PYBIN}" == *"cp314/"* ]] ; then
[[ "${PYBIN}" == *"cp314/"* ]] || \
[[ "${PYBIN}" == *"cp315/"* ]] ; then
if [[ "${PYBIN}" == *"cp315/"* ]] ; then
"${PYBIN}/pip" install --pre -e /io/
"${PYBIN}/pip" wheel /io/ --pre -w wheelhouse/
else
Expand All @@ -65,7 +65,10 @@ for PYBIN in /opt/python/*/bin; do
fi
done

# Show what wheels we have
echo "Fixing up the following wheels:"
ls -l wheelhouse/zope?proxy*.whl
# Bundle external shared libraries into the wheels
for whl in wheelhouse/zope_proxy*.whl; do
for whl in wheelhouse/zope?proxy*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done
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 = "064de370"
commit-id = "9fcd3d67"

[python]
with-windows = true
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
minimum_pre_commit_version: '3.6'
repos:
- repo: https://github.com/pycqa/isort
rev: "6.0.1"
rev: "7.0.0"
hooks:
- id: isort
- repo: https://github.com/hhatto/autopep8
Expand All @@ -12,10 +12,10 @@ repos:
- id: autopep8
args: [--in-place, --aggressive, --aggressive]
- repo: https://github.com/asottile/pyupgrade
rev: v3.20.0
rev: v3.21.0
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py310-plus]
exclude: ^src/zope/proxy/__init__\.py$
- repo: https://github.com/isidentical/teyit
rev: 0.4.3
Expand Down
Loading