Skip to content

Commit 0778672

Browse files
committed
Add test to reproduce issue pypa#10222
1 parent bbc7021 commit 0778672

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/functional/test_install.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,45 @@ def test_editable_install__local_dir_setup_requires_with_pyproject(
788788
script.pip("install", "--find-links", shared_data.find_links, "-e", local_dir)
789789

790790

791+
def test_install_pre__setup_requires_with_pyproject(
792+
script: PipTestEnvironment, shared_data: TestData, common_wheels: Path
793+
) -> None:
794+
"""
795+
Test installing with a pre-release build dependency declared in both
796+
setup.py and pyproject.toml.
797+
798+
https://github.com/pypa/pip/issues/10573
799+
"""
800+
depends_package = "prerelease_dependency"
801+
depends_path = create_basic_wheel_for_package(script, depends_package, "1.0.0a1")
802+
803+
local_dir = script.scratch_path.joinpath("temp")
804+
local_dir.mkdir()
805+
pyproject_path = local_dir.joinpath("pyproject.toml")
806+
pyproject_path.write_text(
807+
"[build-system]\n"
808+
f'requires = ["setuptools", "wheel", "{depends_package}"]\n'
809+
'build-backend = "setuptools.build_meta"\n'
810+
)
811+
setup_py_path = local_dir.joinpath("setup.py")
812+
setup_py_path.write_text(
813+
"from setuptools import setup\n"
814+
f"setup(name='dummy', setup_requires=['{depends_package}'])\n"
815+
)
816+
817+
script.pip(
818+
"install",
819+
"--pre",
820+
"--no-cache-dir",
821+
"--no-index",
822+
"--find-links",
823+
common_wheels,
824+
"--find-links",
825+
depends_path.parent,
826+
local_dir,
827+
)
828+
829+
791830
@pytest.mark.network
792831
def test_upgrade_argparse_shadowed(script: PipTestEnvironment) -> None:
793832
# If argparse is installed - even if shadowed for imported - we support

0 commit comments

Comments
 (0)