From b85553051d3fa66a12f96e4be12bbbf7a461953f Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 18 Dec 2024 17:45:59 -0600 Subject: [PATCH 1/3] pyproject(tool.ruff[target-version]) py38 -> py39 See also: https://docs.astral.sh/ruff/settings/#target-version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3506160..9e887c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -131,7 +131,7 @@ files = [ ] [tool.ruff] -target-version = "py38" +target-version = "py39" [tool.ruff.lint] select = [ From 7f43beb8bdf3e6850895174f7661590a228dd7c1 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 18 Dec 2024 17:46:18 -0600 Subject: [PATCH 2/3] pyproject(tool.mypy[python_version]) Add `3.9` See also: https://mypy.readthedocs.io/en/stable/config_file.html#confval-python_version --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 9e887c5..445b8e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,6 +125,7 @@ build-backend = "hatchling.build" [tool.mypy] strict = true +python_version = "3.9" files = [ "src/", "tests/", From 6e885a03e4f5c9a74953ae006e39c22858163b4f Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 18 Dec 2024 17:46:31 -0600 Subject: [PATCH 3/3] chore(ruff) Automated fixes for Python 3.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ruff check . --select ALL --fix --unsafe-fixes --preview --show-fixes --ignore T201 --ignore PT014 --ignore RUF100; ruff format .; Fixed 9 errors: - docs/conf.py: 6 × UP006 (non-pep585-annotation) - tests/test_cli.py: 3 × UP006 (non-pep585-annotation) Found 54 errors (9 fixed, 45 remaining). 5 files left unchanged --- docs/conf.py | 8 ++++---- tests/test_cli.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 55dcc8d..087bb2f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ sys.path.insert(0, str(cwd / "_ext")) # package data -about: t.Dict[str, str] = {} +about: dict[str, str] = {} with (src_root / "g" / "__about__.py").open() as fp: exec(fp.read(), about) @@ -70,8 +70,8 @@ html_css_files = ["css/custom.css"] html_extra_path = ["manifest.json"] html_theme = "furo" -html_theme_path: t.List[str] = [] -html_theme_options: t.Dict[str, t.Union[str, t.List[t.Dict[str, str]]]] = { +html_theme_path: list[str] = [] +html_theme_options: dict[str, t.Union[str, list[dict[str, str]]]] = { "light_logo": "img/g.svg", "dark_logo": "img/g-dark.svg", "footer_icons": [ @@ -129,7 +129,7 @@ } -def linkcode_resolve(domain: str, info: t.Dict[str, str]) -> t.Union[None, str]: +def linkcode_resolve(domain: str, info: dict[str, str]) -> t.Union[None, str]: """ Determine the URL corresponding to Python object. diff --git a/tests/test_cli.py b/tests/test_cli.py index d3df083..304bb09 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -46,13 +46,13 @@ class CommandLineTestFixture(t.NamedTuple): env: EnvFlag # test data - argv_args: t.List[str] + argv_args: list[str] # results expect_cmd: t.Optional[str] -TEST_FIXTURES: t.List[CommandLineTestFixture] = [ +TEST_FIXTURES: list[CommandLineTestFixture] = [ CommandLineTestFixture( test_id="g-cmd-inside-git-dir", env=EnvFlag.Git, @@ -89,7 +89,7 @@ def test_command_line( # capsys: pytest.CaptureFixture[str], test_id: str, env: EnvFlag, - argv_args: t.List[str], + argv_args: list[str], expect_cmd: t.Optional[str], monkeypatch: pytest.MonkeyPatch, tmp_path: pathlib.Path,