add a couple of additional PEP 517 tests
@@ -4,6 +4,7 @@ from pip._internal.build_env import BuildEnvironment
from pip._internal.download import PipSession
from pip._internal.index import PackageFinder
from pip._internal.req import InstallRequirement
+from tests.lib import path_to_url
def make_project(tmpdir, requires=[], backend=None):
@@ -72,3 +73,39 @@ def test_no_use_pep517_without_setup_py(script, tmpdir, data):
expect_error=True
)
assert 'project does not have a setup.py' in result.stderr
+
+
+def test_conflicting_pep517_backend_requirements(script, tmpdir, data):
+ project_dir = make_project(
+ tmpdir, requires=['test_backend', 'simplewheel==1.0'],
+ backend="test_backend"
+ )
+ project_dir.join("backend_reqs.txt").write("simplewheel==2.0")
+ result = script.pip(
+ 'install', '--no-index',
+ '-f', data.backends,
+ '-f', data.packages,
+ project_dir,
+ expect_error=True
+ )
+ assert (
+ result.returncode != 0 and
+ ('Some build dependencies for %s conflict with the backend '
+ 'dependencies: simplewheel==1.0 is incompatible with '
+ 'simplewheel==2.0.' % path_to_url(project_dir)) in result.stderr
+ ), str(result)
+
+
+def test_pep517_backend_requirements_already_satisfied(script, tmpdir, data):
+ project_dir = make_project(
+ tmpdir, requires=['test_backend', 'simplewheel==1.0'],
+ backend="test_backend"
+ )
+ project_dir.join("backend_reqs.txt").write("simplewheel")
+ result = script.pip(
+ 'install', '--no-index',
+ '-f', data.backends,
+ '-f', data.packages,
+ project_dir,
+ )
+ assert 'Installing backend dependencies:' not in result.stdout
