Skip to content

Commit a0f02bd

Browse files
committed
# Conflicts: # .github/workflows/main.yml # pyproject.toml # ruff.toml
2 parents 3ed4242 + c44e4ad commit a0f02bd

5 files changed

Lines changed: 100 additions & 53 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ jobs:
4141
matrix:
4242
python:
4343
- "3.10"
44-
- "3.13"
44+
- "3.14"
45+
- "3.14t"
4546
platform:
4647
- ubuntu-latest
4748
- macos-latest
@@ -51,32 +52,17 @@ jobs:
5152
platform: ubuntu-latest
5253
- python: "3.12"
5354
platform: ubuntu-latest
54-
- python: "3.14"
55+
- python: "3.13"
5556
platform: ubuntu-latest
5657
- python: "3.15"
5758
platform: ubuntu-latest
58-
- python: pypy3.10
59+
- python: pypy3.11
5960
platform: ubuntu-latest
60-
runs-on: ${{ matrix.platform }}
61-
continue-on-error: ${{ matrix.python == '3.15' }}
62-
steps:
63-
- uses: actions/checkout@v4
64-
- name: Install build dependencies
65-
# Install dependencies for building packages on pre-release Pythons
66-
# jaraco/skeleton#161
67-
if: matrix.python == '3.15' && matrix.platform == 'ubuntu-latest'
68-
run: |
69-
sudo apt update
70-
sudo apt install -y libxml2-dev libxslt-dev
71-
- name: Setup Python
72-
uses: actions/setup-python@v5
73-
with:
74-
python-version: ${{ matrix.python }}
75-
allow-prereleases: true
76-
- name: Install tox
77-
run: python -m pip install tox
78-
- name: Run
79-
run: tox
61+
uses: ./.github/workflows/test-suite.yml
62+
with:
63+
python: ${{ matrix.python }}
64+
platform: ${{ matrix.platform }}
65+
secrets: inherit
8066

8167
collateral:
8268
strategy:
@@ -85,20 +71,11 @@ jobs:
8571
job:
8672
- diffcov
8773
- docs
88-
runs-on: ubuntu-latest
89-
continue-on-error: ${{ matrix.python == '3.12' }}
90-
steps:
91-
- uses: actions/checkout@v4
92-
with:
93-
fetch-depth: 0
94-
- name: Setup Python
95-
uses: actions/setup-python@v5
96-
with:
97-
python-version: 3.x
98-
- name: Install tox
99-
run: python -m pip install tox
100-
- name: Eval ${{ matrix.job }}
101-
run: tox -e ${{ matrix.job }}
74+
uses: ./.github/workflows/test-suite.yml
75+
with:
76+
platform: ubuntu-latest
77+
tox-env: ${{ matrix.job }}
78+
secrets: inherit
10279

10380
test_cygwin:
10481
strategy:

