Imported Upstream version 50.0.1 upstream/50.0.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:08:27 +0000 (07:08 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:08:27 +0000 (07:08 +0900)
.bumpversion.cfg
CHANGES.rst
_distutils_hack/__init__.py
setup.cfg
setuptools/_distutils/py35compat.py [new file with mode: 0644]
setuptools/_distutils/py38compat.py [new file with mode: 0644]
setuptools/_distutils/tests/py38compat.py
setuptools/_distutils/util.py
tox.ini

index a50c3badbf38d061117d2d7babf2551d96e75c5c..ebb58d3b1c76f6d8236cdfb695c65127d5c7b07c 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 50.0.0
+current_version = 50.0.1
 commit = True
 tag = True
 
index 9dd77e12fb3e3b034d275e427be9406c15a31dc7..0082b7f30b932beb92e47ebd5eb790bdf469933f 100644 (file)
@@ -1,3 +1,13 @@
+v50.0.1
+-------
+
+* #2357: Restored Python 3.5 support in distutils.util for missing `subprocess._optim_args_from_interpreter_flags`.
+* #2358: Restored AIX support on Python 3.8 and earlier.
+* #2361: Add Python 3.10 support to _distutils_hack. Get the 'Loader' abstract class
+  from importlib.abc rather than importlib.util.abc (alias removed in Python
+  3.10).
+
+
 v50.0.0
 -------
 
index 074bd5e9c88b9365df331031b1ce7d8deeeace60..b8410e1fc8783a43fc57c7d248f55e1740b8f161 100644 (file)
@@ -74,9 +74,10 @@ class DistutilsMetaFinder:
         return method()
 
     def spec_for_distutils(self):
+        import importlib.abc
         import importlib.util
 
-        class DistutilsLoader(importlib.util.abc.Loader):
+        class DistutilsLoader(importlib.abc.Loader):
 
             def create_module(self, spec):
                 return importlib.import_module('._distutils', 'setuptools')
index 577e23c135f9342c75646846d43e72741e38b6a2..71839ef1d76850dea7b1603e87cda105c0a77d67 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,7 @@ formats = zip
 
 [metadata]
 name = setuptools
-version = 50.0.0
+version = 50.0.1
 description = Easily download, build, install, upgrade, and uninstall Python packages
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
diff --git a/setuptools/_distutils/py35compat.py b/setuptools/_distutils/py35compat.py
new file mode 100644 (file)
index 0000000..79b2e7f
--- /dev/null
@@ -0,0 +1,19 @@
+import sys
+import subprocess
+
+
+def __optim_args_from_interpreter_flags():
+    """Return a list of command-line arguments reproducing the current
+    optimization settings in sys.flags."""
+    args = []
+    value = sys.flags.optimize
+    if value > 0:
+        args.append("-" + "O" * value)
+    return args
+
+
+_optim_args_from_interpreter_flags = getattr(
+    subprocess,
+    "_optim_args_from_interpreter_flags",
+    __optim_args_from_interpreter_flags,
+)
diff --git a/setuptools/_distutils/py38compat.py b/setuptools/_distutils/py38compat.py
new file mode 100644 (file)
index 0000000..7dbe8ce
--- /dev/null
@@ -0,0 +1,7 @@
+def aix_platform(osname, version, release):
+    try:
+        import _aix_support
+        return _aix_support.aix_platform()
+    except ImportError:
+        pass
+    return "%s-%s.%s" % (osname, version, release)
index 46ff575892bffcc3ef3bda8c387154e40a08c251..32269c7b93e2a5cc58c9afde6284dbd9d2ce685b 100644 (file)
@@ -1,6 +1,9 @@
 # flake8: noqa
 
 import contextlib
+import builtins
+
+ModuleNotFoundError = getattr(builtins, 'ModuleNotFoundError', ImportError)
 
 try:
     from test.support.warnings_helper import check_warnings
index 4b002ecef1df8ffd79a9aa067640eb43027a9bf2..f5aca79421b0bfeca89a81747d7bc22970212655 100644 (file)
@@ -14,6 +14,8 @@ from distutils.dep_util import newer
 from distutils.spawn import spawn
 from distutils import log
 from distutils.errors import DistutilsByteCompileError
+from .py35compat import _optim_args_from_interpreter_flags
+
 
 def get_host_platform():
     """Return a string that identifies the current platform.  This is used mainly to
@@ -79,8 +81,8 @@ def get_host_platform():
             machine += ".%s" % bitness[sys.maxsize]
         # fall through to standard osname-release-machine representation
     elif osname[:3] == "aix":
-        from _aix_support import aix_platform
-        return aix_platform()
+        from .py38compat import aix_platform
+        return aix_platform(osname, version, release)
     elif osname[:6] == "cygwin":
         osname = "cygwin"
         rel_re = re.compile (r'[\d.]+', re.ASCII)
@@ -420,7 +422,7 @@ byte_compile(files, optimize=%r, force=%r,
 """ % (optimize, force, prefix, base_dir, verbose))
 
         cmd = [sys.executable]
-        cmd.extend(subprocess._optim_args_from_interpreter_flags())
+        cmd.extend(_optim_args_from_interpreter_flags())
         cmd.append(script_name)
         spawn(cmd, dry_run=dry_run)
         execute(os.remove, (script_name,), "removing %s" % script_name,
diff --git a/tox.ini b/tox.ini
index 557c8d5acdb6c2339a8e5110bd8d0f92831af39f..535b67d3b9df658a73766a2c16be69a77b9ae492 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -66,9 +66,11 @@ deps =
        wheel
        twine[keyring]>=1.13
        path
+       jaraco.develop>=7.1
        jaraco.tidelift
 passenv =
        TWINE_PASSWORD
+       GITHUB_TOKEN
        TIDELIFT_TOKEN
 setenv =
        TWINE_USERNAME = {env:TWINE_USERNAME:__token__}
@@ -77,4 +79,5 @@ commands =
        python -c "import path; path.Path('dist').rmtree_p()"
        python setup.py release
        python -m twine upload dist/*
+       python -m jaraco.develop.create-github-release
        python -m jaraco.tidelift.publish-release-notes