Skip to content

Commit 6ca8d9b

Browse files
[pre-commit.ci] pre-commit autoupdate (#3091)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2124458 commit 6ca8d9b

File tree

28 files changed

+127
-163
lines changed

28 files changed

+127
-163
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
py:
21-
- "3.12.0-beta.2"
21+
- "3.12.0-rc.1"
2222
- "3.11"
2323
- "3.10"
2424
- "3.9"
2525
- "3.8"
26-
- "3.7"
2726
os:
2827
- ubuntu-latest
2928
- windows-latest

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ repos:
1414
- id: tox-ini-fmt
1515
args: ["-p", "fix"]
1616
- repo: https://github.com/tox-dev/pyproject-fmt
17-
rev: "0.13.0"
17+
rev: "0.13.1"
1818
hooks:
1919
- id: pyproject-fmt
20-
additional_dependencies: ["tox>=4.6.4"]
20+
additional_dependencies: ["tox>=4.8"]
2121
- repo: https://github.com/pre-commit/mirrors-prettier
2222
rev: "v3.0.1"
2323
hooks:
@@ -29,7 +29,7 @@ repos:
2929
- id: blacken-docs
3030
additional_dependencies: [black==23.7]
3131
- repo: https://github.com/astral-sh/ruff-pre-commit
32-
rev: "v0.0.282"
32+
rev: "v0.0.284"
3333
hooks:
3434
- id: ruff
3535
args: [--fix, --exit-non-zero-on-fix]

pyproject.toml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
build-backend = "hatchling.build"
33
requires = [
44
"hatch-vcs>=0.3",
5-
"hatchling>=1.17.1",
5+
"hatchling>=1.18",
66
]
77

88
[project]
@@ -24,7 +24,7 @@ maintainers = [
2424
{ name = "Oliver Bestwalter", email = "[email protected]" },
2525
]
2626
authors = [{ name = "Bernát Gábor", email = "[email protected]" }]
27-
requires-python = ">=3.7"
27+
requires-python = ">=3.8"
2828
classifiers = [
2929
"Development Status :: 5 - Production/Stable",
3030
"Framework :: tox",
@@ -34,7 +34,6 @@ classifiers = [
3434
"Operating System :: Microsoft :: Windows",
3535
"Operating System :: POSIX",
3636
"Programming Language :: Python :: 3 :: Only",
37-
"Programming Language :: Python :: 3.7",
3837
"Programming Language :: Python :: 3.8",
3938
"Programming Language :: Python :: 3.9",
4039
"Programming Language :: Python :: 3.10",
@@ -49,23 +48,23 @@ dynamic = [
4948
]
5049
dependencies = [
5150
"cachetools>=5.3.1",
52-
"chardet>=5.1",
51+
"chardet>=5.2",
5352
"colorama>=0.4.6",
5453
"filelock>=3.12.2",
55-
'importlib-metadata>=6.7; python_version < "3.8"',
54+
'importlib-metadata>=6.8; python_version < "3.8"',
5655
"packaging>=23.1",
57-
"platformdirs>=3.9.1",
56+
"platformdirs>=3.10",
5857
"pluggy>=1.2",
5958
"pyproject-api>=1.5.3",
6059
'tomli>=2.0.1; python_version < "3.11"',
6160
'typing-extensions>=4.7.1; python_version < "3.8"',
62-
"virtualenv>=20.24.1",
61+
"virtualenv>=20.24.3",
6362
]
6463
optional-dependencies.docs = [
65-
"furo>=2023.5.20",
66-
"sphinx>=7.0.1",
64+
"furo>=2023.7.26",
65+
"sphinx>=7.1.2",
6766
"sphinx-argparse-cli>=1.11.1",
68-
"sphinx-autodoc-typehints!=1.23.4,>=1.23.3",
67+
"sphinx-autodoc-typehints!=1.23.4,>=1.24",
6968
"sphinx-copybutton>=0.5.2",
7069
"sphinx-inline-tabs>=2023.4.21",
7170
"sphinxcontrib-towncrier>=0.2.1a0",
@@ -80,15 +79,15 @@ optional-dependencies.testing = [
8079
"distlib>=0.3.7",
8180
"flaky>=3.7",
8281
"hatch-vcs>=0.3",
83-
"hatchling>=1.17.1",
82+
"hatchling>=1.18",
8483
"psutil>=5.9.5",
8584
"pytest>=7.4",
8685
"pytest-cov>=4.1",
8786
"pytest-mock>=3.11.1",
8887
"pytest-xdist>=3.3.1",
8988
"re-assert>=1.1",
90-
'time-machine>=2.10; implementation_name != "pypy"',
91-
"wheel>=0.40",
89+
'time-machine>=2.12; implementation_name != "pypy"',
90+
"wheel>=0.41.1",
9291
]
9392
urls.Documentation = "https://tox.wiki"
9493
urls.Homepage = "http://tox.readthedocs.org"
@@ -109,7 +108,7 @@ line-length = 120
109108
[tool.ruff]
110109
select = ["ALL"]
111110
line-length = 120
112-
target-version = "py37"
111+
target-version = "py38"
113112
isort = {known-first-party = ["tox", "tests"], required-imports = ["from __future__ import annotations"]}
114113
ignore = [
115114
"INP001", # no implicit namespaces here

src/tox/config/cli/parser.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,14 @@
77
import sys
88
from argparse import SUPPRESS, Action, ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace
99
from pathlib import Path
10-
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, TypeVar, cast
10+
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Literal, Optional, Sequence, Tuple, Type, TypeVar, cast
1111

1212
from tox.config.loader.str_convert import StrConvert
1313
from tox.plugin import NAME
1414

1515
from .env_var import get_env_var
1616
from .ini import IniConfig
1717

18-
if sys.version_info >= (3, 8): # pragma: no cover (py38+)
19-
from typing import Literal
20-
else: # pragma: no cover (py38+)
21-
from typing_extensions import Literal
22-
2318
if TYPE_CHECKING:
2419
from tox.session.state import State
2520

src/tox/config/loader/api.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ def __repr__(self) -> str:
3838
def __str__(self) -> str:
3939
return f"{self.namespace}{'.' if self.namespace else ''}{self.key}={self.value}"
4040

41-
def __eq__(self, other: Any) -> bool:
41+
def __eq__(self, other: object) -> bool:
4242
if type(self) != type(other):
4343
return False
44-
return (self.namespace, self.key, self.value) == (other.namespace, other.key, other.value)
44+
return (self.namespace, self.key, self.value) == (
45+
other.namespace, # type: ignore[attr-defined]
46+
other.key, # type: ignore[attr-defined]
47+
other.value, # type: ignore[attr-defined]
48+
)
4549

46-
def __ne__(self, other: Any) -> bool:
50+
def __ne__(self, other: object) -> bool:
4751
return not (self == other)
4852

4953

src/tox/config/loader/convert.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
from __future__ import annotations
22

3-
import sys
43
from abc import ABC, abstractmethod
54
from collections import OrderedDict
65
from pathlib import Path
7-
from typing import Any, Callable, Dict, Generic, Iterator, List, Optional, Set, TypeVar, Union, cast
6+
from typing import Any, Callable, Dict, Generic, Iterator, List, Literal, Optional, Set, TypeVar, Union, cast
87

98
from tox.config.types import Command, EnvList
109

11-
if sys.version_info >= (3, 8): # pragma: no cover (py38+)
12-
from typing import Literal
13-
else: # pragma: no cover (py38+)
14-
from typing_extensions import Literal
15-
16-
1710
_NO_MAPPING = object()
1811
T = TypeVar("T")
1912
V = TypeVar("V")

src/tox/config/loader/ini/replace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, expr: Sequence[MatchArg], term_pos: int | None = None) -> Non
6767
def __repr__(self) -> str:
6868
return f"MatchExpression(expr={self.expr!r}, term_pos={self.term_pos!r})"
6969

70-
def __eq__(self, other: Any) -> bool:
70+
def __eq__(self, other: object) -> bool:
7171
if isinstance(other, type(self)):
7272
return self.expr == other.expr
7373
return NotImplemented

src/tox/config/loader/section.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
from __future__ import annotations
22

3-
from typing import Any, TypeVar
3+
from typing import TYPE_CHECKING
44

5-
_Section = TypeVar("_Section", bound="Section")
5+
if TYPE_CHECKING:
6+
import sys
7+
8+
if sys.version_info >= (3, 11): # pragma: no cover (py311+)
9+
from typing import Self
10+
else: # pragma: no cover (<py311)
11+
from typing_extensions import Self
612

713

814
class Section:
@@ -15,7 +21,7 @@ def __init__(self, prefix: str | None, name: str) -> None:
1521
self._name = name
1622

1723
@classmethod
18-
def from_key(cls: type[_Section], key: str) -> _Section:
24+
def from_key(cls: type[Self], key: str) -> Self:
1925
"""
2026
Create a section from a section key.
2127
@@ -50,7 +56,7 @@ def __str__(self) -> str:
5056
def __repr__(self) -> str:
5157
return f"{self.__class__.__name__}(prefix={self._prefix!r}, name={self._name!r})"
5258

53-
def __eq__(self, other: Any) -> bool:
59+
def __eq__(self, other: object) -> bool:
5460
return isinstance(other, self.__class__) and (self._prefix, self._name) == (
5561
other._prefix,
5662
other.name,

src/tox/config/of_type.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from abc import ABC, abstractmethod
55
from itertools import product
6-
from typing import TYPE_CHECKING, Any, Callable, Generic, Iterable, TypeVar, cast
6+
from typing import TYPE_CHECKING, Callable, Generic, Iterable, TypeVar, cast
77

88
from tox.config.loader.api import ConfigLoadArgs, Loader
99

@@ -27,10 +27,10 @@ def __init__(self, keys: Iterable[str], desc: str) -> None:
2727
def __call__(self, conf: Config, loaders: list[Loader[T]], args: ConfigLoadArgs) -> T:
2828
raise NotImplementedError
2929

30-
def __eq__(self, o: Any) -> bool:
31-
return type(self) == type(o) and (self.keys, self.desc) == (o.keys, o.desc)
30+
def __eq__(self, o: object) -> bool:
31+
return type(self) == type(o) and (self.keys, self.desc) == (o.keys, o.desc) # type: ignore[attr-defined]
3232

33-
def __ne__(self, o: Any) -> bool:
33+
def __ne__(self, o: object) -> bool:
3434
return not (self == o)
3535

3636

@@ -54,8 +54,8 @@ def __call__(
5454
) -> T:
5555
return self.value() if callable(self.value) else self.value
5656

57-
def __eq__(self, o: Any) -> bool:
58-
return type(self) == type(o) and super().__eq__(o) and self.value == o.value
57+
def __eq__(self, o: object) -> bool:
58+
return type(self) == type(o) and super().__eq__(o) and self.value == o.value # type: ignore[attr-defined]
5959

6060

6161
_PLACE_HOLDER = object()
@@ -112,11 +112,12 @@ def __repr__(self) -> str:
112112
values = ((k, v) for k, v in vars(self).items() if k != "post_process" and v is not None)
113113
return f"{type(self).__name__}({', '.join(f'{k}={v}' for k, v in values)})"
114114

115-
def __eq__(self, o: Any) -> bool:
115+
def __eq__(self, o: object) -> bool:
116116
return (
117117
type(self) == type(o)
118118
and super().__eq__(o)
119-
and (self.of_type, self.default, self.post_process) == (o.of_type, o.default, o.post_process)
119+
and (self.of_type, self.default, self.post_process)
120+
== (o.of_type, o.default, o.post_process) # type: ignore[attr-defined]
120121
)
121122

122123

src/tox/config/types.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from collections import OrderedDict
4-
from typing import Any, Iterator, Sequence
4+
from typing import Iterator, Sequence
55

66
from tox.execute.request import shell_cmd
77

@@ -21,10 +21,13 @@ def __init__(self, args: list[str]) -> None:
2121
def __repr__(self) -> str:
2222
return f"{type(self).__name__}(args={(['-'] if self.ignore_exit_code else [])+ self.args!r})"
2323

24-
def __eq__(self, other: Any) -> bool:
25-
return type(self) == type(other) and (self.args, self.ignore_exit_code) == (other.args, other.ignore_exit_code)
24+
def __eq__(self, other: object) -> bool:
25+
return type(self) == type(other) and (self.args, self.ignore_exit_code) == (
26+
other.args, # type: ignore[attr-defined]
27+
other.ignore_exit_code, # type: ignore[attr-defined]
28+
)
2629

27-
def __ne__(self, other: Any) -> bool:
30+
def __ne__(self, other: object) -> bool:
2831
return not (self == other)
2932

3033
@property
@@ -47,10 +50,10 @@ def __init__(self, envs: Sequence[str]) -> None:
4750
def __repr__(self) -> str:
4851
return f"{type(self).__name__}({self.envs!r})"
4952

50-
def __eq__(self, other: Any) -> bool:
51-
return type(self) == type(other) and self.envs == other.envs
53+
def __eq__(self, other: object) -> bool:
54+
return type(self) == type(other) and self.envs == other.envs # type: ignore[attr-defined]
5255

53-
def __ne__(self, other: Any) -> bool:
56+
def __ne__(self, other: object) -> bool:
5457
return not (self == other)
5558

5659
def __iter__(self) -> Iterator[str]:

0 commit comments

Comments
 (0)