Imported Upstream version 49.1.3 upstream/49.1.3
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 28 Dec 2020 02:31:17 +0000 (11:31 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 28 Dec 2020 02:31:17 +0000 (11:31 +0900)
.bumpversion.cfg
.github/ISSUE_TEMPLATE/blank.md [new file with mode: 0644]
.travis.yml
CHANGES.rst
setup.cfg
setuptools/_distutils/_msvccompiler.py
setuptools/_distutils/spawn.py
setuptools/command/bdist_egg.py
setuptools/command/build_ext.py

index 30e83be..5e4d74b 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 49.1.2
+current_version = 49.1.3
 commit = True
 tag = True
 
diff --git a/.github/ISSUE_TEMPLATE/blank.md b/.github/ISSUE_TEMPLATE/blank.md
new file mode 100644 (file)
index 0000000..e41fc74
--- /dev/null
@@ -0,0 +1,4 @@
+---
+name: Bug Report or Feature Request
+about: Report a bug or request a feature
+---
index e8bc757..0e636ee 100644 (file)
@@ -13,6 +13,7 @@ jobs:
   - <<: *latest_py3
     env: LANG=C
   - python: 3.8-dev
+  - python: 3.9-dev
   - <<: *latest_py3
     env: TOXENV=docs
   allow_failures:
index 24837a9..b23bc39 100644 (file)
@@ -1,3 +1,10 @@
+v49.1.3
+-------
+
+* #2212: (Distutils) Allow spawn to accept environment. Avoid monkey-patching global state.
+* #2249: Fix extension loading technique in stubs.
+
+
 v49.1.2
 -------
 
index dc29f7b..bad15f9 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,7 @@ formats = zip
 
 [metadata]
 name = setuptools
-version = 49.1.2
+version = 49.1.3
 description = Easily download, build, install, upgrade, and uninstall Python packages
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
index af8099a..0e98692 100644 (file)
@@ -501,12 +501,8 @@ class MSVCCompiler(CCompiler) :
             log.debug("skipping %s (up-to-date)", output_filename)
 
     def spawn(self, cmd):
-        old_path = os.getenv('path')
-        try:
-            os.environ['path'] = self._paths
-            return super().spawn(cmd)
-        finally:
-            os.environ['path'] = old_path
+        env = dict(os.environ, path=self._paths)
+        return super().spawn(cmd, env=env)
 
     # -- Miscellaneous methods -----------------------------------------
     # These are all used by the 'gen_lib_options() function, in
index 0d1bd03..fc592d4 100644 (file)
@@ -20,7 +20,7 @@ if sys.platform == 'darwin':
     _cfg_target_split = None
 
 
-def spawn(cmd, search_path=1, verbose=0, dry_run=0):
+def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None):
     """Run another program, specified as a command list 'cmd', in a new process.
 
     'cmd' is just the argument list for the new process, ie.
@@ -49,7 +49,8 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
         if executable is not None:
             cmd[0] = executable
 
-    env = None
+    env = env if env is not None else dict(os.environ)
+
     if sys.platform == 'darwin':
         global _cfg_target, _cfg_target_split
         if _cfg_target is None:
@@ -68,8 +69,7 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
                           'now "%s" but "%s" during configure'
                                 % (cur_target, _cfg_target))
                 raise DistutilsPlatformError(my_msg)
-            env = dict(os.environ,
-                       MACOSX_DEPLOYMENT_TARGET=cur_target)
+            env.update(MACOSX_DEPLOYMENT_TARGET=cur_target)
 
     try:
         proc = subprocess.Popen(cmd, env=env)
index e94fe25..7af3165 100644 (file)
@@ -59,7 +59,7 @@ def write_stub(resource, pyfile):
             from importlib.machinery import ExtensionFileLoader
             __file__ = pkg_resources.resource_filename(__name__, %r)
             __loader__ = None; del __bootstrap__, __loader__
-            ExtensionFileLoader(__name__,__file__).exec_module()
+            ExtensionFileLoader(__name__,__file__).load_module()
         __bootstrap__()
         """).lstrip()
     with open(pyfile, 'w') as f:
index 327fa06..0eb29ad 100644 (file)
@@ -268,7 +268,7 @@ class build_ext(_build_ext):
                     "     os.chdir(os.path.dirname(__file__))",
                     if_dl("     sys.setdlopenflags(dl.RTLD_NOW)"),
                     "     ExtensionFileLoader(__name__,",
-                    "                         __file__).exec_module()",
+                    "                         __file__).load_module()",
                     "   finally:",
                     if_dl("     sys.setdlopenflags(old_flags)"),
                     "     os.chdir(old_dir)",