Skip to content

Commit 27e6a7b

Browse files
Merge branch 'main' into pep639
2 parents 0ca8fe9 + 6522881 commit 27e6a7b

File tree

11 files changed

+403
-187
lines changed

11 files changed

+403
-187
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: test
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build-and-inspect:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
id-token: write
10+
attestations: write
11+
contents: read
12+
outputs:
13+
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Build and inspect package
21+
id: baipp
22+
uses: hynek/build-and-inspect-python-package@v2
23+
with:
24+
attest-build-provenance-github: true
25+
env:
26+
SETUPTOOLS_SCM_OVERRIDES_FOR_INICONFIG: ${{ github.ref == 'refs/heads/main' && 'local_scheme="no-local-version"' || '' }}
27+
28+
test:
29+
needs: build-and-inspect
30+
runs-on: ${{ matrix.os }}
31+
defaults:
32+
run:
33+
shell: bash
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
python: ${{ fromJSON(needs.build-and-inspect.outputs.python-versions) }}
39+
os: [ubuntu-latest, windows-latest]
40+
41+
steps:
42+
- name: Checkout test files
43+
uses: actions/checkout@v4
44+
with:
45+
sparse-checkout: |
46+
testing
47+
uv.lock
48+
sparse-checkout-cone-mode: false
49+
50+
- name: Download built packages
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: Packages
54+
path: dist
55+
56+
- name: Verify artifacts exist
57+
run: |
58+
ls -la dist/
59+
test -f dist/*.whl || (echo "No wheel found!" && exit 1)
60+
test -f dist/*.tar.gz || (echo "No sdist found!" && exit 1)
61+
62+
- name: Install uv
63+
uses: astral-sh/setup-uv@v7
64+
with:
65+
enable-cache: true
66+
67+
- name: Set up Python ${{ matrix.python }}
68+
run: uv python install ${{ matrix.python }}
69+
70+
- name: Run tests with built wheel
71+
run: uv run --with dist/*.whl --with pytest pytest testing --color=yes
72+
73+
create-release:
74+
name: Create GitHub Release
75+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
76+
needs: [test, build-and-inspect]
77+
runs-on: ubuntu-latest
78+
permissions:
79+
contents: write
80+
81+
steps:
82+
- name: Download built packages
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: Packages
86+
path: dist
87+
88+
- name: Extract version from tag
89+
id: version
90+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
91+
92+
- name: Create GitHub Release
93+
uses: softprops/action-gh-release@v2
94+
with:
95+
files: dist/*
96+
fail_on_unmatched_files: true
97+
generate_release_notes: true
98+
name: Version ${{ steps.version.outputs.VERSION }}
99+
100+
publish-to-pypi:
101+
name: Publish to PyPI
102+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
103+
needs: [test, build-and-inspect, create-release]
104+
runs-on: ubuntu-latest
105+
environment: pypi-upload
106+
permissions:
107+
id-token: write
108+
109+
steps:
110+
- name: Download built packages
111+
uses: actions/download-artifact@v4
112+
with:
113+
name: Packages
114+
path: dist
115+
116+
- name: Publish package to PyPI
117+
uses: pypa/gh-action-pypi-publish@release/v1
118+
119+
publish-to-test-pypi:
120+
name: Publish to TestPyPI
121+
if: |
122+
github.repository == 'pytest-dev/iniconfig' &&
123+
(github.event_name == 'push' && (
124+
github.ref == 'refs/heads/main' ||
125+
contains(github.ref, 'deploy')
126+
))
127+
needs: [test, build-and-inspect]
128+
runs-on: ubuntu-latest
129+
environment: test-pypi-upload
130+
permissions:
131+
id-token: write
132+
attestations: write
133+
134+
steps:
135+
- name: Download built packages
136+
uses: actions/download-artifact@v4
137+
with:
138+
name: Packages
139+
path: dist
140+
141+
- name: Publish package to TestPyPI
142+
uses: pypa/gh-action-pypi-publish@release/v1
143+
with:
144+
repository-url: https://test.pypi.org/legacy/

.pre-commit-config.yaml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
repos:
2-
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.20.0
4-
hooks:
5-
- id: pyupgrade
6-
args: [--py38-plus]
72
- repo: https://github.com/tox-dev/pyproject-fmt
8-
rev: "v2.6.0"
3+
rev: "v2.11.0"
94
hooks:
105
- id: pyproject-fmt
116

12-
- repo: https://github.com/psf/black
13-
rev: 25.1.0
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.14.1
149
hooks:
15-
- id: black
16-
language_version: python3
17-
- repo: https://github.com/pre-commit/mirrors-mypy
18-
rev: 'v1.17.0'
19-
hooks:
20-
- id: mypy
21-
args: []
22-
additional_dependencies:
23-
- "pytest==7.2.0"
24-
- "tomli"
10+
- id: ruff-check
11+
args: [--fix]
12+
- id: ruff-format
13+
14+
- repo: https://github.com/pre-commit/mirrors-mypy
15+
rev: 'v1.18.2'
16+
hooks:
17+
- id: mypy
18+
args: []
19+
additional_dependencies:
20+
- "pytest==7.2.0"
21+
- "tomli"

CHANGELOG

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2.2.0
2+
=====
3+
4+
* drop Python 3.8 and 3.9 support (now requires Python >= 3.10)
5+
* add Python 3.14 classifier
6+
* migrate from hatchling to setuptools 77 with setuptools_scm
7+
* adopt PEP 639 license specifiers and PEP 740 build attestations
8+
* migrate from black + pyupgrade to ruff
9+
* migrate CI to uv and unified test workflow
10+
* automate GitHub releases and PyPI publishing via Trusted Publishing
11+
* include tests in sdist
12+
* modernize code for Python 3.10+ (remove __future__ annotations, TYPE_CHECKING guards)
13+
* rename _ParsedLine to ParsedLine
14+
115
2.1.0
216
=====
317

pyproject.toml

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
[build-system]
2-
build-backend = "hatchling.build"
2+
build-backend = "setuptools.build_meta"
33
requires = [
4-
"hatch-vcs",
5-
"hatchling>=1.27.0",
4+
"setuptools>=77",
5+
"setuptools-scm>=8",
66
]
77

88
[project]
99
name = "iniconfig"
1010
description = "brain-dead simple config-ini parsing"
1111
readme = "README.rst"
1212
license = "MIT"
13-
license-files = ["LICENSE"]
13+
license-files = [ "LICENSE" ]
1414
authors = [
1515
{ name = "Ronny Pfannschmidt", email = "[email protected]" },
1616
{ name = "Holger Krekel", email = "[email protected]" },
1717
]
18-
requires-python = ">=3.8"
18+
requires-python = ">=3.10"
1919
classifiers = [
2020
"Development Status :: 4 - Beta",
2121
"Intended Audience :: Developers",
2222
"Operating System :: MacOS :: MacOS X",
2323
"Operating System :: Microsoft :: Windows",
2424
"Operating System :: POSIX",
2525
"Programming Language :: Python :: 3 :: Only",
26-
"Programming Language :: Python :: 3.8",
27-
"Programming Language :: Python :: 3.9",
2826
"Programming Language :: Python :: 3.10",
2927
"Programming Language :: Python :: 3.11",
3028
"Programming Language :: Python :: 3.12",
3129
"Programming Language :: Python :: 3.13",
30+
"Programming Language :: Python :: 3.14",
3231
"Topic :: Software Development :: Libraries",
3332
"Topic :: Utilities",
3433
]
@@ -37,29 +36,32 @@ dynamic = [
3736
]
3837
urls.Homepage = "https://github.com/pytest-dev/iniconfig"
3938

40-
[tool.setuptools_scm]
39+
[dependency-groups]
40+
dev = [
41+
"pytest>=8.4.2",
42+
"pytest-xdist>=3.8",
43+
]
4144

42-
[tool.hatch.version]
43-
source = "vcs"
45+
[tool.setuptools]
46+
packages = [ "iniconfig" ]
47+
package-dir = { "" = "src" }
4448

45-
[tool.hatch.build.hooks.vcs]
46-
version-file = "src/iniconfig/_version.py"
49+
[tool.setuptools.package-data]
50+
iniconfig = [ "py.typed" ]
4751

48-
[tool.hatch.build.targets.sdist]
49-
include = [
50-
"/src",
51-
"/testing",
52-
]
52+
[tool.setuptools_scm]
53+
write_to = "src/iniconfig/_version.py"
5354

54-
[tool.hatch.envs.test]
55-
dependencies = [
56-
"pytest",
57-
]
58-
[tool.hatch.envs.test.scripts]
59-
default = "pytest {args}"
55+
[tool.ruff]
6056

61-
[[tool.hatch.envs.test.matrix]]
62-
python = [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
57+
lint.extend-select = [
58+
"B", # flake8-bugbear
59+
"I", # isort
60+
"PT", # flake8-pytest-style
61+
"UP", # pyupgrade
62+
]
63+
lint.isort.force-single-line = true
64+
lint.isort.known-first-party = [ "iniconfig" ]
6365

6466
[tool.pytest.ini_options]
6567
testpaths = "testing"

0 commit comments

Comments
 (0)