Skip to content

Commit 0ca8fe9

Browse files
RonnyPfannschmidtkilliandesse
authored andcommitted
Merge pull request #65 from tn3w/fix-linter-errors
Remove unused typing imports to fix linting errors
2 parents 7190125 + 211b4c0 commit 0ca8fe9

File tree

3 files changed

+44
-63
lines changed

3 files changed

+44
-63
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.3.1
3+
rev: v3.20.0
44
hooks:
55
- id: pyupgrade
66
args: [--py38-plus]
77
- repo: https://github.com/tox-dev/pyproject-fmt
8-
rev: "0.4.1"
8+
rev: "v2.6.0"
99
hooks:
1010
- id: pyproject-fmt
1111

1212
- repo: https://github.com/psf/black
13-
rev: 22.12.0
13+
rev: 25.1.0
1414
hooks:
1515
- id: black
1616
language_version: python3
1717
- repo: https://github.com/pre-commit/mirrors-mypy
18-
rev: 'v0.991'
18+
rev: 'v1.17.0'
1919
hooks:
2020
- id: mypy
2121
args: []

pyproject.toml

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,42 @@
22
build-backend = "hatchling.build"
33
requires = [
44
"hatch-vcs",
5-
"hatchling>=1.26",
5+
"hatchling>=1.27.0",
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"]
1314
authors = [
14-
{ name = "Ronny Pfannschmidt", email = "opensource@ronnypfannschmidt.de" },
15-
{ name = "Holger Krekel", email = "holger.krekel@gmail.com" },
15+
{ name = "Ronny Pfannschmidt", email = "opensource@ronnypfannschmidt.de" },
16+
{ name = "Holger Krekel", email = "holger.krekel@gmail.com" },
1617
]
1718
requires-python = ">=3.8"
19+
classifiers = [
20+
"Development Status :: 4 - Beta",
21+
"Intended Audience :: Developers",
22+
"Operating System :: MacOS :: MacOS X",
23+
"Operating System :: Microsoft :: Windows",
24+
"Operating System :: POSIX",
25+
"Programming Language :: Python :: 3 :: Only",
26+
"Programming Language :: Python :: 3.8",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: Python :: 3.13",
32+
"Topic :: Software Development :: Libraries",
33+
"Topic :: Utilities",
34+
]
1835
dynamic = [
1936
"version",
2037
]
21-
classifiers = [
22-
"Development Status :: 4 - Beta",
23-
"Intended Audience :: Developers",
24-
"License :: OSI Approved :: MIT License",
25-
"Operating System :: MacOS :: MacOS X",
26-
"Operating System :: Microsoft :: Windows",
27-
"Operating System :: POSIX",
28-
"Programming Language :: Python :: 3",
29-
"Programming Language :: Python :: 3 :: Only",
30-
"Programming Language :: Python :: 3.8",
31-
"Programming Language :: Python :: 3.9",
32-
"Programming Language :: Python :: 3.10",
33-
"Programming Language :: Python :: 3.11",
34-
"Programming Language :: Python :: 3.12",
35-
"Programming Language :: Python :: 3.13",
36-
"Topic :: Software Development :: Libraries",
37-
"Topic :: Utilities",
38-
]
39-
[project.urls]
40-
Homepage = "https://github.com/pytest-dev/iniconfig"
38+
urls.Homepage = "https://github.com/pytest-dev/iniconfig"
4139

40+
[tool.setuptools_scm]
4241

4342
[tool.hatch.version]
4443
source = "vcs"
@@ -48,25 +47,22 @@ version-file = "src/iniconfig/_version.py"
4847

4948
[tool.hatch.build.targets.sdist]
5049
include = [
51-
"/src",
52-
"/testing",
50+
"/src",
51+
"/testing",
5352
]
5453

5554
[tool.hatch.envs.test]
5655
dependencies = [
57-
"pytest"
56+
"pytest",
5857
]
5958
[tool.hatch.envs.test.scripts]
6059
default = "pytest {args}"
6160

6261
[[tool.hatch.envs.test.matrix]]
63-
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
62+
python = [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
6463

65-
[tool.setuptools_scm]
64+
[tool.pytest.ini_options]
65+
testpaths = "testing"
6666

6767
[tool.mypy]
6868
strict = true
69-
70-
71-
[tool.pytest.ini_options]
72-
testpaths = "testing"

src/iniconfig/__init__.py

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
""" brain-dead simple parser for ini-style files.
1+
"""brain-dead simple parser for ini-style files.
22
(C) Ronny Pfannschmidt, Holger Krekel -- MIT licensed
33
"""
4+
45
from __future__ import annotations
56
from typing import (
67
Callable,
78
Iterator,
89
Mapping,
9-
Optional,
10-
Tuple,
1110
TypeVar,
12-
Union,
1311
TYPE_CHECKING,
14-
NoReturn,
15-
NamedTuple,
1612
overload,
17-
cast,
1813
)
1914

2015
import os
@@ -44,38 +39,33 @@ def lineof(self, name: str) -> int | None:
4439
return self.config.lineof(self.name, name)
4540

4641
@overload
47-
def get(self, key: str) -> str | None:
48-
...
42+
def get(self, key: str) -> str | None: ...
4943

5044
@overload
5145
def get(
5246
self,
5347
key: str,
5448
convert: Callable[[str], _T],
55-
) -> _T | None:
56-
...
49+
) -> _T | None: ...
5750

5851
@overload
5952
def get(
6053
self,
6154
key: str,
6255
default: None,
6356
convert: Callable[[str], _T],
64-
) -> _T | None:
65-
...
57+
) -> _T | None: ...
6658

6759
@overload
68-
def get(self, key: str, default: _D, convert: None = None) -> str | _D:
69-
...
60+
def get(self, key: str, default: _D, convert: None = None) -> str | _D: ...
7061

7162
@overload
7263
def get(
7364
self,
7465
key: str,
7566
default: _D,
7667
convert: Callable[[str], _T],
77-
) -> _T | _D:
78-
...
68+
) -> _T | _D: ...
7969

8070
# TODO: investigate possible mypy bug wrt matching the passed over data
8171
def get( # type: ignore [misc]
@@ -148,17 +138,15 @@ def get(
148138
self,
149139
section: str,
150140
name: str,
151-
) -> str | None:
152-
...
141+
) -> str | None: ...
153142

154143
@overload
155144
def get(
156145
self,
157146
section: str,
158147
name: str,
159148
convert: Callable[[str], _T],
160-
) -> _T | None:
161-
...
149+
) -> _T | None: ...
162150

163151
@overload
164152
def get(
@@ -167,14 +155,12 @@ def get(
167155
name: str,
168156
default: None,
169157
convert: Callable[[str], _T],
170-
) -> _T | None:
171-
...
158+
) -> _T | None: ...
172159

173160
@overload
174161
def get(
175162
self, section: str, name: str, default: _D, convert: None = None
176-
) -> str | _D:
177-
...
163+
) -> str | _D: ...
178164

179165
@overload
180166
def get(
@@ -183,8 +169,7 @@ def get(
183169
name: str,
184170
default: _D,
185171
convert: Callable[[str], _T],
186-
) -> _T | _D:
187-
...
172+
) -> _T | _D: ...
188173

189174
def get( # type: ignore
190175
self,

0 commit comments

Comments
 (0)