mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Add an integration test of installing a project with a local PEP 517 backend
This commit is contained in:
parent
400cf8d71e
commit
59550aaec3
5 changed files with 40 additions and 0 deletions
15
tests/data/packages/pep517_wrapper_buildsys/mybuildsys.py
Normal file
15
tests/data/packages/pep517_wrapper_buildsys/mybuildsys.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
import os
|
||||
|
||||
from setuptools.build_meta import build_sdist
|
||||
from setuptools.build_meta import build_wheel as setuptools_build_wheel
|
||||
from setuptools.build_meta import (get_requires_for_build_sdist,
|
||||
get_requires_for_build_wheel,
|
||||
prepare_metadata_for_build_wheel)
|
||||
|
||||
|
||||
def build_wheel(*a, **kw):
|
||||
# Create the marker file to record that the hook was called
|
||||
with open(os.environ['PIP_TEST_MARKER_FILE'], 'wb'):
|
||||
pass
|
||||
|
||||
return setuptools_build_wheel(*a, **kw)
|
|
@ -0,0 +1,4 @@
|
|||
[build-system]
|
||||
requires = [ "setuptools" ]
|
||||
build-backend = "mybuildsys" # setuptools.build_meta
|
||||
backend-path = ["."]
|
3
tests/data/packages/pep517_wrapper_buildsys/setup.cfg
Normal file
3
tests/data/packages/pep517_wrapper_buildsys/setup.cfg
Normal file
|
@ -0,0 +1,3 @@
|
|||
[metadata]
|
||||
name = pep517-wrapper-buildsys
|
||||
version = 1.0
|
3
tests/data/packages/pep517_wrapper_buildsys/setup.py
Normal file
3
tests/data/packages/pep517_wrapper_buildsys/setup.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup()
|
|
@ -1339,6 +1339,21 @@ def test_install_no_binary_builds_pep_517_wheel(script, data, with_wheel):
|
|||
assert "Running setup.py install for pep517-set" not in str(res), str(res)
|
||||
|
||||
|
||||
@pytest.mark.network
|
||||
def test_install_no_binary_uses_local_backend(
|
||||
script, data, with_wheel, tmpdir):
|
||||
to_install = data.packages.joinpath('pep517_wrapper_buildsys')
|
||||
script.environ['PIP_TEST_MARKER_FILE'] = marker = str(tmpdir / 'marker')
|
||||
res = script.pip(
|
||||
'install', '--no-binary=:all:', '-f', data.find_links, to_install
|
||||
)
|
||||
expected = "Successfully installed pep517-wrapper-buildsys"
|
||||
# Must have installed the package
|
||||
assert expected in str(res), str(res)
|
||||
|
||||
assert os.path.isfile(marker), "Local PEP 517 backend not used"
|
||||
|
||||
|
||||
def test_install_no_binary_disables_cached_wheels(script, data, with_wheel):
|
||||
# Seed the cache
|
||||
script.pip(
|
||||
|
|
Loading…
Reference in a new issue