From 0a3d57899987ce54747aced770f1e4d273a071ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Thu, 23 Mar 2023 07:42:22 -0700 Subject: [PATCH] Bump deps and tools (#2954) --- .pre-commit-config.yaml | 10 +++---- pyproject.toml | 26 +++++++++---------- src/tox/config/cli/parser.py | 4 +-- src/tox/config/loader/convert.py | 4 +-- src/tox/pytest.py | 2 +- src/tox/report.py | 4 +-- .../python/virtual_env/package/util.py | 6 ++--- tox.ini | 10 +++---- whitelist.txt | 1 + 9 files changed, 34 insertions(+), 33 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13fd1c6e4..d368db6a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,14 +52,14 @@ repos: hooks: - id: flake8 additional_dependencies: - - flake8-bugbear==23.1.20 - - flake8-comprehensions==3.10.1 - - flake8-pytest-style==1.6 + - flake8-bugbear==23.3.12 + - flake8-comprehensions==3.11.1 + - flake8-pytest-style==1.7.2 - flake8-spellcheck==0.28 - flake8-unused-arguments==0.0.13 - - flake8-noqa==1.3 + - flake8-noqa==1.3.1 - pep8-naming==0.13.3 - - flake8-pyproject==1.2.2 + - flake8-pyproject==1.2.3 - repo: https://github.com/pre-commit/mirrors-prettier rev: "v2.7.1" hooks: diff --git a/pyproject.toml b/pyproject.toml index 98cf4686d..ebb1ef786 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ build-backend = "hatchling.build" requires = [ "hatch-vcs>=0.3", - "hatchling>=1.12.2", + "hatchling>=1.13", ] [project] @@ -51,15 +51,15 @@ dependencies = [ "cachetools>=5.3", "chardet>=5.1", "colorama>=0.4.6", - "filelock>=3.9", - 'importlib-metadata>=6; python_version < "3.8"', + "filelock>=3.10", + 'importlib-metadata>=6.1; python_version < "3.8"', "packaging>=23", - "platformdirs>=2.6.2", + "platformdirs>=3.1.1", "pluggy>=1", - "pyproject-api>=1.5", + "pyproject-api>=1.5.1", 'tomli>=2.0.1; python_version < "3.11"', - 'typing-extensions>=4.4; python_version < "3.8"', - "virtualenv>=20.17.1", + 'typing-extensions>=4.5; python_version < "3.8"', + "virtualenv>=20.21", ] optional-dependencies.docs = [ "furo>=2022.12.7", @@ -73,21 +73,21 @@ optional-dependencies.docs = [ ] optional-dependencies.testing = [ "build[virtualenv]>=0.10", - "covdefaults>=2.2.2", + "covdefaults>=2.3", "devpi-process>=0.3", - "diff-cover>=7.4", + "diff-cover>=7.5", "distlib>=0.3.6", "flaky>=3.7", "hatch-vcs>=0.3", - "hatchling>=1.12.2", + "hatchling>=1.13", "psutil>=5.9.4", - "pytest>=7.2.1", + "pytest>=7.2.2", "pytest-cov>=4", "pytest-mock>=3.10", - "pytest-xdist>=3.1", + "pytest-xdist>=3.2.1", "re-assert>=1.1", 'time-machine>=2.9; implementation_name != "pypy"', - "wheel>=0.38.4", + "wheel>=0.40", ] urls.Documentation = "https://tox.wiki" urls.Homepage = "http://tox.readthedocs.org" diff --git a/src/tox/config/cli/parser.py b/src/tox/config/cli/parser.py index aeee7f1f1..6d7c44cd5 100644 --- a/src/tox/config/cli/parser.py +++ b/src/tox/config/cli/parser.py @@ -203,11 +203,11 @@ def add_argument(*a_args: str, of_type: type[Any] | None = None, **a_kwargs: Any excl.append((e_kwargs, arguments)) res_excl = prev_excl(**kwargs) prev_add_arg = res_excl.add_argument - res_excl.add_argument = add_argument # type: ignore[assignment] + res_excl.add_argument = add_argument # type: ignore[method-assign] return res_excl prev_excl = result.add_mutually_exclusive_group - result.add_mutually_exclusive_group = add_mutually_exclusive_group # type: ignore[assignment] + result.add_mutually_exclusive_group = add_mutually_exclusive_group # type: ignore[method-assign] excl: list[tuple[dict[str, Any], list[ArgumentArgs]]] = [] self._groups.append((args, kwargs, excl)) return result diff --git a/src/tox/config/loader/convert.py b/src/tox/config/loader/convert.py index b9259b05b..900f1e21c 100644 --- a/src/tox/config/loader/convert.py +++ b/src/tox/config/loader/convert.py @@ -71,13 +71,13 @@ def _to_typing(self, raw: T, of_type: type[V], factory: Factory[V]) -> V: elif origin == Union: # handle Optional values args: list[type[Any]] = of_type.__args__ # type: ignore[attr-defined] none = type(None) - if len(args) == 2 and none in args: + if len(args) == 2 and none in args: # type: ignore[comparison-overlap] if isinstance(raw, str): raw = raw.strip() # type: ignore[assignment] if not raw: result = None else: - new_type = next(i for i in args if i != none) # pragma: no cover # this will always find a element + new_type = next(i for i in args if i != none) # type: ignore # pragma: no cover result = self.to(raw, new_type, factory) elif origin in (Literal, type(Literal)): choice = of_type.__args__ # type: ignore[attr-defined] diff --git a/src/tox/pytest.py b/src/tox/pytest.py index fb83721c3..0bc9905b6 100644 --- a/src/tox/pytest.py +++ b/src/tox/pytest.py @@ -394,7 +394,7 @@ def matches(pattern: str, text: str, flags: int = 0) -> None: except ImportError: # pragma: no cover # hard to test match = re.match(pattern, text, flags) if match is None: - warnings.warn("install the re-assert PyPI package for bette error message", UserWarning) + warnings.warn("install the re-assert PyPI package for bette error message", UserWarning, stacklevel=1) assert match else: assert Matches(pattern, flags=flags) == text diff --git a/src/tox/report.py b/src/tox/report.py index f8a57a789..70c1de971 100644 --- a/src/tox/report.py +++ b/src/tox/report.py @@ -41,11 +41,11 @@ def new_start(self: Thread) -> None: # need to patch this self.parent_ident = current_thread().ident # type: ignore[attr-defined] old_start(self) - old_start, Thread.start = Thread.start, new_start # type: ignore[assignment] + old_start, Thread.start = Thread.start, new_start # type: ignore[method-assign] try: yield finally: - Thread.start = old_start # type: ignore[assignment] + Thread.start = old_start # type: ignore[method-assign] @property def name(self) -> str: diff --git a/src/tox/tox_env/python/virtual_env/package/util.py b/src/tox/tox_env/python/virtual_env/package/util.py index 603f93edb..039b64764 100644 --- a/src/tox/tox_env/python/virtual_env/package/util.py +++ b/src/tox/tox_env/python/virtual_env/package/util.py @@ -3,7 +3,7 @@ from copy import deepcopy from typing import Optional, Set, cast -from packaging.markers import Marker, Op, Value, Variable # type: ignore[attr-defined] +from packaging.markers import Marker, Op, Variable # type: ignore[attr-defined] from packaging.requirements import Requirement @@ -72,7 +72,7 @@ def _extract_extra_markers(req: Requirement) -> tuple[Requirement, set[str | Non return req, cast(Set[Optional[str]], extra_markers) or {None} -def _get_extra(_marker: str | tuple[Variable, Op, Value]) -> str | None: +def _get_extra(_marker: str | tuple[Variable, Op, Variable]) -> str | None: if isinstance(_marker, tuple) and len(_marker) == 3 and _marker[0].value == "extra" and _marker[1].value == "==": - return cast(str, _marker[2].value) + return _marker[2].value return None diff --git a/tox.ini b/tox.ini index e8812c65b..f86aedf62 100644 --- a/tox.ini +++ b/tox.ini @@ -43,7 +43,7 @@ passenv = PROGRAMDATA skip_install = true deps = - pre-commit>=2.21 + pre-commit>=3.2 commands = pre-commit run --all-files --show-diff-on-failure {posargs} python -c 'print(r"hint: run {envbindir}{/}pre-commit install to add checks as pre-commit hook")' @@ -51,9 +51,9 @@ commands = [testenv:type] description = run type check on code base deps = - mypy==0.991 - types-cachetools>=5.3 - types-chardet>=5.0.4.1 + mypy==1.1.1 + types-cachetools>=5.3.0.4 + types-chardet>=5.0.4.2 commands = mypy src/tox mypy tests @@ -82,7 +82,7 @@ commands = description = do a release, required posarg of the version number skip_install = true deps = - gitpython>=3.1.30 + gitpython>=3.1.31 packaging>=23 towncrier>=22.12 commands = diff --git a/whitelist.txt b/whitelist.txt index b0a619996..9300e44f4 100644 --- a/whitelist.txt +++ b/whitelist.txt @@ -156,6 +156,7 @@ signum sigterm skipif splitter +stacklevel statemachine string2lines stringify