summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_editable_install.py
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-11 22:12:07 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-11 22:12:07 +0100
commit32e18c05945541e899e15d71c66439aa0ddca88b (patch)
tree4cfe4399290c68d8bb17b1ef529f04f34c8ae952 /setuptools/tests/test_editable_install.py
parentc2397339d57db2e792cbc629d088f7ef091d271b (diff)
parent611f54ca354f874d342e16d498a882dd7ac5853f (diff)
downloadpython-setuptools-git-32e18c05945541e899e15d71c66439aa0ddca88b.tar.gz
Fix issue with editable install and single module distributions
Diffstat (limited to 'setuptools/tests/test_editable_install.py')
-rw-r--r--setuptools/tests/test_editable_install.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/setuptools/tests/test_editable_install.py b/setuptools/tests/test_editable_install.py
index 40a35f65..8ab17b3c 100644
--- a/setuptools/tests/test_editable_install.py
+++ b/setuptools/tests/test_editable_install.py
@@ -163,6 +163,35 @@ def test_editable_with_flat_layout(tmp_path, venv, editable_opts):
assert subprocess.check_output(cmd).strip() == b"4 2"
+def test_editable_with_single_module(tmp_path, venv, editable_opts):
+ files = {
+ "mypkg": {
+ "pyproject.toml": dedent("""\
+ [build-system]
+ requires = ["setuptools", "wheel"]
+ build-backend = "setuptools.build_meta"
+
+ [project]
+ name = "mod"
+ version = "3.14159"
+
+ [tool.setuptools]
+ py-modules = ["mod"]
+ """),
+ "mod.py": "b = 2",
+ },
+ }
+ jaraco.path.build(files, prefix=tmp_path)
+ project = tmp_path / "mypkg"
+
+ cmd = [venv.exe(), "-m", "pip", "install",
+ "--no-build-isolation", # required to force current version of setuptools
+ "-e", str(project), *editable_opts]
+ print(str(subprocess.check_output(cmd), "utf-8"))
+ cmd = [venv.exe(), "-c", "import mod; print(mod.b)"]
+ assert subprocess.check_output(cmd).strip() == b"2"
+
+
class TestLegacyNamespaces:
"""Ported from test_develop"""