Skip to content

Commit b5df17d

Browse files
authored
Merge pull request #199 from dmtucker/xdist1.x
Drop support for xdist 1.x
2 parents 31eaf09 + 185d65a commit b5df17d

2 files changed

Lines changed: 17 additions & 26 deletions

File tree

src/pytest_mypy/__init__.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,26 +118,18 @@ def pytest_addoption(parser: pytest.Parser) -> None:
118118

119119
def _xdist_worker(config: pytest.Config) -> Dict[str, Any]:
120120
try:
121-
return {"input": _xdist_workerinput(config)}
121+
# xdist.remote defines the workerinput attribute in worker processes.
122+
return {"input": config.workerinput} # type: ignore[attr-defined]
122123
except AttributeError:
123124
return {}
124125

125126

126-
def _xdist_workerinput(node: Union[WorkerController, pytest.Config]) -> Any:
127-
try:
128-
# mypy complains that pytest.Config does not have this attribute,
129-
# but xdist.remote defines it in worker processes.
130-
return node.workerinput # type: ignore[union-attr]
131-
except AttributeError: # compat xdist < 2.0
132-
return node.slaveinput # type: ignore[union-attr]
133-
134-
135127
class MypyXdistControllerPlugin:
136128
"""A plugin that is only registered on xdist controller processes."""
137129

138130
def pytest_configure_node(self, node: WorkerController) -> None:
139131
"""Pass the config stash to workers."""
140-
_xdist_workerinput(node)["mypy_config_stash_serialized"] = node.config.stash[
132+
node.workerinput["mypy_config_stash_serialized"] = node.config.stash[
141133
stash_key["config"]
142134
].serialized()
143135

tox.ini

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
minversion = 4.4
44
isolated_build = true
55
envlist =
6-
py38-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
7-
py39-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
8-
py310-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
9-
py311-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
10-
py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
11-
py313-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
12-
py314-pytest{9.0, 9.x}-mypy{2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
6+
py38-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{2.0, 2.x, 3.0, 3.x}
7+
py39-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{2.0, 2.x, 3.0, 3.x}
8+
py310-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
9+
py311-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
10+
py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
11+
py313-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
12+
py314-pytest{9.0, 9.x}-mypy{2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
1313
static
1414
publish
1515

1616
[gh-actions]
1717
python =
18-
3.8: py38-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
19-
3.9: py39-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
20-
3.10: py310-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
21-
3.11: py311-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
22-
3.12: py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}, static, publish
23-
3.13: py313-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
24-
3.14: py314-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}
18+
3.8: py38-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{2.0, 2.x, 3.0, 3.x}
19+
3.9: py39-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{2.0, 2.x, 3.0, 3.x}
20+
3.10: py310-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
21+
3.11: py311-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
22+
3.12: py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}, static, publish
23+
3.13: py313-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
24+
3.14: py314-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{2.0, 2.x, 3.0, 3.x}
2525

2626
[testenv]
2727
constrain_package_deps = true
@@ -36,7 +36,6 @@ deps =
3636
mypy1.x: mypy ~= 1.0
3737
mypy2.0: mypy ~= 2.0.0
3838
mypy2.x: mypy ~= 2.0
39-
xdist1.x: pytest-xdist ~= 1.0
4039
xdist2.0: pytest-xdist ~= 2.0.0
4140
xdist2.x: pytest-xdist ~= 2.0
4241
xdist3.0: pytest-xdist ~= 3.0.0

0 commit comments

Comments
 (0)