Skip to content

Commit 3193010

Browse files
authored
Drop 3.8 support and set 3.13 latest stable (#267)
1 parent 4f909ee commit 3193010

File tree

8 files changed

+27
-25
lines changed

8 files changed

+27
-25
lines changed

.github/workflows/check.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
- "3.11"
2525
- "3.10"
2626
- "3.9"
27-
- "3.8"
2827
- type
2928
- dev
3029
- pkg_meta

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
rev: v2.3.0
1414
hooks:
1515
- id: codespell
16-
additional_dependencies: ["tomli>=2.0.1"]
16+
additional_dependencies: ["tomli>=2.0.2"]
1717
- repo: https://github.com/tox-dev/tox-ini-fmt
1818
rev: "1.4.1"
1919
hooks:

pyproject.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ license.file = "LICENSE.txt"
1717
authors = [
1818
{ name = "Bernat Gabor", email = "[email protected]" },
1919
]
20-
requires-python = ">=3.8"
20+
requires-python = ">=3.9"
2121
classifiers = [
2222
"License :: OSI Approved :: MIT License",
2323
"Operating System :: OS Independent",
2424
"Programming Language :: Python",
2525
"Programming Language :: Python :: 3 :: Only",
26-
"Programming Language :: Python :: 3.8",
2726
"Programming Language :: Python :: 3.9",
2827
"Programming Language :: Python :: 3.10",
2928
"Programming Language :: Python :: 3.11",
@@ -34,19 +33,19 @@ dynamic = [
3433
"version",
3534
]
3635
dependencies = [
37-
"pyproject-fmt-rust==1.1.6",
38-
"tomli>=2.0.1; python_version<'3.11'",
36+
"pyproject-fmt-rust==1.2",
37+
"tomli>=2.0.2; python_version<'3.11'",
3938
]
4039
optional-dependencies.docs = [
4140
"furo>=2024.8.6",
4241
"sphinx>=8.0.2",
43-
"sphinx-argparse-cli>=1.17",
44-
"sphinx-autodoc-typehints>=2.4",
42+
"sphinx-argparse-cli>=1.18.2",
43+
"sphinx-autodoc-typehints>=2.4.4",
4544
"sphinx-copybutton>=0.5.2",
4645
]
4746
optional-dependencies.test = [
4847
"covdefaults>=2.3",
49-
"pytest>=8.3.2",
48+
"pytest>=8.3.3",
5049
"pytest-cov>=5",
5150
"pytest-mock>=3.14",
5251
]
@@ -69,7 +68,7 @@ build.targets.sdist.include = [
6968
version.source = "vcs"
7069

7170
[tool.ruff]
72-
target-version = "py38"
71+
target-version = "py39"
7372
line-length = 120
7473
format.preview = true
7574
format.docstring-code-line-length = 100

src/pyproject_fmt/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
import difflib
66
import sys
77
from pathlib import Path
8-
from typing import TYPE_CHECKING, Iterable, Sequence
8+
from typing import TYPE_CHECKING
99

1010
from pyproject_fmt_rust import format_toml
1111

1212
from pyproject_fmt.cli import cli_args
1313

1414
if TYPE_CHECKING:
15+
from collections.abc import Iterable, Sequence
16+
1517
from pyproject_fmt.cli import Config
1618

1719
GREEN = "\u001b[32m"

src/pyproject_fmt/cli.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
1313
from dataclasses import dataclass
1414
from importlib.metadata import version
1515
from pathlib import Path
16-
from typing import Sequence
16+
from typing import TYPE_CHECKING
1717

1818
from pyproject_fmt_rust import Settings
1919

20+
if TYPE_CHECKING:
21+
from collections.abc import Sequence
22+
2023
if sys.version_info >= (3, 11): # pragma: >=3.11 cover
2124
import tomllib
2225
else: # pragma: <3.11 cover
@@ -80,12 +83,12 @@ def pyproject_toml_path_creator(argument: str) -> Path | None:
8083
def _version_argument(got: str) -> tuple[int, int]:
8184
parts = got.split(".")
8285
if len(parts) != 2: # noqa: PLR2004
83-
msg = f"invalid version: {got}, must be e.g. 3.12"
86+
msg = f"invalid version: {got}, must be e.g. 3.13"
8487
raise ArgumentTypeError(msg)
8588
try:
8689
return int(parts[0]), int(parts[1])
8790
except ValueError as exc:
88-
msg = f"invalid version: {got} due {exc!r}, must be e.g. 3.12"
91+
msg = f"invalid version: {got} due {exc!r}, must be e.g. 3.13"
8992
raise ArgumentTypeError(msg) from exc
9093

9194

@@ -136,7 +139,7 @@ def _build_cli() -> ArgumentParser:
136139
"--max-supported-python",
137140
metavar="minor.major",
138141
type=_version_argument,
139-
default=(3, 12),
142+
default=(3, 13),
140143
help="latest Python version the project supports (e.g. 3.13)",
141144
)
142145

@@ -190,7 +193,7 @@ def cli_args(args: Sequence[str]) -> list[Config]:
190193
indent=indent,
191194
keep_full_version=keep_full_version,
192195
max_supported_python=max_supported_python,
193-
min_supported_python=(3, 8), # default for when the user did not specify via requires-python
196+
min_supported_python=(3, 9), # default for when the user did not specify via requires-python
194197
),
195198
)
196199
)

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_cli_invalid_version(capsys: pytest.CaptureFixture[str], tmp_path: Path)
3333
assert context.value.code == 2
3434
out, err = capsys.readouterr()
3535
assert not out
36-
assert "error: argument --max-supported-python: invalid version: 3, must be e.g. 3.12\n" in err
36+
assert "error: argument --max-supported-python: invalid version: 3, must be e.g. 3.13\n" in err
3737

