Imported Upstream version 54.1.3 upstream/54.1.3
authorJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:32 +0000 (17:02 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:32 +0000 (17:02 +0900)
.bumpversion.cfg
.coveragerc
CHANGES.rst
setup.cfg
setuptools/tests/fixtures.py
setuptools/tests/test_develop.py

index 2c0c640ec07f933e2893b5d3930e7389dcbb4176..89f47f621d86041e60116098a98da75d9239065f 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 54.1.2
+current_version = 54.1.3
 commit = True
 tag = True
 
index 45823064a3c8d2d514d49a92817ac9bbf38992d6..6a34e662d391e5d273f91eac3c0a6983ed7d718f 100644 (file)
@@ -1,5 +1,7 @@
 [run]
-omit = .tox/*
+omit =
+       # leading `*/` for pytest-dev/pytest-cov#456
+       */.tox/*
 
 [report]
 show_missing = True
index c8db71ee59d464921b1c9f0d87d700eb0b16b9a6..8612991a41209ff83763e1fe663ee762adc94bb1 100644 (file)
@@ -1,3 +1,9 @@
+v54.1.3
+-------
+
+No significant changes.
+
+
 v54.1.2
 -------
 
index 2c4cb02fbb9e1df51e7a67947ec451fbab6a1048..b3e5bb8adf2d8506bcc61e76c6527173b3a0ef8a 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,7 +2,7 @@
 license_files =
        LICENSE
 name = setuptools
-version = 54.1.2
+version = 54.1.3
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
 description = Easily download, build, install, upgrade, and uninstall Python packages
index d74b5f031ac6285dca898d825febecd694825fda..a5a172e0f98aba374f3edc3db79cc83d17340c5e 100644 (file)
@@ -1,6 +1,7 @@
 import contextlib
 import sys
 import shutil
+import subprocess
 
 import pytest
 
@@ -58,3 +59,16 @@ def workaround_xdist_376(request):
 
     with contextlib.suppress(ValueError):
         sys.path.remove('')
+
+
+@pytest.fixture
+def sample_project(tmp_path):
+    """
+    Clone the 'sampleproject' and return a path to it.
+    """
+    cmd = ['git', 'clone', 'https://github.com/pypa/sampleproject']
+    try:
+        subprocess.check_call(cmd, cwd=str(tmp_path))
+    except Exception:
+        pytest.skip("Unable to clone sampleproject")
+    return tmp_path / 'sampleproject'
index 2766da2f79ec2b9f2b1560750e3c9f52bb53a7da..df8db4e28105a65f6e57212b7536f25d27944a51 100644 (file)
@@ -7,6 +7,8 @@ import sys
 import io
 import subprocess
 import platform
+import pathlib
+import textwrap
 
 from setuptools.command import test
 
@@ -199,3 +201,55 @@ class TestNamespaces:
         ]
         with test.test.paths_on_pythonpath([str(target)]):
             subprocess.check_call(pkg_resources_imp)
+
+    @staticmethod
+    def install_workaround(site_packages):
+        site_packages.mkdir(parents=True)
+        sc = site_packages / 'sitecustomize.py'
+        sc.write_text(textwrap.dedent("""
+            import site
+            import pathlib
+            here = pathlib.Path(__file__).parent
+            site.addsitedir(str(here))
+            """).lstrip())
+
+    @pytest.mark.xfail(
+        platform.python_implementation() == 'PyPy',
+        reason="Workaround fails on PyPy (why?)",
+    )
+    def test_editable_prefix(self, tmp_path, sample_project):
+        """
+        Editable install to a prefix should be discoverable.
+        """
+        prefix = tmp_path / 'prefix'
+        prefix.mkdir()
+
+        # figure out where pip will likely install the package
+        site_packages = prefix / next(
+            pathlib.Path(path).relative_to(sys.prefix)
+            for path in sys.path
+            if 'site-packages' in path
+            and path.startswith(sys.prefix)
+        )
+
+        # install the workaround
+        self.install_workaround(site_packages)
+
+        env = dict(os.environ, PYTHONPATH=str(site_packages))
+        cmd = [
+            sys.executable,
+            '-m', 'pip',
+            'install',
+            '--editable',
+            str(sample_project),
+            '--prefix', str(prefix),
+            '--no-build-isolation',
+        ]
+        subprocess.check_call(cmd, env=env)
+
+        # now run 'sample' with the prefix on the PYTHONPATH
+        bin = 'Scripts' if platform.system() == 'Windows' else 'bin'
+        exe = prefix / bin / 'sample'
+        if sys.version_info < (3, 7) and platform.system() == 'Windows':
+            exe = str(exe)
+        subprocess.check_call([exe], env=env)