Skip to content

Commit eaafffa

Browse files
committed
Configuring for pure-python
1 parent f80d5b3 commit eaafffa

File tree

7 files changed

+48
-41
lines changed

7 files changed

+48
-41
lines changed

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ env:
1515

1616
jobs:
1717
pre-commit:
18+
permissions:
19+
contents: read
20+
pull-requests: write
1821
name: linting
1922
runs-on: ubuntu-latest
2023
steps:
21-
- uses: actions/checkout@v4
22-
- uses: actions/setup-python@v5
24+
- uses: actions/checkout@v5
25+
- uses: actions/setup-python@v6
2326
with:
2427
python-version: 3.x
25-
- uses: pre-commit/[email protected]
28+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1
2629
with:
2730
extra_args: --all-files --show-diff-on-failure
2831
env:
2932
PRE_COMMIT_COLOR: always
30-
- uses: pre-commit-ci/lite-action@v1.0.2
33+
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 #v1.1.0
3134
if: always()
3235
with:
3336
msg: Apply pre-commit code formatting

.github/workflows/tests.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ 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
@@ -21,47 +24,39 @@ jobs:
2124
config:
2225
# [Python version, tox env]
2326
- ["3.11", "release-check"]
24-
- ["3.8", "py38"]
2527
- ["3.9", "py39"]
2628
- ["3.10", "py310"]
2729
- ["3.11", "py311"]
2830
- ["3.12", "py312"]
2931
- ["3.13", "py313"]
30-
- ["pypy-3.10", "pypy3"]
32+
- ["pypy-3.11", "pypy3"]
3133
- ["3.11", "coverage"]
3234

3335
runs-on: ${{ matrix.os[1] }}
3436
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
3537
name: ${{ matrix.config[1] }}
3638
steps:
37-
- uses: actions/checkout@v4
38-
- name: Set up Python
39-
uses: actions/setup-python@v5
39+
- uses: actions/checkout@v5
4040
with:
41-
python-version: ${{ matrix.config[0] }}
42-
allow-prereleases: true
43-
- name: Pip cache
44-
uses: actions/cache@v4
41+
persist-credentials: false
42+
- name: Install uv + caching
43+
uses: astral-sh/setup-uv@v6
4544
with:
46-
path: ~/.cache/pip
47-
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
48-
restore-keys: |
49-
${{ runner.os }}-pip-${{ matrix.config[0] }}-
50-
${{ runner.os }}-pip-
51-
- name: Install dependencies
52-
run: |
53-
python -m pip install --upgrade pip
54-
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 }}
5551
- name: Test
5652
if: ${{ !startsWith(runner.os, 'Mac') }}
57-
run: tox -e ${{ matrix.config[1] }}
53+
run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}
5854
- name: Test (macOS)
5955
if: ${{ startsWith(runner.os, 'Mac') }}
60-
run: tox -e ${{ matrix.config[1] }}-universal2
56+
run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}-universal2
6157
- name: Coverage
6258
if: matrix.config[1] == 'coverage'
6359
run: |
64-
pip install coveralls
65-
coveralls --service=github
60+
uvx coveralls --service=github
6661
env:
6762
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.meta.toml

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

77
[python]
88
with-pypy = true
@@ -12,9 +12,6 @@ with-macos = false
1212
with-windows = false
1313
with-docs = false
1414

15-
[tox]
16-
use-flake8 = true
17-
1815
[coverage]
1916
fail-under = 95
2017

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
minimum_pre_commit_version: '3.6'
44
repos:
55
- repo: https://github.com/pycqa/isort
6-
rev: "5.13.2"
6+
rev: "6.0.1"
77
hooks:
88
- id: isort
99
- repo: https://github.com/hhatto/autopep8
10-
rev: "v2.3.1"
10+
rev: "v2.3.2"
1111
hooks:
1212
- id: autopep8
1313
args: [--in-place, --aggressive, --aggressive]
1414
- repo: https://github.com/asottile/pyupgrade
15-
rev: v3.17.0
15+
rev: v3.20.0
1616
hooks:
1717
- id: pyupgrade
18-
args: [--py38-plus]
18+
args: [--py39-plus]
1919
- repo: https://github.com/isidentical/teyit
2020
rev: 0.4.3
2121
hooks:
2222
- id: teyit
2323
- repo: https://github.com/PyCQA/flake8
24-
rev: "7.1.1"
24+
rev: "7.3.0"
2525
hooks:
2626
- id: flake8
2727
additional_dependencies:

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

pyproject.toml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
44

55
[build-system]
6-
requires = ["setuptools < 74"]
6+
requires = [
7+
"setuptools == 78.1.1",
8+
"wheel",
9+
]
710
build-backend = "setuptools.build_meta"
811

912
[tool.coverage.run]
@@ -15,7 +18,16 @@ fail_under = 95
1518
precision = 2
1619
ignore_errors = true
1720
show_missing = true
18-
exclude_lines = ["pragma: no cover", "pragma: nocover", "except ImportError:", "raise NotImplementedError", "if __name__ == '__main__':", "self.fail", "raise AssertionError", "raise unittest.Skip"]
21+
exclude_lines = [
22+
"pragma: no cover",
23+
"pragma: nocover",
24+
"except ImportError:",
25+
"raise NotImplementedError",
26+
"if __name__ == '__main__':",
27+
"self.fail",
28+
"raise AssertionError",
29+
"raise unittest.Skip",
30+
]
1931

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

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ minversion = 3.18
55
envlist =
66
release-check
77
lint
8-
py38
98
py39
109
py310
1110
py311
@@ -19,7 +18,7 @@ usedevelop = true
1918
package = wheel
2019
wheel_build_env = .pkg
2120
deps =
22-
setuptools < 74
21+
setuptools == 78.1.1
2322
commands =
2423
zope-testrunner --test-path=src {posargs:-vc}
2524
extras =
@@ -35,7 +34,8 @@ description = ensure that the distribution is ready to release
3534
basepython = python3
3635
skip_install = true
3736
deps =
38-
setuptools < 74
37+
setuptools == 78.1.1
38+
wheel
3939
twine
4040
build
4141
check-manifest

0 commit comments

Comments
 (0)