Skip to content

Commit 0de33fd

Browse files
authored
Update Python version support. (#9)
* Drop support for Python 3.7, 3.8. * Add support for Python 3.12, 3.13.
1 parent f27c357 commit 0de33fd

File tree

12 files changed

+168
-76
lines changed

12 files changed

+168
-76
lines changed

.github/workflows/pre-commit.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Generated from:
2+
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
3+
name: pre-commit
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- master
10+
# Allow to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
env:
14+
FORCE_COLOR: 1
15+
16+
jobs:
17+
pre-commit:
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
name: linting
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.x
28+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1
29+
with:
30+
extra_args: --all-files --show-diff-on-failure
31+
env:
32+
PRE_COMMIT_COLOR: always
33+
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 #v1.1.0
34+
if: always()
35+
with:
36+
msg: Apply pre-commit code formatting

.github/workflows/tests.yml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,51 @@ on:
1212

1313
jobs:
1414
build:
15+
permissions:
16+
contents: read
17+
pull-requests: write
1518
strategy:
1619
# We want to see all failures:
1720
fail-fast: false
1821
matrix:
1922
os:
20-
- ["ubuntu", "ubuntu-20.04"]
23+
- ["ubuntu", "ubuntu-latest"]
2124
config:
2225
# [Python version, tox env]
23-
- ["3.9", "lint"]
24-
- ["3.7", "py37"]
25-
- ["3.8", "py38"]
26-
- ["3.9", "py39"]
27-
- ["3.10", "py310"]
28-
- ["3.11", "py311"]
29-
- ["pypy-3.9", "pypy3"]
30-
- ["3.9", "coverage"]
26+
- ["3.11", "release-check"]
27+
- ["3.9", "py39"]
28+
- ["3.10", "py310"]
29+
- ["3.11", "py311"]
30+
- ["3.12", "py312"]
31+
- ["3.13", "py313"]
32+
- ["pypy-3.10", "pypy3"]
33+
- ["3.11", "coverage"]
3134

3235
runs-on: ${{ matrix.os[1] }}
3336
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
3437
name: ${{ matrix.config[1] }}
3538
steps:
36-
- uses: actions/checkout@v3
37-
- name: Set up Python
38-
uses: actions/setup-python@v4
39+
- uses: actions/checkout@v4
3940
with:
40-
python-version: ${{ matrix.config[0] }}
41-
- name: Pip cache
42-
uses: actions/cache@v3
41+
persist-credentials: false
42+
- name: Install uv + caching
43+
uses: astral-sh/setup-uv@v5
4344
with:
44-
path: ~/.cache/pip
45-
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
46-
restore-keys: |
47-
${{ runner.os }}-pip-${{ matrix.config[0] }}-
48-
${{ runner.os }}-pip-
49-
- name: Install dependencies
50-
run: |
51-
python -m pip install --upgrade pip
52-
pip install tox
45+
enable-cache: true
46+
cache-dependency-glob: |
47+
setup.*
48+
tox.ini
49+
python-version: ${{ matrix.matrix.config[0] }}
50+
github-token: ${{ secrets.GITHUB_TOKEN }}
5351
- name: Test
54-
run: tox -e ${{ matrix.config[1] }}
52+
if: ${{ !startsWith(runner.os, 'Mac') }}
53+
run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}
54+
- name: Test (macOS)
55+
if: ${{ startsWith(runner.os, 'Mac') }}
56+
run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}-universal2
5557
- name: Coverage
5658
if: matrix.config[1] == 'coverage'
5759
run: |
58-
pip install coveralls
59-
coveralls --service=github
60+
uvx coveralls --service=github
6061
env:
6162
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.meta.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
33
[meta]
44
template = "pure-python"
5-
commit-id = "fd874ae4"
5+
commit-id = "c6354ebd"
66

77
[python]
88
with-pypy = true
99
with-sphinx-doctests = false
1010
with-macos = false
1111
with-windows = false
1212
with-future-python = false
13-
14-
[tox]
15-
use-flake8 = true
13+
with-docs = false
1614

