summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-11 22:13:08 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-11 22:13:08 +0100
commitd3167b675cd54370a298ab90c255f2efc72f25c3 (patch)
tree0e2f52dfccbd9722d703e58da427c9dbf4bfd2d7 /setuptools/tests
parent5bc39a30e051111675043b1dbafe7d012d244dfa (diff)
parente2fb005beed79dba58ec0ecfa9bcdadf03d6666a (diff)
downloadpython-setuptools-git-d3167b675cd54370a298ab90c255f2efc72f25c3.tar.gz
Prevent errors in editable install and external ``.egg-info`` (#3503)
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_editable_install.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/setuptools/tests/test_editable_install.py b/setuptools/tests/test_editable_install.py
index 8ab17b3c..ea31cb46 100644
--- a/setuptools/tests/test_editable_install.py
+++ b/setuptools/tests/test_editable_install.py
@@ -721,6 +721,43 @@ def test_compat_install(tmp_path, venv):
assert "cannot import name 'subpackage'" in out
+def test_pbr_integration(tmp_path, venv, editable_opts):
+ """Ensure editable installs work with pbr, issue #3500"""
+ files = {
+ "pyproject.toml": dedent("""\
+ [build-system]
+ requires = ["setuptools"]
+ build-backend = "setuptools.build_meta"
+ """),
+ "setup.py": dedent("""\
+ __import__('setuptools').setup(
+ pbr=True,
+ setup_requires=["pbr"],
+ )
+ """),
+ "setup.cfg": dedent("""\
+ [metadata]
+ name = mypkg
+
+ [files]
+ packages =
+ mypkg
+ """),
+ "mypkg": {
+ "__init__.py": "",
+ "hello.py": "print('Hello world!')",
+ },
+ "other": {"test.txt": "Another file in here."},
+ }
+ venv.run(["python", "-m", "pip", "install", "pbr"])
+
+ with contexts.environment(PBR_VERSION="0.42"):
+ install_project("mypkg", venv, tmp_path, files, *editable_opts)
+
+ out = venv.run(["python", "-c", "import mypkg.hello"])
+ assert b"Hello world!" in out
+
+
def install_project(name, venv, tmp_path, files, *opts):
project = tmp_path / name
project.mkdir()