From: DongHun Kwak Date: Tue, 29 Dec 2020 22:07:19 +0000 (+0900) Subject: Imported Upstream version 49.1.3 X-Git-Tag: upstream/49.1.3^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f57ad09a1108173e057f571993b42969640b2dac;p=platform%2Fupstream%2Fpython-setuptools.git Imported Upstream version 49.1.3 --- diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 30e83be..5e4d74b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -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 index 0000000..e41fc74 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/blank.md @@ -0,0 +1,4 @@ +--- +name: Bug Report or Feature Request +about: Report a bug or request a feature +--- diff --git a/.travis.yml b/.travis.yml index e8bc757..0e636ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/CHANGES.rst b/CHANGES.rst index 24837a9..b23bc39 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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 ------- diff --git a/setup.cfg b/setup.cfg index dc29f7b..bad15f9 100644 --- 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 diff --git a/setuptools/_distutils/_msvccompiler.py b/setuptools/_distutils/_msvccompiler.py index af8099a..0e98692 100644 --- a/setuptools/_distutils/_msvccompiler.py +++ b/setuptools/_distutils/_msvccompiler.py @@ -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 diff --git a/setuptools/_distutils/spawn.py b/setuptools/_distutils/spawn.py index 0d1bd03..fc592d4 100644 --- a/setuptools/_distutils/spawn.py +++ b/setuptools/_distutils/spawn.py @@ -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) diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index e94fe25..7af3165 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -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: diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py index 327fa06..0eb29ad 100644 --- a/setuptools/command/build_ext.py +++ b/setuptools/command/build_ext.py @@ -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)",