Skip to content

Commit 9d432d9

Browse files
authored
Python 3.9 Modernization (#32)
Python 3.8 dropped via #33, so we will modernize the syntax!
2 parents d03744d + 6e885a0 commit 9d432d9

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
sys.path.insert(0, str(cwd / "_ext"))
2323

2424
# package data
25-
about: t.Dict[str, str] = {}
25+
about: dict[str, str] = {}
2626
with (src_root / "g" / "__about__.py").open() as fp:
2727
exec(fp.read(), about)
2828

@@ -70,8 +70,8 @@
7070
html_css_files = ["css/custom.css"]
7171
html_extra_path = ["manifest.json"]
7272
html_theme = "furo"
73-
html_theme_path: t.List[str] = []
74-
html_theme_options: t.Dict[str, t.Union[str, t.List[t.Dict[str, str]]]] = {
73+
html_theme_path: list[str] = []
74+
html_theme_options: dict[str, t.Union[str, list[dict[str, str]]]] = {
7575
"light_logo": "img/g.svg",
7676
"dark_logo": "img/g-dark.svg",
7777
"footer_icons": [
@@ -129,7 +129,7 @@
129129
}
130130

131131

132-
def linkcode_resolve(domain: str, info: t.Dict[str, str]) -> t.Union[None, str]:
132+
def linkcode_resolve(domain: str, info: dict[str, str]) -> t.Union[None, str]:
133133
"""
134134
Determine the URL corresponding to Python object.
135135

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,14 @@ build-backend = "hatchling.build"
125125

126126
[tool.mypy]
127127
strict = true
128+
python_version = "3.9"
128129
files = [
129130
"src/",
130131
"tests/",
131132
]
132133

133134
[tool.ruff]
134-
target-version = "py38"
135+
target-version = "py39"
135136

136137
[tool.ruff.lint]
137138
select = [

tests/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ class CommandLineTestFixture(t.NamedTuple):
4646
env: EnvFlag
4747

4848
# test data
49-
argv_args: t.List[str]
49+
argv_args: list[str]
5050

5151
# results
5252
expect_cmd: t.Optional[str]
5353

5454

55-
TEST_FIXTURES: t.List[CommandLineTestFixture] = [
55+
TEST_FIXTURES: list[CommandLineTestFixture] = [
5656
CommandLineTestFixture(
5757
test_id="g-cmd-inside-git-dir",
5858
env=EnvFlag.Git,
@@ -89,7 +89,7 @@ def test_command_line(
8989
# capsys: pytest.CaptureFixture[str],
9090
test_id: str,
9191
env: EnvFlag,
92-
argv_args: t.List[str],
92+
argv_args: list[str],
9393
expect_cmd: t.Optional[str],
9494
monkeypatch: pytest.MonkeyPatch,
9595
tmp_path: pathlib.Path,

0 commit comments

Comments
 (0)