Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest meta/config, declare final Python 3.13 support #70

Merged
merged 1 commit into from
Sep 17, 2024
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
30 changes: 0 additions & 30 deletions .coveragerc

This file was deleted.

42 changes: 5 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,10 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-

- name: Install Build Dependencies (3.13)
if: matrix.python-version == '3.13'
run: |
pip install -U pip
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<69" wheel twine
pip install -U "setuptools <74" wheel twine

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

- name: Install zope.proxy 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 zope.proxy and dependencies
if: matrix.python-version != '3.13'
run: |
# Install to collect dependencies into the (pip) cache.
pip install .[test]
Expand Down Expand Up @@ -250,7 +236,6 @@ jobs:
&& startsWith(github.ref, 'refs/tags')
&& !startsWith(runner.os, 'Linux')
&& !startsWith(matrix.python-version, 'pypy')
&& !startsWith(matrix.python-version, '3.13')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
Expand Down Expand Up @@ -324,31 +309,16 @@ jobs:
with:
name: zope.proxy-${{ runner.os }}-${{ matrix.python-version }}.whl
path: dist/
- name: Install zope.proxy ${{ matrix.python-version }}
if: matrix.python-version == '3.13'
run: |
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
# Unzip into src/ so that testrunner can find the .so files
# when we ask it to load tests from that directory. This
# might also save some build time?
unzip -n dist/zope.proxy-*whl -d src
# Use "--pre" here because dependencies with support for this future
# Python release may only be available as pre-releases
pip install --pre -U -e .[test]
- name: Install zope.proxy
if: matrix.python-version != '3.13'
run: |
pip install -U wheel "setuptools<69"
pip install -U coverage
pip install -U wheel "setuptools <74"
pip install -U coverage[toml]
pip install -U 'cffi; platform_python_implementation == "CPython"'
# Unzip into src/ so that testrunner can find the .so files
# when we ask it to load tests from that directory. This
# might also save some build time?
unzip -n dist/zope.proxy-*whl -d src
pip install -U -e .[test]
pip install -e .[test]
- name: Run tests with C extensions
if: ${{ !startsWith(matrix.python-version, 'pypy') }}
run: |
Expand Down Expand Up @@ -439,7 +409,7 @@ jobs:
- name: Install zope.proxy
run: |
pip install -U wheel
pip install -U coverage
pip install -U coverage[toml]
pip install -U "`ls dist/zope.proxy-*.whl`[docs]"
- name: Build docs
env:
Expand Down Expand Up @@ -535,8 +505,6 @@ jobs:
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.13' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: >
Expand Down
13 changes: 4 additions & 9 deletions .manylinux-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,27 @@ yum -y install libffi-devel

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

# Compile wheels
for PYBIN in /opt/python/*/bin; do
if \
[[ "${PYBIN}" == *"cp313/"* ]] || \
[[ "${PYBIN}" == *"cp311/"* ]] || \
[[ "${PYBIN}" == *"cp312/"* ]] || \
[[ "${PYBIN}" == *"cp313/"* ]] || \
[[ "${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
"${PYBIN}/pip" install -e /io/
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
if [ `uname -m` == 'aarch64' ]; then
cd /io/
${PYBIN}/pip install tox
Expand Down
4 changes: 2 additions & 2 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[meta]
template = "c-code"
commit-id = "4eec7859"
commit-id = "4f5c47bd"

[python]
with-windows = true
with-pypy = true
with-future-python = true
with-future-python = false
with-docs = true
with-sphinx-doctests = true
with-macos = false
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
6.0 (unreleased)
================

- Declare full support for Python 3.13.

- Drop support for Python 3.7.


Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include *.txt
include buildout.cfg
include tox.ini
include .pre-commit-config.yaml
include .coveragerc

recursive-include docs *.py
recursive-include docs *.rst
Expand Down
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code

[build-system]
requires = ["setuptools<74"]
build-backend = "setuptools.build_meta"

[tool.coverage]
[tool.coverage.run]
branch = true
source = ["zope.proxy"]
relative_files = true

[tool.coverage.report]
fail_under = 99
precision = 2
ignore_errors = true
show_missing = true
exclude_lines = ["pragma: no cover", "pragma: nocover", "except ImportError:", "raise NotImplementedError", "if __name__ == '__main__':", "self.fail", "raise AssertionError", "raise unittest.Skip"]

[tool.coverage.html]
directory = "parts/htmlcov"

[tool.coverage.paths]
source = ["src/", ".tox/*/lib/python*/site-packages/", ".tox/pypy*/site-packages/"]
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def read(*rnames):
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Framework :: Zope :: 3',
Expand Down
19 changes: 11 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,46 @@ envlist =
coverage

[testenv]
pip_pre = py313: true
deps =
setuptools < 69
setuptools <74
py37: urllib3 < 2
Sphinx
setenv =
pure: PURE_PYTHON=1
!pure-!pypy3: PURE_PYTHON=0
py312: VIRTUALENV_PIP=23.1.2
py312: PIP_REQUIRE_VIRTUALENV=0
commands =
zope-testrunner --test-path=src {posargs:-vc}
sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest
extras =
test
docs

[testenv:setuptools-latest]
basepython = python3
deps =
git+https://github.com/pypa/setuptools.git\#egg=setuptools
py37: urllib3 < 2

[testenv:coverage]
basepython = python3
allowlist_externals =
mkdir
deps =
coverage
coverage[toml]
py37: urllib3 < 2
setenv =
PURE_PYTHON=1
commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage run -m zope.testrunner --test-path=src {posargs:-vc}
coverage html -i
coverage report -i -m --fail-under=99
coverage html
coverage report

[testenv:release-check]
description = ensure that the distribution is ready to release
basepython = python3
skip_install = true
deps =
setuptools <74
twine
build
check-manifest
Expand Down
Loading