Skip to content

Commit

Permalink
- apply latest meta templates, drop support for Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Mar 4, 2025
1 parent 781ea47 commit aef6e1a
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 28 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ env:

jobs:
pre-commit:
permissions:
contents: read
pull-requests: write
name: linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected]
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1
with:
extra_args: --all-files --show-diff-on-failure
env:
PRE_COMMIT_COLOR: always
- uses: pre-commit-ci/lite-action@v1.0.2
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 #v1.1.0
if: always()
with:
msg: Apply pre-commit code formatting
88 changes: 81 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# native support. It works, but is slow.
#
# Another major downside: You can't just re-run the job for one part
# of the matrix. So if there's a transient test failure that hit, say, 3.8,
# of the matrix. So if there's a transient test failure that hit, say, 3.11,
# to get a clean run every version of Python runs again. That's bad.
# https://github.community/t/ability-to-rerun-just-a-single-job-in-a-workflow/17234/65

Expand Down Expand Up @@ -97,7 +97,6 @@ jobs:
matrix:
python-version:
- "pypy-3.10"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand All @@ -112,6 +111,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -157,12 +158,12 @@ jobs:
if: matrix.python-version == '3.14'
run: |
pip install -U pip
pip install -U "setuptools < 74" wheel twine
pip install -U "setuptools <= 75.6.0" wheel twine
- name: Install Build Dependencies
if: matrix.python-version != '3.14'
run: |
pip install -U pip
pip install -U "setuptools < 74" wheel twine
pip install -U "setuptools <= 75.6.0" wheel twine
- name: Build ExtensionClass (macOS x86_64)
if: >
Expand Down Expand Up @@ -265,7 +266,6 @@ jobs:
matrix:
python-version:
- "pypy-3.10"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand All @@ -280,6 +280,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -329,7 +331,7 @@ jobs:
- name: Install ExtensionClass ${{ matrix.python-version }}
if: matrix.python-version == '3.14'
run: |
pip install -U wheel "setuptools < 74"
pip install -U wheel "setuptools <= 75.6.0"
# 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 @@ -343,7 +345,7 @@ jobs:
- name: Install ExtensionClass
if: matrix.python-version != '3.14'
run: |
pip install -U wheel "setuptools < 74"
pip install -U wheel "setuptools <= 75.6.0"
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 @@ -381,6 +383,76 @@ jobs:
with:
parallel-finished: true

release-check:
needs: build-package
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]

steps:
- name: checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
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
# to save the cache. So it must come before the thing we want to use
# the cache.
###
- name: Get pip cache dir (default)
id: pip-cache-default
if: ${{ !startsWith(runner.os, 'Windows') }}
run: |
echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT
- name: Get pip cache dir (Windows)
id: pip-cache-windows
if: ${{ startsWith(runner.os, 'Windows') }}
run: |
echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT
- name: pip cache (default)
uses: actions/cache@v4
if: ${{ !startsWith(runner.os, 'Windows') }}
with:
path: ${{ steps.pip-cache-default.outputs.dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-
- name: pip cache (Windows)
uses: actions/cache@v4
if: ${{ startsWith(runner.os, 'Windows') }}
with:
path: ${{ steps.pip-cache-windows.outputs.dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-
- name: Download ExtensionClass wheel
uses: actions/download-artifact@v4
with:
name: ExtensionClass-${{ runner.os }}-${{ matrix.python-version }}.whl
path: dist/
- name: Install ExtensionClass
run: |
pip install -U wheel
pip install -U tox
pip install -U "`ls dist/ExtensionClass-*.whl`[docs]"
- name: Run release check
env:
ZOPE_INTERFACE_STRICT_IRO: 1
run: |
tox -e release-check
manylinux:
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
Expand All @@ -393,6 +465,8 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down
2 changes: 0 additions & 2 deletions .manylinux-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ yum -y install libffi-devel

tox_env_map() {
case $1 in
*"cp38"*) echo 'py38';;
*"cp39"*) echo 'py39';;
*"cp310"*) echo 'py310';;
*"cp311"*) echo 'py311';;
Expand All @@ -42,7 +41,6 @@ tox_env_map() {
# Compile wheels
for PYBIN in /opt/python/*/bin; do
if \
[[ "${PYBIN}" == *"cp38/"* ]] || \
[[ "${PYBIN}" == *"cp39/"* ]] || \
[[ "${PYBIN}" == *"cp310/"* ]] || \
[[ "${PYBIN}" == *"cp311/"* ]] || \
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 = "baf6089f"
commit-id = "3c1c588c"

[python]
with-windows = true
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
minimum_pre_commit_version: '3.6'
repos:
- repo: https://github.com/pycqa/isort
rev: "5.13.2"
rev: "6.0.0"
hooks:
- id: isort
- repo: https://github.com/hhatto/autopep8
rev: "v2.3.1"
rev: "v2.3.2"
hooks:
- id: autopep8
args: [--in-place, --aggressive, --aggressive]
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]
- repo: https://github.com/isidentical/teyit
rev: 0.4.3
hooks:
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
6.1 (unreleased)
================

- Drop support for Python 3.8.

- Add preliminary support for Python 3.14a2.


6.0 (2024-09-17)
================

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
Generated from:
https://github.com/zopefoundation/meta/tree/master/config/c-code
-->
-->
# Contributing to zopefoundation projects

The projects under the zopefoundation GitHub organization are open source and
Expand Down
21 changes: 18 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# https://github.com/zopefoundation/meta/tree/master/config/c-code

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

[tool.coverage.run]
Expand All @@ -16,10 +18,23 @@ fail_under = 99.5
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"]
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/"]
source = [
"src/",
".tox/*/lib/python*/site-packages/",
".tox/pypy*/site-packages/",
]
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,21 @@
name='ExtensionClass',
version=version,
url='https://github.com/zopefoundation/ExtensionClass',
license='ZPL 2.1',
license='ZPL-2.1',
description='Metaclass for subclassable extension types',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
author_email='zope-dev@zope.dev',
long_description='\n\n'.join([README, CHANGES]),
packages=find_packages('src'),
package_dir={'': 'src'},
classifiers=[
"Development Status :: 6 - Mature",
"Environment :: Web Environment",
"Framework :: Zope2",
"Framework :: Zope :: 2",
"License :: OSI Approved :: Zope Public License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -87,5 +86,5 @@
'zope.testrunner',
],
},
python_requires='>=3.8',
python_requires='>=3.9',
)
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[tox]
minversion = 4.0
envlist =
release-check
lint
py38,py38-pure
py39,py39-pure
py310,py310-pure
py311,py311-pure
Expand All @@ -17,7 +17,7 @@ envlist =
[testenv]
pip_pre = py314: true
deps =
setuptools < 74
setuptools <= 75.6.0
setenv =
pure: PURE_PYTHON=1
!pure-!pypy3: PURE_PYTHON=0
Expand Down Expand Up @@ -50,7 +50,7 @@ description = ensure that the distribution is ready to release
basepython = python3
skip_install = true
deps =
setuptools < 74
setuptools <= 75.6.0
twine
build
check-manifest
Expand Down

0 comments on commit aef6e1a

Please sign in to comment.