‎.github/workflows/test-suite.yml‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Test Suite
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python:
7+
description: Python version
8+
type: string
9+
default: "3.x"
10+
platform:
11+
description: Runner platform
12+
type: string
13+
default: ubuntu-latest
14+
tox-env:
15+
description: >-
16+
Tox environment to run; if empty, runs default tox
17+
type: string
18+
default: ""
19+
20+
env:
21+
# Environment variable to support color support (jaraco/skeleton#66)
22+
FORCE_COLOR: 1
23+
24+
# Suppress noisy pip warnings
25+
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
26+
PIP_NO_WARN_SCRIPT_LOCATION: 'true'
27+
28+
# Ensure tests can sense settings about the environment
29+
TOX_OVERRIDE: >-
30+
testenv.pass_env+=GITHUB_*,FORCE_COLOR
31+
32+
jobs:
33+
run:
34+
runs-on: ${{ inputs.platform }}
35+
# Tolerate failures on pre-release Pythons (jaraco/skeleton#199)
36+
continue-on-error: ${{ inputs.python == '3.15' }}
37+
permissions:
38+
contents: read
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
- name: Install build dependencies
44+
# Install dependencies for building packages on pre-release Pythons
45+
# (jaraco/skeleton#161) and PyPy, which often lags on wheels
46+
# (jaraco/skeleton#222).
47+
if: >-
48+
(inputs.python == '3.15' || startsWith(inputs.python, 'pypy'))
49+
&& inputs.platform == 'ubuntu-latest'
50+
run: |
51+
sudo apt update
52+
sudo apt install -y libxml2-dev libxslt-dev
53+
- name: Setup Python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: ${{ inputs.python }}
57+
allow-prereleases: true
58+
- name: Install tox
59+
run: python -m pip install tox
60+
- name: Run
61+
if: ${{ !inputs.tox-env }}
62+
run: tox
63+
- name: Run ${{ inputs.tox-env }}
64+
if: ${{ inputs.tox-env }}
65+
run: tox -e ${{ inputs.tox-env }}

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**Required first step:** Before reading further or making any changes, fetch and read the [skeleton](https://blog.jaraco.com/skeleton/) document in its entirety. It is the authoritative source of truth for this project's structure, conventions, testing, and release process, and is not duplicated here. Do not act until you have ingested it.

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ enabler = [
8181
type = [
8282
# upstream
8383

84-
# Exclude PyPy from type checks (python/mypy#20454 jaraco/skeleton#187)
84+
# Exclude PyPy from type checks (python/mypy#20454 jaraco/skeleton#187)
8585
"pytest-mypy >= 1.0.1; platform_python_implementation != 'PyPy' and sys_platform != 'cygwin'",
8686

8787
# local

‎ruff.toml‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@ extend-select = [
55
"C901", # complex-structure
66
"I", # isort
77
"PERF401", # manual-list-comprehension
8+
"UP", # pyupgrade (Code modernization for strings, annotations, conditions, ...)
89

910
# Ensure modern type annotation syntax and best practices
1011
# Not including those covered by type-checkers or exclusive to Python 3.11+
1112
"FA", # flake8-future-annotations
1213
"F404", # late-future-import
1314
"PYI", # flake8-pyi
14-
"UP006", # non-pep585-annotation
15-
"UP007", # non-pep604-annotation
16-
"UP010", # unnecessary-future-import
17-
"UP035", # deprecated-import
18-
"UP037", # quoted-annotation
19-
"UP043", # unnecessary-default-type-args
2015

2116
# local
2217
"B",
@@ -26,29 +21,37 @@ extend-select = [
2621
"RUF010",
2722
"RUF100",
2823
"TRY",
29-
"UP",
3024
"YTT",
3125
]
3226
ignore = [
3327
# upstream
28+
"UP015", # redundant-open-modes, explicit is preferred
3429

3530
# Typeshed rejects complex or non-literal defaults for maintenance and testing reasons,
3631
# irrelevant to this project.
3732
"PYI011", # typed-argument-default-in-stub
3833
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
3934
"W191",
40-
"E111",
41-
"E114",
42-
"E117",
4335
"D206",
4436
"D300",
45-
"Q000",
46-
"Q001",
47-
"Q002",
48-
"Q003",
4937
"COM812",
5038
"COM819",
5139

40+
# N999 (invalid-module-name) yields false positives when a project's
41+
# source directory is the distribution name and is redirected to a
42+
# different import package (e.g. namespace layouts); the dotted directory
43+
# name is itself a valid module. See
44+
# https://github.com/astral-sh/ruff/issues/27801.
45+
"N999",
46+
47+
# B008 is over-reaching; see jaraco/skeleton#214
48+
"B008", # function-call-in-default-argument
49+
50+
# PLC0414 flags `import X as X`, the idiom type checkers recognize as an
51+
# explicit re-export, and its fix (with F401) silently drops public names.
52+
# See jaraco/skeleton#210.
53+
"PLC0414", # useless-import-alias
54+
5255
# local
5356
"B028",
5457
"B904",
@@ -58,7 +61,8 @@ ignore = [
5861
]
5962

6063
[lint.flake8-comprehensions]
61-
# Retain the elegant dict(a=1) keyword-call style; C408 still flags dict()/dict([...])
64+
# Retain the elegant dict(a=1) keyword-call style; C408 still flags dict()
65+
# and dict([...]). See jaraco/skeleton#210.
6266
allow-dict-calls-with-keyword-arguments = true
6367

6468
[format]

0 commit comments

Comments
 (0)