summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-15 21:02:08 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-15 21:02:08 +0100
commitbc68a60192ef5f54f8fc36c5d776f6dbabd6c1a2 (patch)
tree512ece8b5da12318e74541d4430f20da4fc54ed1 /setuptools/tests
parentb5b195a4a21bfa49b32a5c0aa73237aa3ec74736 (diff)
parent01b8529d39d97e46367a29f7bcca5a9ab0ef5f47 (diff)
downloadpython-setuptools-git-bc68a60192ef5f54f8fc36c5d776f6dbabd6c1a2.tar.gz
Fix build_meta when metadata_directory=='.' (#3528)
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_build_meta.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index e70c71bd..bf1c27ff 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -485,6 +485,23 @@ class TestBuildMetaBackend:
assert os.path.isfile(os.path.join(dist_dir, dist_info, 'METADATA'))
+ def test_prepare_metadata_inplace(self, build_backend):
+ """
+ Some users might pass metadata_directory pre-populated with `.tox` or `.venv`.
+ See issue #3523.
+ """
+ for pre_existing in [
+ ".tox/python/lib/python3.10/site-packages/attrs-22.1.0.dist-info",
+ ".tox/python/lib/python3.10/site-packages/autocommand-2.2.1.dist-info",
+ ".nox/python/lib/python3.10/site-packages/build-0.8.0.dist-info",
+ ".venv/python3.10/site-packages/click-8.1.3.dist-info",
+ "venv/python3.10/site-packages/distlib-0.3.5.dist-info",
+ "env/python3.10/site-packages/docutils-0.19.dist-info",
+ ]:
+ os.makedirs(pre_existing, exist_ok=True)
+ dist_info = build_backend.prepare_metadata_for_build_wheel(".")
+ assert os.path.isfile(os.path.join(dist_info, 'METADATA'))
+
def test_build_sdist_explicit_dist(self, build_backend):
# explicitly specifying the dist folder should work
# the folder sdist_directory and the ``--dist-dir`` can be the same