3838

3939
def test_cli_invalid_version_value(capsys: pytest.CaptureFixture[str], tmp_path: Path) -> None:

tests/test_main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def test_keep_full_version_cli(tmp_path: Path) -> None:
175175
[project]
176176
classifiers = [
177177
"Programming Language :: Python :: 3 :: Only",
178-
"Programming Language :: Python :: 3.8",
178+
"Programming Language :: Python :: 3.9",
179179
]
180180
dependencies = [
181181
"a==1.0.0",
@@ -186,7 +186,7 @@ def test_keep_full_version_cli(tmp_path: Path) -> None:
186186
"""
187187
pyproject_toml = tmp_path / "pyproject.toml"
188188
pyproject_toml.write_text(dedent(start))
189-
args = [str(pyproject_toml), "--keep-full-version", "--max-supported-python", "3.8"]
189+
args = [str(pyproject_toml), "--keep-full-version", "--max-supported-python", "3.9"]
190190
run(args)
191191
output = pyproject_toml.read_text()
192192
assert output == dedent(start)
@@ -212,7 +212,7 @@ def test_pyproject_toml_config(tmp_path: Path, capsys: pytest.CaptureFixture[str
212212
column_width = 20
213213
indent = 4
214214
keep_full_version = true
215-
max_supported_python = "3.10"
215+
max_supported_python = "3.11"
216216
ignore_extra = true
217217
"""
218218
filename = tmp_path / "pyproject.toml"
@@ -226,9 +226,9 @@ def test_pyproject_toml_config(tmp_path: Path, capsys: pytest.CaptureFixture[str
226226
]
227227
classifiers = [
228228
"Programming Language :: Python :: 3 :: Only",
229-
"Programming Language :: Python :: 3.8",
230229
"Programming Language :: Python :: 3.9",
231230
"Programming Language :: Python :: 3.10",
231+
"Programming Language :: Python :: 3.11",
232232
]
233233
dynamic = [
234234
"B",
@@ -241,7 +241,7 @@ def test_pyproject_toml_config(tmp_path: Path, capsys: pytest.CaptureFixture[str
241241
column_width = 20
242242
indent = 4
243243
keep_full_version = true
244-
max_supported_python = "3.10"
244+
max_supported_python = "3.11"
245245
ignore_extra = true
246246
"""
247247
got = filename.read_text()

tox.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ env_list =
99
3.11
1010
3.10
1111
3.9
12-
3.8
1312
type
1413
docs
1514
pkg_meta
@@ -35,7 +34,7 @@ commands =
3534
description = run static analysis and style check using flake8
3635
skip_install = true
3736
deps =
38-
pre-commit-uv>=4.1.1
37+
pre-commit-uv>=4.1.3
3938
commands =
4039
pre-commit run --all-files --show-diff-on-failure
4140
python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")'
@@ -64,7 +63,7 @@ skip_install = true
6463
deps =
6564
check-wheel-contents>=0.6
6665
twine>=5.1.1
67-
uv>=0.4.10
66+
uv>=0.4.18
6867
commands =
6968
uv build --sdist --wheel --out-dir {env_tmp_dir} .
7069
twine check {env_tmp_dir}{/}*

0 commit comments

Comments
 (0)