Skip to content

Commit 43aafc1

Browse files
committed
PR Feedback
Signed-off-by: Bernát Gábor <[email protected]>
1 parent f18b543 commit 43aafc1

File tree

7 files changed

+32
-42
lines changed

7 files changed

+32
-42
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
- id: add-trailing-comma
1818
args: [--py36-plus]
1919
- repo: https://github.com/asottile/pyupgrade
20-
rev: v3.3.1
20+
rev: v3.4.0
2121
hooks:
2222
- id: pyupgrade
2323
args: ["--py37-plus"]
@@ -52,7 +52,7 @@ repos:
5252
hooks:
5353
- id: flake8
5454
additional_dependencies:
55-
- flake8-bugbear==23.3.23
55+
- flake8-bugbear==23.5.9
5656
- flake8-comprehensions==3.12
5757
- flake8-pytest-style==1.7.2
5858
- flake8-spellcheck==0.28
@@ -69,7 +69,7 @@ repos:
6969
- "@prettier/[email protected]"
7070
args: ["--print-width=120", "--prose-wrap=always"]
7171
- repo: https://github.com/igorshubovych/markdownlint-cli
72-
rev: v0.33.0
72+
rev: v0.34.0
7373
hooks:
7474
- id: markdownlint
7575
- repo: local

pyproject.toml

Lines changed: 13 additions & 13 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.14",
5+
"hatchling>=1.17",
66
]
77

