Imported Upstream version 50.0.3 upstream/50.0.3
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:08:40 +0000 (07:08 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:08:40 +0000 (07:08 +0900)
.bumpversion.cfg
CHANGES.rst
docs/conf.py
setup.cfg
setuptools/_distutils/command/build_ext.py
setuptools/_distutils/command/py37compat.py [new file with mode: 0644]

index e2973162e88f2e5b369a2c01f00d816a0dd03e0f..e85c79bbc6965007e0ab66f74b085600052c0428 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 50.0.2
+current_version = 50.0.3
 commit = True
 tag = True
 
index 435a7b4699bdd9030219214be0d43eb018791926..8f192618c755df6ec940f82e5596ceb1e68ea11f 100644 (file)
@@ -1,3 +1,9 @@
+v50.0.3
+-------
+
+* #2363: Restore link_libpython support on Python 3.7 and earlier (see pypa/distutils#9).
+
+
 v50.0.2
 -------
 
index b92b50cccfe56ff33b3cbf49f8049fcccc305e6a..12520586cdb033208045525911e4de010de76f9e 100644 (file)
@@ -101,7 +101,7 @@ link_files = {
                 url='http://bugs.jython.org/issue{jython}',
             ),
             dict(
-                pattern=r'Python #(?P<python>\d+)',
+                pattern=r'(Python #|bpo-)(?P<python>\d+)',
                 url='http://bugs.python.org/issue{python}',
             ),
             dict(
@@ -128,6 +128,10 @@ link_files = {
                 pattern=r'setuptools_svn #(?P<setuptools_svn>\d+)',
                 url='{GH}/jaraco/setuptools_svn/issues/{setuptools_svn}',
             ),
+            dict(
+                pattern=r'pypa/distutils#(?P<distutils>\d+)',
+                url='{GH}/pypa/distutils/issues/{distutils}',
+            ),
             dict(
                 pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
                 with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
index 0101bb868358d657c18ef14321ed138020c24058..7236ae40f7298e3828bb4b7b41f13a5edfa0a7de 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,7 @@ formats = zip
 
 [metadata]
 name = setuptools
-version = 50.0.2
+version = 50.0.3
 description = Easily download, build, install, upgrade, and uninstall Python packages
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
index 1a9bd1200f82358c5a758c69c433bb55621e157e..bbb348331b23db89fad540979b9749b76c94eff2 100644 (file)
@@ -16,6 +16,7 @@ from distutils.dep_util import newer_group
 from distutils.extension import Extension
 from distutils.util import get_platform
 from distutils import log
+from . import py37compat
 
 from site import USER_BASE
 
@@ -751,4 +752,4 @@ class build_ext(Command):
                 ldversion = get_config_var('LDVERSION')
                 return ext.libraries + ['python' + ldversion]
 
-        return ext.libraries
+        return ext.libraries + py37compat.pythonlib()
diff --git a/setuptools/_distutils/command/py37compat.py b/setuptools/_distutils/command/py37compat.py
new file mode 100644 (file)
index 0000000..754715a
--- /dev/null
@@ -0,0 +1,30 @@
+import sys
+
+
+def _pythonlib_compat():
+    """
+    On Python 3.7 and earlier, distutils would include the Python
+    library. See pypa/distutils#9.
+    """
+    from distutils import sysconfig
+    if not sysconfig.get_config_var('Py_ENABLED_SHARED'):
+        return
+
+    yield 'python{}.{}{}'.format(
+        sys.hexversion >> 24,
+        (sys.hexversion >> 16) & 0xff,
+        sysconfig.get_config_var('ABIFLAGS'),
+    )
+
+
+def compose(f1, f2):
+    return lambda *args, **kwargs: f1(f2(*args, **kwargs))
+
+
+pythonlib = (
+    compose(list, _pythonlib_compat)
+    if sys.version_info < (3, 8)
+    and sys.platform != 'darwin'
+    and sys.platform[:3] != 'aix'
+    else list
+)