Imported Upstream version 49.3.2 upstream/49.3.2
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:07:56 +0000 (07:07 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:07:56 +0000 (07:07 +0900)
.bumpversion.cfg
CHANGES.rst
docs/pkg_resources.txt
docs/setuptools.txt
setup.cfg
setuptools/command/bdist_egg.py
setuptools/command/build_ext.py

index bb1e621f1608662bec019e6c9375dda84c9502b5..5e0d7fd7a6ad1bf611ae6476662bb384198848de 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 49.3.1
+current_version = 49.3.2
 commit = True
 tag = True
 
index df0230e75f2964b4712125c5413582f162b3c7cd..2add741a5e3cfdc42f6a490124376b428368f82e 100644 (file)
@@ -1,4 +1,11 @@
-vv49.3.1
+v49.3.2
+-------
+
+* #2300: Improve the ``safe_version`` function documentation
+* #2297: Once again, in stubs prefer exec_module to the deprecated load_module.
+
+
+v49.3.1
 --------
 
 * #2316: Removed warning when ``distutils`` is imported before ``setuptools`` when ``distutils`` replacement is not enabled.
index f2e554f42c88047c304161fbe05a70ba88b164d4..7d0d8da92a86d479f9d608db615c440b65c22f7d 100644 (file)
@@ -1596,12 +1596,12 @@ Parsing Utilities
     See ``to_filename()``.
 
 ``safe_version(version)``
-    This will return the normalized form of any PEP 440 version, if the version
-    string is not PEP 440 compatible than it is similar to ``safe_name()``
-    except that spaces in the input become dots, and dots are allowed to exist
-    in the output.  As with ``safe_name()``, if you are generating a filename
-    from this you should replace any "-" characters in the output with
-    underscores.
+    This will return the normalized form of any PEP 440 version. If the version
+    string is not PEP 440 compatible, this function behaves similar to
+    ``safe_name()`` except that spaces in the input become dots, and dots are
+    allowed to exist in the output.  As with ``safe_name()``, if you are
+    generating a filename from this you should replace any "-" characters in
+    the output with underscores.
 
 ``safe_extra(extra)``
     Return a "safe" form of an extra's name, suitable for use in a requirement
index 7e0914b7dc32c236cb599e1e6a6fac0a9a1110b5..d60c87a02606b8f9f613b2ad5f50cb8dda782e08 100644 (file)
@@ -1988,11 +1988,11 @@ boilerplate code in some cases.
     include_package_data = True
     packages = find:
     scripts =
-      bin/first.py
-      bin/second.py
+        bin/first.py
+        bin/second.py
     install_requires =
-      requests
-      importlib; python_version == "2.6"
+        requests
+        importlib; python_version == "2.6"
 
     [options.package_data]
     * = *.txt, *.rst
@@ -2028,8 +2028,8 @@ Metadata and options are set in the config sections of the same name.
 
       [metadata]
       keywords =
-        one
-        two
+          one
+          two
 
 * In some cases, complex values can be provided in dedicated subsections for
   clarity.
index 52440198d204896174bf296dd7e7d5ac2711732e..5d4a084cdf710237afcd359f79eccdc1d277363e 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,7 @@ formats = zip
 
 [metadata]
 name = setuptools
-version = 49.3.1
+version = 49.3.2
 description = Easily download, build, install, upgrade, and uninstall Python packages
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
index 7af3165cd5633021475dfd80d4c8f366431c5335..4be1545789dc237b232f364e468c9e28154afdc6 100644 (file)
@@ -55,11 +55,12 @@ def write_stub(resource, pyfile):
     _stub_template = textwrap.dedent("""
         def __bootstrap__():
             global __bootstrap__, __loader__, __file__
-            import sys, pkg_resources
-            from importlib.machinery import ExtensionFileLoader
+            import sys, pkg_resources, importlib.util
             __file__ = pkg_resources.resource_filename(__name__, %r)
             __loader__ = None; del __bootstrap__, __loader__
-            ExtensionFileLoader(__name__,__file__).load_module()
+            spec = importlib.util.spec_from_file_location(__name__,__file__)
+            mod = importlib.util.module_from_spec(spec)
+            spec.loader.exec_module(mod)
         __bootstrap__()
         """).lstrip()
     with open(pyfile, 'w') as f:
index 0eb29adc8b1b2dcb90e0b86f357b7513fc630eea..89a0e328f92aade242889087e9fdfe27643fec8c 100644 (file)
@@ -254,8 +254,8 @@ class build_ext(_build_ext):
                 '\n'.join([
                     "def __bootstrap__():",
                     "   global __bootstrap__, __file__, __loader__",
-                    "   import sys, os, pkg_resources" + if_dl(", dl"),
-                    "   from importlib.machinery import ExtensionFileLoader",
+                    "   import sys, os, pkg_resources, importlib.util" +
+                    if_dl(", dl"),
                     "   __file__ = pkg_resources.resource_filename"
                     "(__name__,%r)"
                     % os.path.basename(ext._file_name),
@@ -267,8 +267,10 @@ class build_ext(_build_ext):
                     "   try:",
                     "     os.chdir(os.path.dirname(__file__))",
                     if_dl("     sys.setdlopenflags(dl.RTLD_NOW)"),
-                    "     ExtensionFileLoader(__name__,",
-                    "                         __file__).load_module()",
+                    "     spec = importlib.util.spec_from_file_location(",
+                    "                __name__, __file__)",
+                    "     mod = importlib.util.module_from_spec(spec)",
+                    "     spec.loader.exec_module(mod)",
                     "   finally:",
                     if_dl("     sys.setdlopenflags(old_flags)"),
                     "     os.chdir(old_dir)",