Skip to content

Commit

Permalink
Fix type checker and bump tools (#3107)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat committed Aug 28, 2023
1 parent cd7616f commit ce3c96e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ repos:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.13.1"
rev: "1.1.0"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.8"]
additional_dependencies: ["tox>=4.10"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.2"
hooks:
Expand All @@ -29,7 +29,7 @@ repos:
- id: blacken-docs
additional_dependencies: [black==23.7]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.285"
rev: "v0.0.286"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ dependencies = [
'importlib-metadata>=6.8; python_version < "3.8"',
"packaging>=23.1",
"platformdirs>=3.10",
"pluggy>=1.2",
"pyproject-api>=1.5.3",
"pluggy>=1.3",
"pyproject-api>=1.5.4",
'tomli>=2.0.1; python_version < "3.11"',
'typing-extensions>=4.7.1; python_version < "3.8"',
"virtualenv>=20.24.3",
]
optional-dependencies.docs = [
"furo>=2023.7.26",
"sphinx>=7.1.2",
"furo>=2023.8.19",
"sphinx>=7.2.4",
"sphinx-argparse-cli>=1.11.1",
"sphinx-autodoc-typehints!=1.23.4,>=1.24",
"sphinx-copybutton>=0.5.2",
Expand All @@ -74,7 +74,7 @@ optional-dependencies.testing = [
"build[virtualenv]>=0.10",
"covdefaults>=2.3",
"detect-test-pollution>=1.1.1",
"devpi-process>=0.3.1",
"devpi-process>=1",
"diff-cover>=7.7",
"distlib>=0.3.7",
"flaky>=3.7",
Expand All @@ -87,7 +87,7 @@ optional-dependencies.testing = [
"pytest-xdist>=3.3.1",
"re-assert>=1.1",
'time-machine>=2.12; implementation_name != "pypy"',
"wheel>=0.41.1",
"wheel>=0.41.2",
]
urls.Documentation = "https://tox.wiki"
urls.Homepage = "http://tox.readthedocs.org"
Expand Down
9 changes: 2 additions & 7 deletions src/tox/plugin/spec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
from typing import TYPE_CHECKING, Any

import pluggy

Expand All @@ -14,12 +14,7 @@
from tox.tox_env.api import ToxEnv
from tox.tox_env.register import ToxEnvRegister

_F = TypeVar("_F", bound=Callable[..., Any])
_spec_marker = pluggy.HookspecMarker(NAME)


def _spec(func: _F) -> _F:
return cast(_F, _spec_marker(func))
_spec = pluggy.HookspecMarker(NAME)


@_spec
Expand Down
2 changes: 1 addition & 1 deletion src/tox/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def pytest_configure(config: pytest.Config) -> None:
config.addinivalue_line("markers", "plugin_test")


@pytest.hookimpl(trylast=True) # type: ignore[misc] # not typed decorator
@pytest.hookimpl(trylast=True)
def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Function]) -> None:
# do not require flags if called directly
if len(items) == 1: # pragma: no cover # hard to test
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ commands =
[testenv:type]
description = run type check on code base
deps =
mypy==1.5
mypy==1.5.1
types-cachetools>=5.3.0.6
types-chardet>=5.0.4.6
commands =
Expand Down

0 comments on commit ce3c96e

Please sign in to comment.