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
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@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
116 changes: 69 additions & 47 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 Down Expand Up @@ -150,13 +150,13 @@ 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,< 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,< 81" wheel twine
Expand Down Expand Up @@ -197,15 +197,15 @@ jobs:
python setup.py build_ext -i
python setup.py bdist_wheel

- name: Install persistent and dependencies (3.14)
if: matrix.python-version == '3.14'
- name: Install persistent 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 persistent 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,< 81"
Expand Down Expand Up @@ -240,20 +240,6 @@ jobs:
with:
name: persistent-${{ 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 Down Expand Up @@ -326,7 +312,7 @@ jobs:
name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl
path: dist/
- name: Install persistent ${{ matrix.python-version }}
if: matrix.python-version == '3.14'
if: matrix.python-version == '3.15'
run: |
pip install -U wheel "setuptools >= 78.1.1,< 81"
# coverage might have a wheel on PyPI for a future python version which is
Expand All @@ -341,7 +327,7 @@ jobs:
# Python release may only be available as pre-releases
pip install --pre -e .[test]
- name: Install persistent
if: matrix.python-version != '3.14'
if: matrix.python-version != '3.15'
run: |
pip install -U wheel "setuptools >= 78.1.1,< 81"
pip install -U coverage[toml]
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 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 Down Expand Up @@ -524,14 +510,21 @@ 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
Expand Down Expand Up @@ -580,8 +573,9 @@ jobs:

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

- name: Build persistent
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 persistent (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 persistent 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
11 changes: 7 additions & 4 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,6 +65,9 @@ for PYBIN in /opt/python/*/bin; do
fi
done

# Show what wheels we have
echo "Fixing up the following wheels:"
ls -l wheelhouse/persistent*.whl
# Bundle external shared libraries into the wheels
for whl in wheelhouse/persistent*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
Expand Down
15 changes: 6 additions & 9 deletions .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 = "bfe21cd9"
commit-id = "9fcd3d67"

[python]
with-windows = true
Expand All @@ -13,31 +13,28 @@ with-sphinx-doctests = true
with-macos = false

[tox]
use-flake8 = true
coverage-command = [
"coverage run -m zope.testrunner --test-path=src {posargs:-vc}",
"python -c 'import os, subprocess; subprocess.check_call(\"coverage run -a -m zope.testrunner --test-path=src\", env=dict(os.environ, PURE_PYTHON=\"0\"), shell=True)'",
]
]

[coverage]
fail-under = 94.9

[coverage-run]
source = "persistent"
additional-config = [
"omit =",
" _ring_build.py",
]
additional-config = ["omit =", " _ring_build.py"]

[manifest]
additional-rules = [
"include *.yaml",
"include *.sh",
"recursive-include docs *.bat",
"recursive-include src *.h",
]
]

[check-manifest]
additional-ignores = [
"docs/_build/html/_sources/api/*",
]
"docs/_build/html/_static/scripts/*",
]
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]
- repo: https://github.com/isidentical/teyit
rev: 0.4.3
hooks:
Expand Down
Loading