1715
[coverage]
1816
fail-under = 95

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated from:
2+
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
3+
minimum_pre_commit_version: '3.6'
4+
repos:
5+
- repo: https://github.com/pycqa/isort
6+
rev: "6.0.1"
7+
hooks:
8+
- id: isort
9+
- repo: https://github.com/hhatto/autopep8
10+
rev: "v2.3.2"
11+
hooks:
12+
- id: autopep8
13+
args: [--in-place, --aggressive, --aggressive]
14+
- repo: https://github.com/asottile/pyupgrade
15+
rev: v3.19.1
16+
hooks:
17+
- id: pyupgrade
18+
args: [--py39-plus]
19+
- repo: https://github.com/isidentical/teyit
20+
rev: 0.4.3
21+
hooks:
22+
- id: teyit
23+
- repo: https://github.com/PyCQA/flake8
24+
rev: "7.2.0"
25+
hooks:
26+
- id: flake8
27+
additional_dependencies:
28+
- flake8-debugger == 4.1.2

CHANGES.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ Changes
44
4.1 (unreleased)
55
----------------
66

7-
- Nothing changed yet.
7+
- Add support for Python 3.12, 3.13.
8+
9+
- Drop support for Python 3.7, 3.8.
810

911

1012
4.0 (2023-07-11)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
Generated from:
33
https://github.com/zopefoundation/meta/tree/master/config/pure-python
4-
-->
4+
-->
55
# Contributing to zopefoundation projects
66

77
The projects under the zopefoundation GitHub organization are open source and

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ include *.rst
55
include *.txt
66
include buildout.cfg
77
include tox.ini
8+
include .pre-commit-config.yaml
89

910
recursive-include src *.py
1011
recursive-include src *.zcml

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Generated from:
2+
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
3+
4+
[build-system]
5+
requires = [
6+
"setuptools == 75.8.2",
7+
"wheel",
8+
]
9+
build-backend = "setuptools.build_meta"
10+
11+
[tool.coverage.run]
12+
branch = true
13+
source = ["grokcore.security"]
14+
15+
[tool.coverage.report]
16+
fail_under = 95
17+
precision = 2
18+
ignore_errors = true
19+
show_missing = true
20+
exclude_lines = [
21+
"pragma: no cover",
22+
"pragma: nocover",
23+
"except ImportError:",
24+
"raise NotImplementedError",
25+
"if __name__ == '__main__':",
26+
"self.fail",
27+
"raise AssertionError",
28+
"raise unittest.Skip",
29+
]
30+
31+
[tool.coverage.html]
32+
directory = "parts/htmlcov"

setup.cfg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Generated from:
22
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
3-
[bdist_wheel]
4-
universal = 0
53

64
[flake8]
75
doctests = 1

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ def read(*rnames):
3737
'License :: OSI Approved :: Zope Public License',
3838
'Operating System :: OS Independent',
3939
'Programming Language :: Python :: 3',
40-
'Programming Language :: Python :: 3.7',
41-
'Programming Language :: Python :: 3.8',
4240
'Programming Language :: Python :: 3.9',
4341
'Programming Language :: Python :: 3.10',
4442
'Programming Language :: Python :: 3.11',
43+
'Programming Language :: Python :: 3.12',
44+
'Programming Language :: Python :: 3.13',
4545
'Programming Language :: Python :: Implementation :: CPython',
4646
'Programming Language :: Python :: Implementation :: PyPy',
47-
],
47+
],
4848
packages=find_packages('src'),
4949
package_dir={'': 'src'},
5050
namespace_packages=['grokcore'],
5151
include_package_data=True,
5252
zip_safe=False,
53-
python_requires='>=3.7',
53+
python_requires='>=3.9',
5454
install_requires=[
5555
'Chameleon >= 2',
5656
'grokcore.component >= 2.1',

0 commit comments

Comments
 (0)