Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f9366da
Remove setup.py develop code path
sbidoul Mar 8, 2025
cafa715
Remove legacy editable tests
sbidoul May 10, 2025
aed7024
Refactor get_created_direct_url test
sbidoul May 18, 2025
8add656
Rework PipTestResult for detection of modern editables
sbidoul May 18, 2025
50804ff
Update tests that were looking for egg-link files to detect editables
sbidoul May 10, 2025
85bb55a
Test there is no fallback when backend has no PEP 660
sbidoul Sep 27, 2025
3cc9e6b
Update uninstall tests that depend on legacy install methods
sbidoul Sep 27, 2025
4eda5e4
Update pip show test that depends on legacy install method
sbidoul Sep 27, 2025
674df32
Remove non PEP 517 code paths
sbidoul Sep 28, 2025
90fa35d
Remove --use-pep517 option test
sbidoul Sep 28, 2025
0dbd25e
Remove --no-use-pep517 test
sbidoul Sep 28, 2025
05e53ef
Update creation of test package that must fail building
sbidoul Sep 28, 2025
fe02d65
Run unit tests with no build isolation
sbidoul Sep 28, 2025
873a1c5
Remove tests that exercise --global-option
sbidoul Sep 28, 2025
017d5e6
Rework test that needed --global-option to use --config-setting
sbidoul Sep 28, 2025
0e07ba2
Test install pip without build isolation
sbidoul Sep 28, 2025
16b2601
Remove legacy 'setup.py clean' tests
sbidoul Sep 28, 2025
8fec3f0
Add --no-build-isolation to tests
sbidoul Sep 28, 2025
b3871c6
Add news
sbidoul Sep 27, 2025
6feecc2
Fix and expand PEP 660 detection
sbidoul Sep 28, 2025
893ab4b
Remove a few more obsolete pep517 things from the test suite
sbidoul Sep 29, 2025
5a17132
Docs: reflect removal of direct setup.py invocations
sbidoul Oct 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove a few more obsolete pep517 things from the test suite
  • Loading branch information
sbidoul committed Oct 21, 2025
commit 893ab4b2f63ec723a7f6c7cc988c0e936c1958e0
44 changes: 0 additions & 44 deletions tests/functional/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
ScriptFactory,
TestData,
TestPipResult,
create_basic_sdist_for_package,
create_really_basic_wheel,
)
from tests.lib.server import MockServer, file_response
Expand Down Expand Up @@ -1228,49 +1227,6 @@ def test_download_editable(
assert downloads[0].endswith(".zip")


def test_download_use_pep517_propagation(
script: PipTestEnvironment, tmpdir: Path, common_wheels: Path
) -> None:
"""
Check that --use-pep517 applies not just to the requirements specified
on the command line, but to their dependencies too.
"""

create_basic_sdist_for_package(script, "fake_proj", "1.0", depends=["fake_dep"])

# If --use-pep517 is in effect, then setup.py should be running in an isolated
# environment that doesn't have pip in it.
create_basic_sdist_for_package(
script,
"fake_dep",
"1.0",
setup_py_prelude=textwrap.dedent(
"""\
try:
import pip
except ImportError:
pass
else:
raise Exception(f"not running in isolation")
"""
),
)

download_dir = tmpdir / "download_dir"
script.pip(
"download",
f"--dest={download_dir}",
"--no-index",
f"--find-links={common_wheels}",
f"--find-links={script.scratch_path}",
"--use-pep517",
"fake_proj",
)

downloads = os.listdir(download_dir)
assert len(downloads) == 2


@pytest.fixture
def download_local_html_index(
script: PipTestEnvironment,
Expand Down
5 changes: 2 additions & 3 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,12 @@ def test_hashed_install_from_cache(
tmpdir,
) as reqs_file:
result = script.pip_install_local(
"--use-pep517", "--no-build-isolation", "-r", reqs_file.resolve()
"--no-build-isolation", "-r", reqs_file.resolve()
)
assert "Created wheel for simple2" in result.stdout
script.pip("uninstall", "simple2", "-y")
result = script.pip_install_local(
"--use-pep517", "--no-build-isolation", "-r", reqs_file.resolve()
"--no-build-isolation", "-r", reqs_file.resolve()
)
assert "Using cached simple2" in result.stdout
# now try with an invalid hash
Expand All @@ -819,7 +819,6 @@ def test_hashed_install_from_cache(
) as reqs_file:
script.pip("uninstall", "simple2", "-y")
result = script.pip_install_local(
"--use-pep517",
"--no-build-isolation",
"-r",
reqs_file.resolve(),
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_install_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def test_find_links_no_doctype(script: PipTestEnvironment, data: TestData) -> No
result = script.pip(
"install",
"simple==1.0",
"--use-pep517",
"--no-build-isolation",
"--no-index",
"--find-links",
Expand Down
20 changes: 1 addition & 19 deletions tests/unit/test_pep517.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,9 @@

import pytest

from pip._internal.exceptions import InstallationError, InvalidPyProjectBuildRequires
from pip._internal.exceptions import InvalidPyProjectBuildRequires
from pip._internal.req import InstallRequirement

from tests.lib import TestData


def test_use_pep517_rejects_setup_cfg_only(shared_data: TestData) -> None:
"""
Test that projects with setup.cfg but no pyproject.toml are rejected.
"""
src = shared_data.src.joinpath("pep517_setup_cfg_only")
req = InstallRequirement(None, None)
req.source_dir = os.fspath(src) # make req believe it has been unpacked
with pytest.raises(InstallationError) as e:
req.load_pyproject_toml()
err_msg = e.value.args[0]
assert (
"does not appear to be a Python project: "
"neither 'setup.py' nor 'pyproject.toml' found" in err_msg
)


@pytest.mark.parametrize(
"spec", [("./foo",), ("git+https://example.com/pkg@dev#egg=myproj",)]
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/test_wheel_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ class ReqMock:
link: Link | None = None
constraint: bool = False
source_dir: str | None = "/tmp/pip-install-123/pendulum"
use_pep517: bool = True
supports_pyproject_editable: bool = False


@pytest.mark.parametrize(
"req, expected",
[
(ReqMock(editable=True, use_pep517=False), False),
(ReqMock(editable=True, use_pep517=True), False),
(ReqMock(editable=True), False),
(ReqMock(source_dir=None), False),
(ReqMock(link=Link("git+https://g.c/org/repo")), False),
(ReqMock(link=Link("https://g.c/dist.tgz")), False),
Expand Down