Andreas Wacknitz
2024-03-24 3df02058fb3d48a999bbc8d5d56c2910fbc249a4
commit | author | age
0a4c16 1 We do not have devpi_process available (yet)
MT 2
5e351e 3 --- tox-4.14.2/pyproject.toml.orig
MT 4 +++ tox-4.14.2/pyproject.toml
0a4c16 5 @@ -74,7 +74,6 @@
e2fb2f 6    "build[virtualenv]>=1.0.3",
0a4c16 7    "covdefaults>=2.3",
e2fb2f 8    "detect-test-pollution>=1.2",
0a4c16 9 -  "devpi-process>=1",
e2fb2f 10    "diff-cover>=8.0.2",
MT 11    "distlib>=0.3.8",
0a4c16 12    "flaky>=3.7",
5e351e 13 --- tox-4.14.2/src/tox/pytest.py.orig
MT 14 +++ tox-4.14.2/src/tox/pytest.py
e2fb2f 15 @@ -17,7 +17,6 @@
0a4c16 16  
MT 17  import pytest
ebccc6 18  from _pytest.fixtures import SubRequest  # noqa: PLC2701
0a4c16 19 -from devpi_process import IndexServer
MT 20  from virtualenv.info import fs_supports_symlink
21  
22  import tox.run
23 @@ -473,15 +472,6 @@
24  
25  
26  @pytest.fixture(scope="session")
27 -def pypi_server(tmp_path_factory: pytest.TempPathFactory) -> Iterator[IndexServer]:
28 -    # takes around 2.5s
29 -    path = tmp_path_factory.mktemp("pypi")
30 -    with IndexServer(path) as server:
31 -        server.create_index("empty", "volatile=False")
32 -        yield server
33 -
34 -
35 -@pytest.fixture(scope="session")
36  def _invalid_index_fake_port() -> int:  # noqa: PT005
37      with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as socket_handler:
38          socket_handler.bind(("", 0))
5e351e 39 --- tox-4.14.2/tests/test_provision.py.orig
MT 40 +++ tox-4.14.2/tests/test_provision.py
0a4c16 41 @@ -16,8 +16,6 @@
MT 42  from packaging.requirements import Requirement
43  
44  if TYPE_CHECKING:
45 -    from devpi_process import Index, IndexServer
46 -
47      from tox.pytest import MonkeyPatch, TempPathFactory, ToxProjectCreator
48  
49  from importlib.metadata import Distribution
50 @@ -92,23 +90,6 @@
51          return result
52  
53  
54 -@pytest.fixture(scope="session")
55 -def pypi_index_self(pypi_server: IndexServer, tox_wheels: list[Path], demo_pkg_inline_wheel: Path) -> Index:
56 -    with elapsed("start devpi and create index"):  # takes around 1s
57 -        self_index = pypi_server.create_index("self", "volatile=False")
58 -    with elapsed("upload tox and its wheels to devpi"):  # takes around 3.2s on build
59 -        self_index.upload(*tox_wheels, demo_pkg_inline_wheel)
60 -    return self_index
61 -
62 -
63 -@pytest.fixture()
64 -def _pypi_index_self(pypi_index_self: Index, monkeypatch: MonkeyPatch) -> None:
65 -    pypi_index_self.use()
66 -    monkeypatch.setenv("PIP_INDEX_URL", pypi_index_self.url)
67 -    monkeypatch.setenv("PIP_RETRIES", str(2))
68 -    monkeypatch.setenv("PIP_TIMEOUT", str(5))
69 -
70 -
71  def test_provision_requires_nok(tox_project: ToxProjectCreator) -> None:
72      ini = "[tox]\nrequires = pkg-does-not-exist\n setuptools==1\nskipsdist=true\n"
73      outcome = tox_project({"tox.ini": ini}).run("c", "-e", "py")
5e351e 74 @@ -122,96 +103,6 @@
0a4c16 75  
MT 76  
77  @pytest.mark.integration()
78 -@pytest.mark.usefixtures("_pypi_index_self")
79 -def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -> None:
80 -    proj = tox_project({"tox.ini": "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip"})
81 -    log = tmp_path / "out.log"
82 -
83 -    # initial run
84 -    result_first = proj.run("r", "--result-json", str(log))
85 -    result_first.assert_success()
86 -    prov_msg = (
87 -        f"ROOT: will run in automatically provisioned tox, host {sys.executable} is missing"
88 -        f" [requires (has)]: demo-pkg-inline"
89 -    )
90 -    assert prov_msg in result_first.out
91 -
92 -    with log.open("rt") as file_handler:
93 -        log_report = json.load(file_handler)
94 -    assert "py" in log_report["testenvs"]
95 -
96 -    # recreate without recreating the provisioned env
97 -    provision_env = result_first.env_conf(".tox")["env_dir"]
98 -    result_recreate_no_pr = proj.run("r", "--recreate", "--no-recreate-provision")
99 -    result_recreate_no_pr.assert_success()
100 -    assert prov_msg in result_recreate_no_pr.out
101 -    assert f"ROOT: remove tox env folder {provision_env}" not in result_recreate_no_pr.out, result_recreate_no_pr.out
102 -
103 -    # recreate with recreating the provisioned env
104 -    result_recreate = proj.run("r", "--recreate")
105 -    result_recreate.assert_success()
106 -    assert prov_msg in result_recreate.out
107 -    assert f"ROOT: remove tox env folder {provision_env}" in result_recreate.out, result_recreate.out
108 -
109 -
110 -@pytest.mark.integration()
111 -@pytest.mark.usefixtures("_pypi_index_self")
112 -def test_provision_platform_check(tox_project: ToxProjectCreator) -> None:
113 -    ini = "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip\n[testenv:.tox]\nplatform=wrong_platform"
114 -    proj = tox_project({"tox.ini": ini})
115 -
116 -    result = proj.run("r")
117 -    result.assert_failed(-2)
118 -    msg = f"cannot provision tox environment .tox because platform {sys.platform} does not match wrong_platform"
119 -    assert msg in result.out
120 -
121 -
122 -def test_provision_no_recreate(tox_project: ToxProjectCreator) -> None:
123 -    ini = "[tox]\nrequires = p\nskipsdist=true\n"
124 -    result = tox_project({"tox.ini": ini}).run("c", "-e", "py", "--no-provision")
125 -    result.assert_failed()
126 -    assert f"provisioning explicitly disabled within {sys.executable}, but is missing [requires (has)]: p" in result.out
127 -
128 -
129 -def test_provision_no_recreate_json(tox_project: ToxProjectCreator) -> None:
130 -    ini = "[tox]\nrequires = p\nskipsdist=true\n"
131 -    project = tox_project({"tox.ini": ini})
132 -    result = project.run("c", "-e", "py", "--no-provision", "out.json")
133 -    result.assert_failed()
134 -    msg = (
135 -        f"provisioning explicitly disabled within {sys.executable}, "
136 -        f"but is missing [requires (has)]: p and wrote to out.json"
137 -    )
138 -    assert msg in result.out
139 -    with (project.path / "out.json").open() as file_handler:
140 -        requires = json.load(file_handler)
141 -    assert requires == {"minversion": None, "requires": ["p", "tox"]}
142 -
143 -
144 -@pytest.mark.integration()
145 -@pytest.mark.usefixtures("_pypi_index_self")
146 -@pytest.mark.parametrize("plugin_testenv", ["testenv", "testenv:a"])
147 -def test_provision_plugin_runner(tox_project: ToxProjectCreator, tmp_path: Path, plugin_testenv: str) -> None:
148 -    """Ensure that testenv runner doesn't affect the provision env."""
149 -    log = tmp_path / "out.log"
150 -    proj = tox_project(
151 -        {"tox.ini": f"[tox]\nrequires=demo-pkg-inline\nlabels=l=py\n[{plugin_testenv}]\nrunner=example"},
152 -    )
153 -    prov_msg = (
154 -        f"ROOT: will run in automatically provisioned tox, host {sys.executable} is missing"
155 -        f" [requires (has)]: demo-pkg-inline"
156 -    )
157 -
158 -    result_env = proj.run("r", "-e", "py", "--result-json", str(log))
159 -    result_env.assert_success()
160 -    assert prov_msg in result_env.out
161 -
162 -    result_label = proj.run("r", "-m", "l", "--result-json", str(log))
163 -    result_label.assert_success()
164 -    assert prov_msg in result_label.out
165 -
166 -
167 -@pytest.mark.integration()
168  def test_provision_plugin_runner_in_provision(tox_project: ToxProjectCreator, tmp_path: Path) -> None:
169      """Ensure that provision environment can be explicitly configured."""
170      log = tmp_path / "out.log"
5e351e 171 @@ -220,17 +111,6 @@
0a4c16 172          proj.run("r", "-e", "py", "--result-json", str(log))
5e351e 173  
MT 174  
0a4c16 175 -@pytest.mark.integration()
MT 176 -@pytest.mark.usefixtures("_pypi_index_self")
177 -@pytest.mark.parametrize("relative_path", [True, False], ids=["relative", "absolute"])
178 -def test_provision_conf_file(tox_project: ToxProjectCreator, tmp_path: Path, relative_path: bool) -> None:
179 -    ini = "[tox]\nrequires = demo-pkg-inline\nskipsdist=true\n"
180 -    project = tox_project({"tox.ini": ini}, prj_path=tmp_path / "sub")
181 -    conf_path = str(Path(project.path.name) / "tox.ini") if relative_path else str(project.path / "tox.ini")
182 -    result = project.run("c", "--conf", conf_path, "-e", "py", from_cwd=tmp_path)
183 -    result.assert_success()
5e351e 184 -
MT 185 -
186  @pytest.mark.parametrize("subcommand", ["r", "p", "de", "l", "d", "c", "q", "e", "le"])
187  def test_provision_default_arguments_exists(tox_project: ToxProjectCreator, subcommand: str) -> None:
188      ini = r"""
189 --- tox-4.14.2/PKG-INFO.orig
190 +++ tox-4.14.2/PKG-INFO
191 @@ -54,7 +54,6 @@
192  Requires-Dist: build[virtualenv]>=1.0.3; extra == 'testing'
193  Requires-Dist: covdefaults>=2.3; extra == 'testing'
194  Requires-Dist: detect-test-pollution>=1.2; extra == 'testing'
195 -Requires-Dist: devpi-process>=1; extra == 'testing'
196  Requires-Dist: diff-cover>=8.0.2; extra == 'testing'
197  Requires-Dist: distlib>=0.3.8; extra == 'testing'
198  Requires-Dist: flaky>=3.7; extra == 'testing'