88
[project]
@@ -51,23 +51,23 @@ dependencies = [
5151
"cachetools>=5.3",
5252
"chardet>=5.1",
5353
"colorama>=0.4.6",
54-
"filelock>=3.11",
55-
'importlib-metadata>=6.4.1; python_version < "3.8"',
54+
"filelock>=3.12",
55+
'importlib-metadata>=6.6; python_version < "3.8"',
5656
"packaging>=23.1",
57-
"platformdirs>=3.2",
57+
"platformdirs>=3.5.1",
5858
"pluggy>=1",
5959
"pyproject-api>=1.5.1",
6060
'tomli>=2.0.1; python_version < "3.11"',
61-
'typing-extensions>=4.5; python_version < "3.8"',
62-
"virtualenv>=20.21",
61+
'typing-extensions>=4.6.2; python_version < "3.8"',
62+
"virtualenv>=20.23",
6363
]
6464
optional-dependencies.docs = [
65-
"furo>=2023.3.27",
66-
"sphinx>=6.1.3",
65+
"furo>=2023.5.20",
66+
"sphinx>=7.0.1",
6767
"sphinx-argparse-cli>=1.11",
6868
"sphinx-autodoc-typehints!=1.23.4,>=1.23",
6969
"sphinx-copybutton>=0.5.2",
70-
"sphinx-inline-tabs>=2022.1.2b11",
70+
"sphinx-inline-tabs>=2023.4.21",
7171
"sphinxcontrib-towncrier>=0.2.1a0",
7272
"towncrier>=22.12",
7373
]
@@ -79,12 +79,12 @@ optional-dependencies.testing = [
7979
"distlib>=0.3.6",
8080
"flaky>=3.7",
8181
"hatch-vcs>=0.3",
82-
"hatchling>=1.14",
83-
"psutil>=5.9.4",
82+
"hatchling>=1.17",
83+
"psutil>=5.9.5",
8484
"pytest>=7.3.1",
85-
"pytest-cov>=4",
85+
"pytest-cov>=4.1",
8686
"pytest-mock>=3.10",
87-
"pytest-xdist>=3.2.1",
87+
"pytest-xdist>=3.3.1",
8888
"re-assert>=1.1",
8989
'time-machine>=2.9; implementation_name != "pypy"',
9090
"wheel>=0.40",

src/tox/session/cmd/legacy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ def legacy(state: State) -> int:
104104
if option.list_envs or option.list_envs_all:
105105
return list_env(state)
106106
if option.devenv_path:
107+
if option.env.is_default_list:
108+
option.env = CliEnv(["py"])
107109
option.devenv_path = Path(option.devenv_path)
108-
option.env = option.env or CliEnv("py")
109110
return devenv(state)
110111
if option.parallel != 0: # only 0 means sequential
111112
return run_parallel(state)

src/tox/session/env_select.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def __init__(self, state: State) -> None:
125125
self.on_empty_fallback_py = True
126126
self._warned_about: set[str] = set() #: shared set of skipped environments that were already warned about
127127
self._state = state
128+
self._cli_envs: CliEnv | None = getattr(self._state.conf.options, "env", None)
128129
self._defined_envs_: None | dict[str, _ToxEnvInfo] = None
129130
self._pkg_env_counter: Counter[str] = Counter()
130131
from tox.plugin.manager import MANAGER
@@ -138,10 +139,6 @@ def __init__(self, state: State) -> None:
138139
tox_env_filter_regex = getattr(state.conf.options, "skip_env", "").strip()
139140
self._filter_re = re.compile(tox_env_filter_regex) if tox_env_filter_regex else None
140141

141-
@property
142-
def _cli_envs(self) -> CliEnv | None:
143-
return getattr(self._state.conf.options, "env", None)
144-
145142
def _collect_names(self) -> Iterator[tuple[Iterable[str], bool]]:
146143
""":return: sources of tox environments defined with name and if is marked as target to run"""
147144
if self._provision is not None: # pragma: no branch

tests/session/cmd/test_legacy.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,26 @@ def test_legacy_list_all(tox_project: ToxProjectCreator, mocker: MockerFixture,
7878
assert outcome.state.conf.options.show_core is False
7979

8080

81-
@pytest.mark.parametrize("args", [(), ("-e", "py")])
81+
@pytest.mark.parametrize(
82+
"args",
83+
[
84+
pytest.param((), id="empty"),
85+
pytest.param(("-e", "py"), id="select"),
86+
],
87+
)
8288
def test_legacy_devenv(
8389
tox_project: ToxProjectCreator,
8490
mocker: MockerFixture,
8591
tmp_path: Path,
8692
args: tuple[str, ...],
8793
) -> None:
88-
devenv = mocker.patch("tox.session.cmd.legacy.devenv")
89-
into = tmp_path / "b"
90-
91-
outcome = tox_project({"tox.ini": ""}).run("le", "--devenv", str(into), *args)
94+
run_sequential = mocker.patch("tox.session.cmd.devenv.run_sequential")
95+
outcome = tox_project({"tox.ini": ""}).run("le", "--devenv", str(tmp_path / "b"), *args)
9296

9397
outcome.state.envs.ensure_only_run_env_is_active()
9498

95-
assert devenv.call_count == 1
99+
assert run_sequential.call_count == 1
96100
assert set(outcome.state.conf.options.env) == {"py"}
97-
assert outcome.state.conf.options.devenv_path == into
98101

99102

100103
def test_legacy_run_parallel(tox_project: ToxProjectCreator, mocker: MockerFixture) -> None:

tests/session/test_env_select.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
import pytest
44

5-
from tox.config.cli.parse import get_options
65
from tox.pytest import MonkeyPatch, ToxProjectCreator
7-
from tox.session.env_select import CliEnv, EnvSelector
8-
from tox.session.state import State
96

107

118
def test_label_core_can_define(tox_project: ToxProjectCreator) -> None:
@@ -120,11 +117,3 @@ def test_tox_skip_env_logs(tox_project: ToxProjectCreator, monkeypatch: MonkeyPa
120117
outcome = project.run("l", "--no-desc")
121118
outcome.assert_success()
122119
outcome.assert_out_err("ROOT: skip environment mypy, matches filter 'm[y]py'\npy310\npy39\n", "")
123-
124-
125-
def test_env_select_lazily_looks_at_envs() -> None:
126-
state = State(get_options(), [])
127-
env_selector = EnvSelector(state)
128-
# late-assigning env should be reflected in env_selector
129-
state.conf.options.env = CliEnv("py")
130-
assert set(env_selector.iter()) == {"py"}

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ commands =
4141
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
4242
skip_install = true
4343
deps =
44-
pre-commit>=3.2.2
44+
pre-commit>=3.3.2
4545
pass_env =
4646
{[testenv]passenv}
4747
PROGRAMDATA
@@ -52,9 +52,9 @@ commands =
5252
[testenv:type]
5353
description = run type check on code base
5454
deps =
55-
mypy==1.2
55+
mypy==1.3
5656
types-cachetools>=5.3.0.5
57-
types-chardet>=5.0.4.3
57+
types-chardet>=5.0.4.6
5858
commands =
5959
mypy src/tox
6060
mypy tests

0 commit comments

Comments
 (0)