Skip to content

Commit

Permalink
Add test to reproduce issue pypa#10222
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Nov 29, 2021
1 parent 9cf35b2 commit fc26ecb
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,45 @@ def test_editable_install__local_dir_setup_requires_with_pyproject(
script.pip("install", "--find-links", shared_data.find_links, "-e", local_dir)


def test_install_pre__setup_requires_with_pyproject(
script: PipTestEnvironment, shared_data: TestData, common_wheels: Path
) -> None:
"""
Test installing with a pre-release build dependency declared in both
setup.py and pyproject.toml.
https://github.com/pypa/pip/issues/10573
"""
depends_package = "prerelease_dependency"
depends_path = create_basic_wheel_for_package(script, depends_package, "1.0.0a1")

local_dir = script.scratch_path.joinpath("temp")
local_dir.mkdir()
pyproject_path = local_dir.joinpath("pyproject.toml")
pyproject_path.write_text(
"[build-system]\n"
f'requires = ["setuptools", "wheel", "{depends_package}"]\n'
'build-backend = "setuptools.build_meta"\n'
)
setup_py_path = local_dir.joinpath("setup.py")
setup_py_path.write_text(
"from setuptools import setup\n"
f"setup(name='dummy', setup_requires=['{depends_package}'])\n"
)

script.pip(
"install",
"--pre",
"--no-cache-dir",
"--no-index",
"--find-links",
common_wheels,
"--find-links",
depends_path.parent,
local_dir,
)


@pytest.mark.network
def test_upgrade_argparse_shadowed(script: PipTestEnvironment) -> None:
# If argparse is installed - even if shadowed for imported - we support
Expand Down

0 comments on commit fc26ecb

Please sign in to comment.