Skip to content

Commit aaed08e

Browse files
committed
Remove a few more obsolete pep517 things from the test suite
1 parent 3b2bc9e commit aaed08e

File tree

5 files changed

+4
-70
lines changed

5 files changed

+4
-70
lines changed

tests/functional/test_download.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
ScriptFactory,
1818
TestData,
1919
TestPipResult,
20-
create_basic_sdist_for_package,
2120
create_really_basic_wheel,
2221
)
2322
from tests.lib.server import MockServer, file_response
@@ -1228,49 +1227,6 @@ def test_download_editable(
12281227
assert downloads[0].endswith(".zip")
12291228

12301229

1231-
def test_download_use_pep517_propagation(
1232-
script: PipTestEnvironment, tmpdir: Path, common_wheels: Path
1233-
) -> None:
1234-
"""
1235-
Check that --use-pep517 applies not just to the requirements specified
1236-
on the command line, but to their dependencies too.
1237-
"""
1238-
1239-
create_basic_sdist_for_package(script, "fake_proj", "1.0", depends=["fake_dep"])
1240-
1241-
# If --use-pep517 is in effect, then setup.py should be running in an isolated
1242-
# environment that doesn't have pip in it.
1243-
create_basic_sdist_for_package(
1244-
script,
1245-
"fake_dep",
1246-
"1.0",
1247-
setup_py_prelude=textwrap.dedent(
1248-
"""\
1249-
try:
1250-
import pip
1251-
except ImportError:
1252-
pass
1253-
else:
1254-
raise Exception(f"not running in isolation")
1255-
"""
1256-
),
1257-
)
1258-
1259-
download_dir = tmpdir / "download_dir"
1260-
script.pip(
1261-
"download",
1262-
f"--dest={download_dir}",
1263-
"--no-index",
1264-
f"--find-links={common_wheels}",
1265-
f"--find-links={script.scratch_path}",
1266-
"--use-pep517",
1267-
"fake_proj",
1268-
)
1269-
1270-
downloads = os.listdir(download_dir)
1271-
assert len(downloads) == 2
1272-
1273-
12741230
@pytest.fixture
12751231
def download_local_html_index(
12761232
script: PipTestEnvironment,

tests/functional/test_install.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,12 +804,12 @@ def test_hashed_install_from_cache(
804804
tmpdir,
805805
) as reqs_file:
806806
result = script.pip_install_local(
807-
"--use-pep517", "--no-build-isolation", "-r", reqs_file.resolve()
807+
"--no-build-isolation", "-r", reqs_file.resolve()
808808
)
809809
assert "Created wheel for simple2" in result.stdout
810810
script.pip("uninstall", "simple2", "-y")
811811
result = script.pip_install_local(
812-
"--use-pep517", "--no-build-isolation", "-r", reqs_file.resolve()
812+
"--no-build-isolation", "-r", reqs_file.resolve()
813813
)
814814
assert "Using cached simple2" in result.stdout
815815
# now try with an invalid hash
@@ -819,7 +819,6 @@ def test_hashed_install_from_cache(
819819
) as reqs_file:
820820
script.pip("uninstall", "simple2", "-y")
821821
result = script.pip_install_local(
822-
"--use-pep517",
823822
"--no-build-isolation",
824823
"-r",
825824
reqs_file.resolve(),

tests/functional/test_install_index.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def test_find_links_no_doctype(script: PipTestEnvironment, data: TestData) -> No
2828
result = script.pip(
2929
"install",
3030
"simple==1.0",
31-
"--use-pep517",
3231
"--no-build-isolation",
3332
"--no-index",
3433
"--find-links",

tests/unit/test_pep517.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,9 @@
44

55
import pytest
66

7-
from pip._internal.exceptions import InstallationError, InvalidPyProjectBuildRequires
7+
from pip._internal.exceptions import InvalidPyProjectBuildRequires
88
from pip._internal.req import InstallRequirement
99

10-
from tests.lib import TestData
11-
12-
13-
def test_use_pep517_rejects_setup_cfg_only(shared_data: TestData) -> None:
14-
"""
15-
Test that projects with setup.cfg but no pyproject.toml are rejected.
16-
"""
17-
src = shared_data.src.joinpath("pep517_setup_cfg_only")
18-
req = InstallRequirement(None, None)
19-
req.source_dir = os.fspath(src) # make req believe it has been unpacked
20-
with pytest.raises(InstallationError) as e:
21-
req.load_pyproject_toml()
22-
err_msg = e.value.args[0]
23-
assert (
24-
"does not appear to be a Python project: "
25-
"neither 'setup.py' nor 'pyproject.toml' found" in err_msg
26-
)
27-
2810

2911
@pytest.mark.parametrize(
3012
"spec", [("./foo",), ("git+https://example.com/pkg@dev#egg=myproj",)]

tests/unit/test_wheel_builder.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ class ReqMock:
4141
link: Link | None = None
4242
constraint: bool = False
4343
source_dir: str | None = "/tmp/pip-install-123/pendulum"
44-
use_pep517: bool = True
4544
supports_pyproject_editable: bool = False
4645

4746

4847
@pytest.mark.parametrize(
4948
"req, expected",
5049
[
51-
(ReqMock(editable=True, use_pep517=False), False),
52-
(ReqMock(editable=True, use_pep517=True), False),
50+
(ReqMock(editable=True), False),
5351
(ReqMock(source_dir=None), False),
5452
(ReqMock(link=Link("git+https://g.c/org/repo")), False),
5553
(ReqMock(link=Link("https://g.c/dist.tgz")), False),

0 commit comments

Comments
 (0)