From 5d58d955b5f5dcafe6ec624b82b327ce1fe9bbfd Mon Sep 17 00:00:00 2001 From: david Date: Wed, 25 Jun 2014 10:47:59 -0400 Subject: fix failing integration (test_stevedore) test on windows because of an unreleased handle on the current directory --- setuptools/tests/test_integration.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'setuptools') diff --git a/setuptools/tests/test_integration.py b/setuptools/tests/test_integration.py index 7144aa6c..8d6c1e55 100644 --- a/setuptools/tests/test_integration.py +++ b/setuptools/tests/test_integration.py @@ -25,6 +25,9 @@ def install_context(request, tmpdir, monkeypatch): install_dir = tmpdir.mkdir('install_dir') def fin(): + # undo the monkeypatch, particularly needed under + # windows because of kept handle on cwd + monkeypatch.undo() new_cwd.remove() user_base.remove() user_site.remove() -- cgit v1.2.3 From e221bdf38ccf35d0d2b1148b4072108fcd47ec0a Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sun, 29 Jun 2014 14:58:41 +0200 Subject: Fix typos --- setuptools/tests/win_script_wrapper.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/win_script_wrapper.txt b/setuptools/tests/win_script_wrapper.txt index 731243dd..b3a52e0a 100644 --- a/setuptools/tests/win_script_wrapper.txt +++ b/setuptools/tests/win_script_wrapper.txt @@ -3,7 +3,7 @@ Python Script Wrapper for Windows setuptools includes wrappers for Python scripts that allows them to be executed like regular windows programs. There are 2 wrappers, once -for command-line programs, cli.exe, and one for graphica programs, +for command-line programs, cli.exe, and one for graphical programs, gui.exe. These programs are almost identical, function pretty much the same way, and are generated from the same source file. The wrapper programs are used by copying them to the directory containing @@ -44,7 +44,7 @@ We'll also copy cli.exe to the sample-directory with the name foo.exe: When the copy of cli.exe, foo.exe in this example, runs, it examines the path name it was run with and computes a Python script path name -by removing the '.exe' suffic and adding the '-script.py' suffix. (For +by removing the '.exe' suffix and adding the '-script.py' suffix. (For GUI programs, the suffix '-script-pyw' is added.) This is why we named out script the way we did. Now we can run out script by running the wrapper: @@ -68,8 +68,8 @@ This example was a little pathological in that it exercised windows - Double quotes in strings need to be escaped by preceding them with back slashes. -- One or more backslashes preceding double quotes quotes need to be - escaped by preceding each of them them with back slashes. +- One or more backslashes preceding double quotes need to be escaped + by preceding each of them with back slashes. Specifying Python Command-line Options -- cgit v1.2.3 From bf0cecd76dd0501cbb98c77583c11a622dcfe73f Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Thu, 3 Jul 2014 17:03:39 +0300 Subject: ssl_support: Adjust to tunneling changes in Python 2.7.7 and 3.4.1. The fix for https://bugs.python.org/issue7776 changed httplib.HTTPConnection's handling of tunneling: `host' now points to the proxy host, so we have to adjust the code to perform the certificate validation on `_tunnel_host' instead when it is available. --- setuptools/ssl_support.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py index 7b5f429f..cc7db067 100644 --- a/setuptools/ssl_support.py +++ b/setuptools/ssl_support.py @@ -178,12 +178,19 @@ class VerifyingHTTPSConn(HTTPSConnection): if hasattr(self, '_tunnel') and getattr(self, '_tunnel_host', None): self.sock = sock self._tunnel() + # http://bugs.python.org/issue7776: Python>=3.4.1 and >=2.7.7 + # change self.host to mean the proxy server host when tunneling is + # being used. Adapt, since we are interested in the destination + # host for the match_hostname() comparison. + actual_host = self._tunnel_host + else: + actual_host = self.host self.sock = ssl.wrap_socket( sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=self.ca_bundle ) try: - match_hostname(self.sock.getpeercert(), self.host) + match_hostname(self.sock.getpeercert(), actual_host) except CertificateError: self.sock.shutdown(socket.SHUT_RDWR) self.sock.close() -- cgit v1.2.3 From e66c4d9c3aefaf98a7d8d9b19ce5948fe7840c49 Mon Sep 17 00:00:00 2001 From: Melvyn Sopacua Date: Sat, 5 Jul 2014 17:43:39 +0200 Subject: Fix exclude list on python 3.2+ imp.get_tag() is only available on 3.2+. Since 2 Date: Sat, 5 Jul 2014 18:41:12 +0200 Subject: Commit the fix we did when testing python3 I shall `hg status` before submitting PRs. I shall `hg status` before submitting PRs. I shall `hg status` before submitting PRs. --- setuptools/command/install_lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index cf5375f6..7692e0f3 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -18,7 +18,7 @@ class install_lib(orig.install_lib): .single_version_externally_managed) exclude_names = ['__init__.py', '__init__.pyc', '__init__.pyo'] if hasattr(imp, 'get_tag') : - exclude_names.extend( + exclude_names.extend(( os.path.join( '__pycache__', '__init__.' + imp.get_tag() + '.pyc' @@ -27,7 +27,7 @@ class install_lib(orig.install_lib): '__pycache__', '__init__.' + imp.get_tag() + '.pyo' ), - ) + )) if svem: for pkg in nsp: parts = pkg.split('.') -- cgit v1.2.3 From 793bdfffdf388ae3203d4703b4feac3f1f4ccd96 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 6 Jul 2014 14:04:10 -0400 Subject: Bumped to 5.4.1 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 773d9307..2ac7a45e 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.5' +__version__ = '5.4.1' -- cgit v1.2.3 From f420ad2c7d1c0cb232c9713c02fc0f5c798fc682 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 6 Jul 2014 14:04:46 -0400 Subject: Bumped to 5.4.2 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 2ac7a45e..16cc1382 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.4.1' +__version__ = '5.4.2' -- cgit v1.2.3 From 4cd8b93b95ccac00f3926ffbcead754331853c6d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 12 Jul 2014 08:58:33 -0400 Subject: Use simple asserts. pytest handles this nicely. Removes broken _assertIn. --- setuptools/tests/test_resources.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 443905cc..279fd139 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -575,13 +575,6 @@ class NamespaceTests(TestCase): pkg_resources._namespace_packages = self._ns_pkgs.copy() sys.path = self._prev_sys_path[:] - def _assertIn(self, member, container): - """ assertIn and assertTrue does not exist in Python2.3""" - if member not in container: - standardMsg = '%s not found in %s' % (safe_repr(member), - safe_repr(container)) - self.fail(self._formatMessage(msg, standardMsg)) - def test_two_levels_deep(self): """ Test nested namespace packages @@ -605,13 +598,13 @@ class NamespaceTests(TestCase): pkg2_init.write(ns_str) pkg2_init.close() import pkg1 - self._assertIn("pkg1", pkg_resources._namespace_packages.keys()) + assert "pkg1" in pkg_resources._namespace_packages try: import pkg1.pkg2 except ImportError: self.fail("Setuptools tried to import the parent namespace package") # check the _namespace_packages dict - self._assertIn("pkg1.pkg2", pkg_resources._namespace_packages.keys()) + assert "pkg1.pkg2" in pkg_resources._namespace_packages self.assertEqual(pkg_resources._namespace_packages["pkg1"], ["pkg1.pkg2"]) # check the __path__ attribute contains both paths self.assertEqual(pkg1.pkg2.__path__, [ -- cgit v1.2.3 From 7003458aa6b13578f8862dca6041ec5c55c21027 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 12 Jul 2014 09:00:52 -0400 Subject: More simple asserts --- setuptools/tests/test_resources.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 279fd139..1f3b747d 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -605,8 +605,10 @@ class NamespaceTests(TestCase): self.fail("Setuptools tried to import the parent namespace package") # check the _namespace_packages dict assert "pkg1.pkg2" in pkg_resources._namespace_packages - self.assertEqual(pkg_resources._namespace_packages["pkg1"], ["pkg1.pkg2"]) + assert pkg_resources._namespace_packages["pkg1"] == ["pkg1.pkg2"] # check the __path__ attribute contains both paths - self.assertEqual(pkg1.pkg2.__path__, [ + expected = [ os.path.join(self._tmpdir, "site-pkgs", "pkg1", "pkg2"), - os.path.join(self._tmpdir, "site-pkgs2", "pkg1", "pkg2")]) + os.path.join(self._tmpdir, "site-pkgs2", "pkg1", "pkg2"), + ] + assert pkg1.pkg2.__path__ == expected -- cgit v1.2.3 From 1237522b992f84cf674833f0745b144874db817c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 12 Jul 2014 09:12:38 -0400 Subject: Disable test_two_levels_deep when /tmp is a symlink. The results it is returning are suitable (shouldn't cause errors in runtime). Users are invited to trace the problem and find a solution. Fixes #231. --- setuptools/tests/test_resources.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'setuptools') diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 1f3b747d..759bbcd5 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -16,6 +16,7 @@ from pkg_resources import (parse_requirements, VersionConflict, parse_version, from setuptools.command.easy_install import (get_script_header, is_sh, nt_quote_arg) from setuptools.compat import StringIO, iteritems, PY3 +from .py26compat import skipIf try: frozenset @@ -575,6 +576,8 @@ class NamespaceTests(TestCase): pkg_resources._namespace_packages = self._ns_pkgs.copy() sys.path = self._prev_sys_path[:] + msg = "Test fails when /tmp is a symlink. See #231" + @skipIf(os.path.islink(tempfile.gettempdir()), msg) def test_two_levels_deep(self): """ Test nested namespace packages -- cgit v1.2.3 From c6fbf0c0ab840ad86687323c7532ff5b7de6c6bb Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 12 Jul 2014 09:14:36 -0400 Subject: frozenset is available in Python 2.6 --- setuptools/tests/test_resources.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 759bbcd5..3baa3ab1 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -18,11 +18,6 @@ from setuptools.command.easy_install import (get_script_header, is_sh, from setuptools.compat import StringIO, iteritems, PY3 from .py26compat import skipIf -try: - frozenset -except NameError: - from sets import ImmutableSet as frozenset - def safe_repr(obj, short=False): """ copied from Python2.7""" try: -- cgit v1.2.3 From b73d7fa62dae090d486c54c8cc434e955a06ffb6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Aug 2014 15:19:40 -0400 Subject: Remove unused variable --HG-- extra : rebase_source : c4b515b677e318ffdcd78b2d90ab772e7d1f94e3 --- setuptools/tests/test_sandbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py index 06b3d434..0e04ad1c 100644 --- a/setuptools/tests/test_sandbox.py +++ b/setuptools/tests/test_sandbox.py @@ -19,7 +19,7 @@ def has_win32com(): if not sys.platform.startswith('win32'): return False try: - mod = __import__('win32com') + __import__('win32com') except ImportError: return False return True -- cgit v1.2.3 From ca46f074d12651e32250737c7f380b343b0882ec Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Aug 2014 15:20:32 -0400 Subject: Python 2.3 no longer supported --HG-- extra : rebase_source : debc6141ad369eafeb78b808a15d8558ff3fb83b --- setuptools/tests/test_sandbox.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py index 0e04ad1c..0f2e693d 100644 --- a/setuptools/tests/test_sandbox.py +++ b/setuptools/tests/test_sandbox.py @@ -33,8 +33,6 @@ class TestSandbox(unittest.TestCase): shutil.rmtree(self.dir) def test_devnull(self): - if sys.version < '2.4': - return sandbox = DirectorySandbox(self.dir) sandbox.run(self._file_writer(os.devnull)) -- cgit v1.2.3 From 33f496c61e086bd1ac701e44bc17315c0442010c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Aug 2014 15:29:11 -0400 Subject: Add test capturing failure on Python 2.6. Ref #236 --HG-- extra : rebase_source : 99a2b1e437691f9e1a9982357bc70d91fce91953 --- setuptools/tests/test_sandbox.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'setuptools') diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py index 0f2e693d..6a890ebc 100644 --- a/setuptools/tests/test_sandbox.py +++ b/setuptools/tests/test_sandbox.py @@ -73,5 +73,11 @@ class TestSandbox(unittest.TestCase): setuptools.sandbox._execfile(target, vars(namespace)) assert namespace.result == 'passed' + def test_setup_py_with_CRLF(self): + setup_py = os.path.join(self.dir, 'setup.py') + with open(setup_py, 'wb') as stream: + stream.write(b'"degenerate script"\r\n') + setuptools.sandbox._execfile(setup_py, globals()) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3 From 249e5853496ec108dc78e58c003bf46315b50ffc Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Aug 2014 15:31:47 -0400 Subject: Extract variable --- setuptools/sandbox.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 7985e9ee..a0d3dc61 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -30,7 +30,8 @@ def _execfile(filename, globals, locals=None): """ Python 3 implementation of execfile. """ - with open(filename, 'rb') as stream: + mode = 'rb' + with open(filename, mode) as stream: script = stream.read() if locals is None: locals = globals -- cgit v1.2.3 From 59e3528c710363e167e0860aab4fd1a611cc058b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Aug 2014 15:36:08 -0400 Subject: Correct execfile implementation for Python 2.6. Fixes #236. --- setuptools/sandbox.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'setuptools') diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index a0d3dc61..e79a13a8 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -31,6 +31,10 @@ def _execfile(filename, globals, locals=None): Python 3 implementation of execfile. """ mode = 'rb' + # Python 2.6 compile requires LF for newlines, so use deprecated + # Universal newlines support. + if sys.version_info < (2, 7): + mode += 'U' with open(filename, mode) as stream: script = stream.read() if locals is None: -- cgit v1.2.3 From 0341e4d0b24162ec6a4280c99bafdf8b7bcab324 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 1 Aug 2014 16:24:36 -0400 Subject: Bumped to 5.4.3 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 16cc1382..0e0a34f9 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.4.2' +__version__ = '5.4.3' -- cgit v1.2.3 From ac14ffe92376c54bb2d5a443e5177d85faeda75d Mon Sep 17 00:00:00 2001 From: Benedikt Morbach Date: Thu, 7 Aug 2014 17:57:00 +0200 Subject: make order of lines in top_level.txt deterministic like it was done for requirements and entry_points --- setuptools/command/egg_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 72493d0b..1ef723da 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -389,7 +389,7 @@ def write_toplevel_names(cmd, basename, filename): for k in cmd.distribution.iter_distribution_names() ] ) - cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n') + cmd.write_file("top-level names", filename, '\n'.join(sorted(pkgs) + '\n') def overwrite_arg(cmd, basename, filename): -- cgit v1.2.3 From 50cd15aef3a657ee9cf86326e18e3bc2919b4cf6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 Aug 2014 14:06:15 -0400 Subject: Include setup_requires directive in Distribution attributes and metadata. Fixes #239. --- setuptools/dist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/dist.py b/setuptools/dist.py index dac4dfa8..8b36f67c 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -259,7 +259,7 @@ class Distribution(_Distribution): self.dependency_links = attrs.pop('dependency_links', []) assert_string_list(self,'dependency_links',self.dependency_links) if attrs and 'setup_requires' in attrs: - self.fetch_build_eggs(attrs.pop('setup_requires')) + self.fetch_build_eggs(attrs['setup_requires']) for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'): if not hasattr(self,ep.name): setattr(self,ep.name,None) -- cgit v1.2.3 From 28097c4d3dad73f7813a5e271ab3ad9dc6302b99 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 Aug 2014 14:49:28 -0400 Subject: Bumped to 5.5 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 0e0a34f9..773d9307 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.4.3' +__version__ = '5.5' -- cgit v1.2.3 From f4ff967301bdd5f33631d2650baad9776baa4c10 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 Aug 2014 14:50:14 -0400 Subject: Bumped to 5.6 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 773d9307..49e04a62 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.5' +__version__ = '5.6' -- cgit v1.2.3 From 26cc02d02a295ff30c6a0f0b661bfc6f2fd2246b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 Aug 2014 19:55:29 -0400 Subject: Bumped to 5.5.1 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 49e04a62..45e4cae4 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.6' +__version__ = '5.5.1' -- cgit v1.2.3 From 064554652d35bfd14eb4787a808d4d27d4f643a1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 10 Aug 2014 19:56:16 -0400 Subject: Bumped to 5.5.2 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 45e4cae4..e441e915 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.5.1' +__version__ = '5.5.2' -- cgit v1.2.3 From dd832d63bdc2c18a5456f41a1d099e59becd0bcb Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Aug 2014 12:52:47 -0400 Subject: Use absolute_import in svn_utils. Fixes #242. --- setuptools/svn_utils.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'setuptools') diff --git a/setuptools/svn_utils.py b/setuptools/svn_utils.py index 2dcfd899..dadb682a 100644 --- a/setuptools/svn_utils.py +++ b/setuptools/svn_utils.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import + import os import re import sys -- cgit v1.2.3 From 0a9f4f05fd110d6676de8cd58506499a1ac00aad Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Aug 2014 12:57:25 -0400 Subject: Bumped to 5.6 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index e441e915..49e04a62 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.5.2' +__version__ = '5.6' -- cgit v1.2.3 From 06c0f3f41296ab29b626b3c7970f7bfa9e159439 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 14 Aug 2014 12:58:05 -0400 Subject: Bumped to 5.7 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 49e04a62..8666d542 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.6' +__version__ = '5.7' -- cgit v1.2.3 From 6c42630380e93d2945620bae9a351a506bf42b19 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 15 Aug 2014 09:55:11 -0400 Subject: Bumped to 5.8 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 8666d542..868f2d33 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.7' +__version__ = '5.8' -- cgit v1.2.3 From 7702536f882a3e03cea35bb3066069793351f1ce Mon Sep 17 00:00:00 2001 From: Hugues Lerebours Date: Mon, 18 Aug 2014 14:11:34 +0200 Subject: [Fix/Typo] Fix missing parenthesis in egg_info.py Syntax error introduced in be37eff86c761a399c1ec98b0e5eeed9a90c9cd7 --- setuptools/command/egg_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 1ef723da..06764a17 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -389,7 +389,7 @@ def write_toplevel_names(cmd, basename, filename): for k in cmd.distribution.iter_distribution_names() ] ) - cmd.write_file("top-level names", filename, '\n'.join(sorted(pkgs) + '\n') + cmd.write_file("top-level names", filename, '\n'.join(sorted(pkgs)) + '\n') def overwrite_arg(cmd, basename, filename): -- cgit v1.2.3 From f8844d7508fd6fe81b161b14320b2dcd8ec88315 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 21 Aug 2014 09:48:06 -0400 Subject: Backed out changeset: be37eff86c76 Syntax was invalid. --- setuptools/command/egg_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 1ef723da..72493d0b 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -389,7 +389,7 @@ def write_toplevel_names(cmd, basename, filename): for k in cmd.distribution.iter_distribution_names() ] ) - cmd.write_file("top-level names", filename, '\n'.join(sorted(pkgs) + '\n') + cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n') def overwrite_arg(cmd, basename, filename): -- cgit v1.2.3 From 63ddca7cd1011b8d4b1348315c02fe9fd6a404e2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 09:54:15 -0400 Subject: Normalize syntax --- setuptools/command/install_lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 7692e0f3..c0c271a4 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -17,7 +17,7 @@ class install_lib(orig.install_lib): svem = (nsp and self.get_finalized_command('install') .single_version_externally_managed) exclude_names = ['__init__.py', '__init__.pyc', '__init__.pyo'] - if hasattr(imp, 'get_tag') : + if hasattr(imp, 'get_tag'): exclude_names.extend(( os.path.join( '__pycache__', @@ -33,7 +33,7 @@ class install_lib(orig.install_lib): parts = pkg.split('.') while parts: pkgdir = os.path.join(self.install_dir, *parts) - for f in exclude_names : + for f in exclude_names: exclude[os.path.join(pkgdir, f)] = 1 parts.pop() return exclude -- cgit v1.2.3 From a7dbe706890eab7ba330c51ea59349c28080dfde Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:02:01 -0400 Subject: Extract method for generating exclude names --- setuptools/command/install_lib.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index c0c271a4..259f0899 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -16,6 +16,22 @@ class install_lib(orig.install_lib): nsp = self.distribution.namespace_packages svem = (nsp and self.get_finalized_command('install') .single_version_externally_managed) + if svem: + for pkg in nsp: + parts = pkg.split('.') + while parts: + pkgdir = os.path.join(self.install_dir, *parts) + for f in self._gen_exclude_names(): + exclude[os.path.join(pkgdir, f)] = 1 + parts.pop() + return exclude + + @staticmethod + def _gen_exclude_names(): + """ + Generate the list of file paths to be excluded for namespace + packages (bytecode cache files). + """ exclude_names = ['__init__.py', '__init__.pyc', '__init__.pyo'] if hasattr(imp, 'get_tag'): exclude_names.extend(( @@ -28,15 +44,7 @@ class install_lib(orig.install_lib): '__init__.' + imp.get_tag() + '.pyo' ), )) - if svem: - for pkg in nsp: - parts = pkg.split('.') - while parts: - pkgdir = os.path.join(self.install_dir, *parts) - for f in exclude_names: - exclude[os.path.join(pkgdir, f)] = 1 - parts.pop() - return exclude + return exclude_names def copy_tree( self, infile, outfile, -- cgit v1.2.3 From 4e5bbb8e5175b35f8cbaace630bd0dd3091d6946 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:05:18 -0400 Subject: Generate the filenames more directly. --- setuptools/command/install_lib.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 259f0899..3f39d945 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -29,22 +29,18 @@ class install_lib(orig.install_lib): @staticmethod def _gen_exclude_names(): """ - Generate the list of file paths to be excluded for namespace - packages (bytecode cache files). + Generate file paths to be excluded for namespace packages (bytecode + cache files). """ - exclude_names = ['__init__.py', '__init__.pyc', '__init__.pyo'] - if hasattr(imp, 'get_tag'): - exclude_names.extend(( - os.path.join( - '__pycache__', - '__init__.' + imp.get_tag() + '.pyc' - ), - os.path.join( - '__pycache__', - '__init__.' + imp.get_tag() + '.pyo' - ), - )) - return exclude_names + yield '__init__.py' + yield '__init__.pyc' + yield '__init__.pyo' + + if not hasattr(imp, 'get_tag'): + return + + yield os.path.join('__pycache__', '__init__.' + imp.get_tag() + '.pyc') + yield os.path.join('__pycache__', '__init__.' + imp.get_tag() + '.pyo') def copy_tree( self, infile, outfile, -- cgit v1.2.3 From f6f409ac7dc06be2524211a717182cd96b21e13f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:06:35 -0400 Subject: Extract calculation of base path --- setuptools/command/install_lib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 3f39d945..d1c91b7b 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -39,8 +39,9 @@ class install_lib(orig.install_lib): if not hasattr(imp, 'get_tag'): return - yield os.path.join('__pycache__', '__init__.' + imp.get_tag() + '.pyc') - yield os.path.join('__pycache__', '__init__.' + imp.get_tag() + '.pyo') + base = os.path.join('__pycache__', '__init__.' + imp.get_tag()) + yield base + '.pyc' + yield base + '.pyo' def copy_tree( self, infile, outfile, -- cgit v1.2.3 From 23f5f548a9dfffe5c04f40eee461d2270ecf5f53 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:07:07 -0400 Subject: Add comment --- setuptools/command/install_lib.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index d1c91b7b..a1cbd2aa 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -32,7 +32,9 @@ class install_lib(orig.install_lib): Generate file paths to be excluded for namespace packages (bytecode cache files). """ + # always exclude the package module itself yield '__init__.py' + yield '__init__.pyc' yield '__init__.pyo' -- cgit v1.2.3 From 03fe70a1793ea5dae7685323f1146eb12c2a0e0e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:08:48 -0400 Subject: Construct exclusions as a set --- setuptools/command/install_lib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index a1cbd2aa..f4b295cc 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -12,7 +12,7 @@ class install_lib(orig.install_lib): self.byte_compile(outfiles) def get_exclusions(self): - exclude = {} + exclude = set() nsp = self.distribution.namespace_packages svem = (nsp and self.get_finalized_command('install') .single_version_externally_managed) @@ -22,9 +22,9 @@ class install_lib(orig.install_lib): while parts: pkgdir = os.path.join(self.install_dir, *parts) for f in self._gen_exclude_names(): - exclude[os.path.join(pkgdir, f)] = 1 + exclude.add(os.path.join(pkgdir, f)) parts.pop() - return exclude + return dict.fromkeys(exclude, 1) @staticmethod def _gen_exclude_names(): -- cgit v1.2.3 From e8914480487426305fece22422fdb725f88add7f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:19:36 -0400 Subject: Add docstring for get_exclusions. Just return the set as it is a sized container. --- setuptools/command/install_lib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index f4b295cc..91d2b25d 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -12,6 +12,10 @@ class install_lib(orig.install_lib): self.byte_compile(outfiles) def get_exclusions(self): + """ + Return a collections.Sized collections.Container of paths to be + excluded for single_version_externally_managed installations. + """ exclude = set() nsp = self.distribution.namespace_packages svem = (nsp and self.get_finalized_command('install') @@ -24,7 +28,7 @@ class install_lib(orig.install_lib): for f in self._gen_exclude_names(): exclude.add(os.path.join(pkgdir, f)) parts.pop() - return dict.fromkeys(exclude, 1) + return exclude @staticmethod def _gen_exclude_names(): -- cgit v1.2.3 From bd62121950280590c9388db065df389cf2d8280d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:29:38 -0400 Subject: Extract method for calculating namespace packages for single_version_externally_managed --- setuptools/command/install_lib.py | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 91d2b25d..bf587a04 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -17,19 +17,31 @@ class install_lib(orig.install_lib): excluded for single_version_externally_managed installations. """ exclude = set() - nsp = self.distribution.namespace_packages - svem = (nsp and self.get_finalized_command('install') - .single_version_externally_managed) - if svem: - for pkg in nsp: - parts = pkg.split('.') - while parts: - pkgdir = os.path.join(self.install_dir, *parts) - for f in self._gen_exclude_names(): - exclude.add(os.path.join(pkgdir, f)) - parts.pop() + for pkg in self._get_SVEM_NSPs(): + parts = pkg.split('.') + while parts: + pkgdir = os.path.join(self.install_dir, *parts) + for f in self._gen_exclude_names(): + exclude.add(os.path.join(pkgdir, f)) + parts.pop() return exclude + def _get_SVEM_NSPs(self): + """ + Get namespace packages (list) but only for + single_version_externally_managed installations and empty otherwise. + """ + # TODO: is it necessary to short-circuit here? i.e. what's the cost + # if get_finalized_command is called even when namespace_packages is + # False? + if not self.distribution.namespace_packages: + return [] + + install_cmd = self.get_finalized_command('install') + svem = install_cmd.single_version_externally_managed + + return self.distribution.namespace_packages if svem else [] + @staticmethod def _gen_exclude_names(): """ -- cgit v1.2.3 From 82c2101634a423ae9ccf003612b89fbd230f8303 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:39:53 -0400 Subject: Extract method for computing parent packages of a package --- setuptools/command/install_lib.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index bf587a04..88b35972 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -17,15 +17,24 @@ class install_lib(orig.install_lib): excluded for single_version_externally_managed installations. """ exclude = set() - for pkg in self._get_SVEM_NSPs(): - parts = pkg.split('.') - while parts: + for ns_pkg in self._get_SVEM_NSPs(): + for pkg in self._all_packages(ns_pkg): + parts = pkg.split('.') pkgdir = os.path.join(self.install_dir, *parts) for f in self._gen_exclude_names(): exclude.add(os.path.join(pkgdir, f)) - parts.pop() return exclude + @staticmethod + def _all_packages(pkg_name): + """ + >>> list(install_lib._all_packages('foo.bar.baz')) + ['foo.bar.baz', 'foo.bar', 'foo'] + """ + while pkg_name: + yield pkg_name + pkg_name, sep, child = pkg_name.partition('.') + def _get_SVEM_NSPs(self): """ Get namespace packages (list) but only for -- cgit v1.2.3 From 10e504abc7f0a0c45157bf4d6cbbd63dea6a67dd Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:41:49 -0400 Subject: Extract path calculation for paths --- setuptools/command/install_lib.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 88b35972..92490b6e 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -17,12 +17,11 @@ class install_lib(orig.install_lib): excluded for single_version_externally_managed installations. """ exclude = set() + pkg_path = lambda pkg: os.path.join(self.install_dir, *pkg.split('.')) for ns_pkg in self._get_SVEM_NSPs(): for pkg in self._all_packages(ns_pkg): - parts = pkg.split('.') - pkgdir = os.path.join(self.install_dir, *parts) for f in self._gen_exclude_names(): - exclude.add(os.path.join(pkgdir, f)) + exclude.add(os.path.join(pkg_path(pkg), f)) return exclude @staticmethod -- cgit v1.2.3 From b43f75980dd674153cafec047709092438d54b5c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:43:35 -0400 Subject: Rewrite package traversal as a generator expression --- setuptools/command/install_lib.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 92490b6e..7f157a0f 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -18,8 +18,12 @@ class install_lib(orig.install_lib): """ exclude = set() pkg_path = lambda pkg: os.path.join(self.install_dir, *pkg.split('.')) - for ns_pkg in self._get_SVEM_NSPs(): - for pkg in self._all_packages(ns_pkg): + all_packages = ( + pkg + for ns_pkg in self._get_SVEM_NSPs() + for pkg in self._all_packages(ns_pkg) + ) + for pkg in all_packages: for f in self._gen_exclude_names(): exclude.add(os.path.join(pkg_path(pkg), f)) return exclude -- cgit v1.2.3 From c6340e42c8a06a35048659d7178efb329cda3249 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:43:43 -0400 Subject: Reindent --- setuptools/command/install_lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 7f157a0f..371a9e72 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -24,8 +24,8 @@ class install_lib(orig.install_lib): for pkg in self._all_packages(ns_pkg) ) for pkg in all_packages: - for f in self._gen_exclude_names(): - exclude.add(os.path.join(pkg_path(pkg), f)) + for f in self._gen_exclude_names(): + exclude.add(os.path.join(pkg_path(pkg), f)) return exclude @staticmethod -- cgit v1.2.3 From b908527864443899b89cf568ac9397aef7ad16c9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:46:14 -0400 Subject: Use itertools.product for a cross-product of two iterables --- setuptools/command/install_lib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 371a9e72..c2730568 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -1,5 +1,6 @@ import distutils.command.install_lib as orig import os, imp +from itertools import product class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" @@ -23,9 +24,8 @@ class install_lib(orig.install_lib): for ns_pkg in self._get_SVEM_NSPs() for pkg in self._all_packages(ns_pkg) ) - for pkg in all_packages: - for f in self._gen_exclude_names(): - exclude.add(os.path.join(pkg_path(pkg), f)) + for pkg, f in product(all_packages, self._gen_exclude_names()): + exclude.add(os.path.join(pkg_path(pkg), f)) return exclude @staticmethod -- cgit v1.2.3 From 38b6f23637bcf8db5b9237393399041fbe36c65f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:46:37 -0400 Subject: Reorganize imports --- setuptools/command/install_lib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index c2730568..cc531c01 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -1,6 +1,7 @@ -import distutils.command.install_lib as orig -import os, imp +import os +import imp from itertools import product +import distutils.command.install_lib as orig class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" -- cgit v1.2.3 From b925f19a4ef1b214650b770c74a083fc4f982758 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:52:20 -0400 Subject: Incorporate the exclusion path in the _exclude function. --- setuptools/command/install_lib.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index cc531c01..f36d8651 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -19,14 +19,18 @@ class install_lib(orig.install_lib): excluded for single_version_externally_managed installations. """ exclude = set() - pkg_path = lambda pkg: os.path.join(self.install_dir, *pkg.split('.')) + + def _exclude(pkg, exclusion_path): + parts = pkg.split('.') + [exclusion_path] + return os.path.join(self.install_dir, *parts) + all_packages = ( pkg for ns_pkg in self._get_SVEM_NSPs() for pkg in self._all_packages(ns_pkg) ) for pkg, f in product(all_packages, self._gen_exclude_names()): - exclude.add(os.path.join(pkg_path(pkg), f)) + exclude.add(_exclude(pkg, f)) return exclude @staticmethod -- cgit v1.2.3 From 86f35df37c309d2192a95259e77c6b4ba7f73876 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:56:24 -0400 Subject: Return the exclusions directly --- setuptools/command/install_lib.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index f36d8651..dcd85dec 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -1,6 +1,6 @@ import os import imp -from itertools import product +from itertools import product, starmap import distutils.command.install_lib as orig class install_lib(orig.install_lib): @@ -18,9 +18,11 @@ class install_lib(orig.install_lib): Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. """ - exclude = set() - def _exclude(pkg, exclusion_path): + """ + Given a package name and exclusion path within that package, + compute the full exclusion path. + """ parts = pkg.split('.') + [exclusion_path] return os.path.join(self.install_dir, *parts) @@ -29,9 +31,9 @@ class install_lib(orig.install_lib): for ns_pkg in self._get_SVEM_NSPs() for pkg in self._all_packages(ns_pkg) ) - for pkg, f in product(all_packages, self._gen_exclude_names()): - exclude.add(_exclude(pkg, f)) - return exclude + + excl_specs = product(all_packages, self._gen_exclude_names()) + return set(starmap(_exclude, excl_specs)) @staticmethod def _all_packages(pkg_name): -- cgit v1.2.3 From e301ab4639508fd7d9d4a3beb51974d211d1c109 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 10:59:09 -0400 Subject: Move inline function into an instance method and rename for clarity. --- setuptools/command/install_lib.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index dcd85dec..3cd16a8f 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -18,22 +18,22 @@ class install_lib(orig.install_lib): Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. """ - def _exclude(pkg, exclusion_path): - """ - Given a package name and exclusion path within that package, - compute the full exclusion path. - """ - parts = pkg.split('.') + [exclusion_path] - return os.path.join(self.install_dir, *parts) - all_packages = ( pkg for ns_pkg in self._get_SVEM_NSPs() for pkg in self._all_packages(ns_pkg) ) - excl_specs = product(all_packages, self._gen_exclude_names()) - return set(starmap(_exclude, excl_specs)) + excl_specs = product(all_packages, self._gen_exclusion_paths()) + return set(starmap(self._exclude_pkg_path, excl_specs)) + + def _exclude_pkg_path(self, pkg, exclusion_path): + """ + Given a package name and exclusion path within that package, + compute the full exclusion path. + """ + parts = pkg.split('.') + [exclusion_path] + return os.path.join(self.install_dir, *parts) @staticmethod def _all_packages(pkg_name): @@ -62,7 +62,7 @@ class install_lib(orig.install_lib): return self.distribution.namespace_packages if svem else [] @staticmethod - def _gen_exclude_names(): + def _gen_exclusion_paths(): """ Generate file paths to be excluded for namespace packages (bytecode cache files). -- cgit v1.2.3 From b54668a95934f1f63647e219cbbcbeab4a524ac3 Mon Sep 17 00:00:00 2001 From: Jesse Weinstein Date: Thu, 28 Aug 2014 20:55:27 +0000 Subject: Fix issue #118: Prevent the egg-info directory from being redundantly included in the list of modified files. --HG-- extra : rebase_source : 8bad8bf37ef1fdc59b4c1ba21fcff43d25f9b2be --- setuptools/command/install_egg_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/command/install_egg_info.py b/setuptools/command/install_egg_info.py index fd0f118b..992709f1 100755 --- a/setuptools/command/install_egg_info.py +++ b/setuptools/command/install_egg_info.py @@ -27,7 +27,7 @@ class install_egg_info(Command): ).egg_name() + '.egg-info' self.source = ei_cmd.egg_info self.target = os.path.join(self.install_dir, basename) - self.outputs = [self.target] + self.outputs = [] def run(self): self.run_command('egg_info') -- cgit v1.2.3 From 394ea0c104e7da5cf583680b418c3e5e4b9858d4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 18 Sep 2014 07:40:48 -0400 Subject: Bumped to 5.9 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 868f2d33..7244139e 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.8' +__version__ = '5.9' -- cgit v1.2.3 From 4e5c7d0657a9719d2fa961c852daf0926de91ae3 Mon Sep 17 00:00:00 2001 From: Randy Syring Date: Sat, 20 Sep 2014 16:29:41 -0400 Subject: sdist command: fix case insensitivity when adding some files to filelist This should fix the problem in Bitbucket issue #100. It gives the same behavior for inclusion of default files (README*, etc.) on Windows as Linux. BACKWARDS INCOMPATABILITY: This may result in a backwards incompatible change for users on a case insensitive file system. If they were relying on some files getting included in their distribution due to setuptools defaults, and their files do not have the same case as the files being looked for in setuptools, those files will no longer be included in the package. For example, if a package had a file: readme.rst Previous to this commit, that file would have been included in the distribution as: README.rst But it will now no longer be included at all. To get the file included in the package, it can be added to the package's MANIFEST.in file: include readme.rst Files affected by this change will have a case variant of the files or patterns listed below: README README.txt README.rst setup.py (or whatever your setuptools script is named) setup.cfg test/test*.py --- setuptools/command/sdist.py | 11 +++++++---- setuptools/tests/test_sdist.py | 28 ++++++++++++++++++++++++++++ setuptools/utils.py | 11 +++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 setuptools/utils.py (limited to 'setuptools') diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index 2aa1ee20..dc8d6773 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -8,6 +8,8 @@ import sys from setuptools import svn_utils from setuptools.compat import PY3 +from setuptools.utils import cs_path_exists + import pkg_resources READMES = ('README', 'README.rst', 'README.txt') @@ -146,7 +148,7 @@ class sdist(orig.sdist): alts = fn got_it = 0 for fn in alts: - if os.path.exists(fn): + if cs_path_exists(fn): got_it = 1 self.filelist.append(fn) break @@ -155,16 +157,17 @@ class sdist(orig.sdist): self.warn("standard file not found: should have one of " + ', '.join(alts)) else: - if os.path.exists(fn): + if cs_path_exists(fn): self.filelist.append(fn) else: self.warn("standard file '%s' not found" % fn) optional = ['test/test*.py', 'setup.cfg'] for pattern in optional: - files = list(filter(os.path.isfile, glob(pattern))) + files = list(filter(cs_path_exists, glob(pattern))) if files: - self.filelist.extend(files) + actual_fnames = map(os.path.normcase, files) + self.filelist.extend(actual_fnames) # getting python files if self.distribution.has_pure_modules(): diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index 5b3862e9..5f8a190f 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -86,6 +86,7 @@ class TestSdistTest(unittest.TestCase): f = open(os.path.join(self.temp_dir, 'setup.py'), 'w') f.write(SETUP_PY) f.close() + # Set up the rest of the test package test_pkg = os.path.join(self.temp_dir, 'sdist_test') os.mkdir(test_pkg) @@ -121,6 +122,33 @@ class TestSdistTest(unittest.TestCase): self.assertTrue(os.path.join('sdist_test', 'b.txt') in manifest) self.assertTrue(os.path.join('sdist_test', 'c.rst') not in manifest) + + def test_defaults_case_sensitivity(self): + """ + Make sure default files (README.*, etc.) are added in a case-sensitive + way to avoid problems with packages built on Windows. + """ + + open(os.path.join(self.temp_dir, 'readme.rst'), 'w').close() + open(os.path.join(self.temp_dir, 'SETUP.cfg'), 'w').close() + + dist = Distribution(SETUP_ATTRS) + # the extension deliberately capitalized for this test + # to make sure the actual filename (not capitalized) gets added + # to the manifest + dist.script_name = 'setup.PY' + cmd = sdist(dist) + cmd.ensure_finalized() + + with quiet(): + cmd.run() + + # lowercase all names so we can test in a case-insensitive way to make sure the files are not included + manifest = map(lambda x: x.lower(), cmd.filelist.files) + self.assertFalse('readme.rst' in manifest, manifest) + self.assertFalse('setup.py' in manifest, manifest) + self.assertFalse('setup.cfg' in manifest, manifest) + def test_manifest_is_written_with_utf8_encoding(self): # Test for #303. dist = Distribution(SETUP_ATTRS) diff --git a/setuptools/utils.py b/setuptools/utils.py new file mode 100644 index 00000000..91e4b87f --- /dev/null +++ b/setuptools/utils.py @@ -0,0 +1,11 @@ +import os +import os.path + + +def cs_path_exists(fspath): + if not os.path.exists(fspath): + return False + # make absolute so we always have a directory + abspath = os.path.abspath(fspath) + directory, filename = os.path.split(abspath) + return filename in os.listdir(directory) \ No newline at end of file -- cgit v1.2.3 From 1c05e6a7b7f2a54a55285857d498409df3dc9383 Mon Sep 17 00:00:00 2001 From: Randy Syring Date: Sat, 20 Sep 2014 16:37:25 -0400 Subject: remove unneeded code from last commit --- setuptools/command/sdist.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index dc8d6773..a77c39f2 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -166,8 +166,7 @@ class sdist(orig.sdist): for pattern in optional: files = list(filter(cs_path_exists, glob(pattern))) if files: - actual_fnames = map(os.path.normcase, files) - self.filelist.extend(actual_fnames) + self.filelist.extend(files) # getting python files if self.distribution.has_pure_modules(): -- cgit v1.2.3 From b0f93f3bdd1d67cce1dd03d4a6ecea8256fa4e55 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 25 Sep 2014 08:46:53 -0700 Subject: Adds monkeypatching for msvc9compiler.find_vcvarsall() to look for a standalone compiler installation and improves the error message for missing VC installation. --- setuptools/extension.py | 54 +++++++++++++ setuptools/tests/test_msvc9compiler.py | 135 +++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+) create mode 100644 setuptools/tests/test_msvc9compiler.py (limited to 'setuptools') diff --git a/setuptools/extension.py b/setuptools/extension.py index ab5908da..41a817b7 100644 --- a/setuptools/extension.py +++ b/setuptools/extension.py @@ -2,12 +2,66 @@ import sys import re import functools import distutils.core +import distutils.errors import distutils.extension +import distutils.msvc9compiler from setuptools.dist import _get_unpatched _Extension = _get_unpatched(distutils.core.Extension) +def _patch_msvc9compiler_find_vcvarsall(): + """ + Looks for the standalone VC for Python before falling back on + distutils's original approach. + """ + VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' + find_vcvarsall = distutils.msvc9compiler.find_vcvarsall + query_vcvarsall = distutils.msvc9compiler.query_vcvarsall + if find_vcvarsall and find_vcvarsall.__module__.startswith('setuptools.'): + # Already patched + return + + def _find_vcvarsall(version): + Reg = distutils.msvc9compiler.Reg + try: + # Per-user installs register the compiler path here + productdir = Reg.get_value(VC_BASE % ('', version), "installdir") + except KeyError: + try: + # All-user installs on a 64-bit system register here + productdir = Reg.get_value(VC_BASE % ('Wow6432Node\\', version), "installdir") + except KeyError: + productdir = None + + if productdir: + import os + vcvarsall = os.path.join(productdir, "vcvarsall.bat") + if os.path.isfile(vcvarsall): + return vcvarsall + + return find_vcvarsall(version) + + def _query_vcvarsall(version, *args, **kwargs): + try: + return query_vcvarsall(version, *args, **kwargs) + except distutils.errors.DistutilsPlatformError: + exc = sys.exc_info()[1] + if exc and "vcvarsall.bat" in exc.args[0]: + message = 'Microsoft Visual C++ %0.1f is required (%s).' % (version, exc.args[0]) + if int(version) == 9: + # This redirection link is maintained by Microsoft. + # Contact vspython@microsoft.com if it needs updating. + raise distutils.errors.DistutilsPlatformError( + message + ' Get it from http://aka.ms/vcpython27' + ) + raise distutils.errors.DistutilsPlatformError(message) + raise + + distutils.msvc9compiler.find_vcvarsall = _find_vcvarsall + distutils.msvc9compiler.query_vcvarsall = _query_vcvarsall +_patch_msvc9compiler_find_vcvarsall() + def have_pyrex(): """ Return True if Cython or Pyrex can be imported. diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py new file mode 100644 index 00000000..272e99e8 --- /dev/null +++ b/setuptools/tests/test_msvc9compiler.py @@ -0,0 +1,135 @@ +"""msvc9compiler monkey patch test + +This test ensures that importing setuptools is sufficient to replace +the standard find_vcvarsall function with our patched version that +finds the Visual C++ for Python package. +""" + +import os +import shutil +import sys +import tempfile +import unittest + +try: + from winreg import HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE +except ImportError: + from _winreg import HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE + +import distutils.msvc9compiler +from distutils.errors import DistutilsPlatformError + +# importing only setuptools should apply the patch +import setuptools + +class MockReg: + """Mock for distutils.msvc9compiler.Reg. We patch it + with an instance of this class that mocks out the + functions that access the registry. + """ + + def __init__(self, hkey_local_machine={}, hkey_current_user={}): + self.hklm = hkey_local_machine + self.hkcu = hkey_current_user + + def __enter__(self): + self.original_read_keys = distutils.msvc9compiler.Reg.read_keys + self.original_read_values = distutils.msvc9compiler.Reg.read_values + + hives = { + HKEY_CURRENT_USER: self.hkcu, + HKEY_LOCAL_MACHINE: self.hklm, + } + + def read_keys(cls, base, key): + """Return list of registry keys.""" + hive = hives.get(base, {}) + return [k.rpartition('\\')[2] + for k in hive if k.startswith(key.lower())] + + def read_values(cls, base, key): + """Return dict of registry keys and values.""" + hive = hives.get(base, {}) + return dict((k.rpartition('\\')[2], hive[k]) + for k in hive if k.startswith(key.lower())) + + distutils.msvc9compiler.Reg.read_keys = classmethod(read_keys) + distutils.msvc9compiler.Reg.read_values = classmethod(read_values) + + return self + + def __exit__(self, exc_type, exc_value, exc_tb): + distutils.msvc9compiler.Reg.read_keys = self.original_read_keys + distutils.msvc9compiler.Reg.read_values = self.original_read_values + +class TestMSVC9Compiler(unittest.TestCase): + + def test_find_vcvarsall_patch(self): + self.assertEqual( + "setuptools.extension", + distutils.msvc9compiler.find_vcvarsall.__module__, + "find_vcvarsall was not patched" + ) + + find_vcvarsall = distutils.msvc9compiler.find_vcvarsall + query_vcvarsall = distutils.msvc9compiler.query_vcvarsall + + # No registry entries or environment variable means we should + # not find anything + old_value = os.environ.pop("VS90COMNTOOLS", None) + try: + with MockReg(): + self.assertIsNone(find_vcvarsall(9.0)) + + try: + query_vcvarsall(9.0) + self.fail('Expected DistutilsPlatformError from query_vcvarsall()') + except DistutilsPlatformError: + exc_message = str(sys.exc_info()[1]) + self.assertIn('aka.ms/vcpython27', exc_message) + finally: + if old_value: + os.environ["VS90COMNTOOLS"] = old_value + + key_32 = r'software\microsoft\devdiv\vcforpython\9.0\installdir' + key_64 = r'software\wow6432node\microsoft\devdiv\vcforpython\9.0\installdir' + + # Make two mock files so we can tell whether HCKU entries are + # preferred to HKLM entries. + mock_installdir_1 = tempfile.mkdtemp() + mock_vcvarsall_bat_1 = os.path.join(mock_installdir_1, 'vcvarsall.bat') + open(mock_vcvarsall_bat_1, 'w').close() + mock_installdir_2 = tempfile.mkdtemp() + mock_vcvarsall_bat_2 = os.path.join(mock_installdir_2, 'vcvarsall.bat') + open(mock_vcvarsall_bat_2, 'w').close() + try: + # Ensure we get the current user's setting first + with MockReg( + hkey_current_user={ key_32: mock_installdir_1 }, + hkey_local_machine={ + key_32: mock_installdir_2, + key_64: mock_installdir_2, + } + ): + self.assertEqual(mock_vcvarsall_bat_1, find_vcvarsall(9.0)) + + # Ensure we get the local machine value if it's there + with MockReg(hkey_local_machine={ key_32: mock_installdir_2 }): + self.assertEqual(mock_vcvarsall_bat_2, find_vcvarsall(9.0)) + + # Ensure we prefer the 64-bit local machine key + # (*not* the Wow6432Node key) + with MockReg( + hkey_local_machine={ + # This *should* only exist on 32-bit machines + key_32: mock_installdir_1, + # This *should* only exist on 64-bit machines + key_64: mock_installdir_2, + } + ): + self.assertEqual(mock_vcvarsall_bat_1, find_vcvarsall(9.0)) + finally: + shutil.rmtree(mock_installdir_1) + shutil.rmtree(mock_installdir_2) + + \ No newline at end of file -- cgit v1.2.3 From 0e2681c1782320311e8cf144d4df923cfafc48c4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 11:30:01 -0400 Subject: Resave with excess whitespace removed --- setuptools/extension.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'setuptools') diff --git a/setuptools/extension.py b/setuptools/extension.py index 41a817b7..c695976a 100644 --- a/setuptools/extension.py +++ b/setuptools/extension.py @@ -21,7 +21,7 @@ def _patch_msvc9compiler_find_vcvarsall(): if find_vcvarsall and find_vcvarsall.__module__.startswith('setuptools.'): # Already patched return - + def _find_vcvarsall(version): Reg = distutils.msvc9compiler.Reg try: @@ -33,15 +33,15 @@ def _patch_msvc9compiler_find_vcvarsall(): productdir = Reg.get_value(VC_BASE % ('Wow6432Node\\', version), "installdir") except KeyError: productdir = None - + if productdir: import os vcvarsall = os.path.join(productdir, "vcvarsall.bat") if os.path.isfile(vcvarsall): return vcvarsall - + return find_vcvarsall(version) - + def _query_vcvarsall(version, *args, **kwargs): try: return query_vcvarsall(version, *args, **kwargs) -- cgit v1.2.3 From fb6baa09e5089c3984ee38da5f96b857c7e90c8f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 15:17:55 -0400 Subject: Move monkey patch to a separate module --- setuptools/extension.py | 56 +++------------------------------------------ setuptools/msvc9_support.py | 55 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 53 deletions(-) create mode 100644 setuptools/msvc9_support.py (limited to 'setuptools') diff --git a/setuptools/extension.py b/setuptools/extension.py index c695976a..8178ed33 100644 --- a/setuptools/extension.py +++ b/setuptools/extension.py @@ -4,63 +4,13 @@ import functools import distutils.core import distutils.errors import distutils.extension -import distutils.msvc9compiler -from setuptools.dist import _get_unpatched +from .dist import _get_unpatched +from . import msvc9_support _Extension = _get_unpatched(distutils.core.Extension) -def _patch_msvc9compiler_find_vcvarsall(): - """ - Looks for the standalone VC for Python before falling back on - distutils's original approach. - """ - VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' - find_vcvarsall = distutils.msvc9compiler.find_vcvarsall - query_vcvarsall = distutils.msvc9compiler.query_vcvarsall - if find_vcvarsall and find_vcvarsall.__module__.startswith('setuptools.'): - # Already patched - return - - def _find_vcvarsall(version): - Reg = distutils.msvc9compiler.Reg - try: - # Per-user installs register the compiler path here - productdir = Reg.get_value(VC_BASE % ('', version), "installdir") - except KeyError: - try: - # All-user installs on a 64-bit system register here - productdir = Reg.get_value(VC_BASE % ('Wow6432Node\\', version), "installdir") - except KeyError: - productdir = None - - if productdir: - import os - vcvarsall = os.path.join(productdir, "vcvarsall.bat") - if os.path.isfile(vcvarsall): - return vcvarsall - - return find_vcvarsall(version) - - def _query_vcvarsall(version, *args, **kwargs): - try: - return query_vcvarsall(version, *args, **kwargs) - except distutils.errors.DistutilsPlatformError: - exc = sys.exc_info()[1] - if exc and "vcvarsall.bat" in exc.args[0]: - message = 'Microsoft Visual C++ %0.1f is required (%s).' % (version, exc.args[0]) - if int(version) == 9: - # This redirection link is maintained by Microsoft. - # Contact vspython@microsoft.com if it needs updating. - raise distutils.errors.DistutilsPlatformError( - message + ' Get it from http://aka.ms/vcpython27' - ) - raise distutils.errors.DistutilsPlatformError(message) - raise - - distutils.msvc9compiler.find_vcvarsall = _find_vcvarsall - distutils.msvc9compiler.query_vcvarsall = _query_vcvarsall -_patch_msvc9compiler_find_vcvarsall() +msvc9_support.patch_for_specialized_compiler() def have_pyrex(): """ diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py new file mode 100644 index 00000000..fba2a71a --- /dev/null +++ b/setuptools/msvc9_support.py @@ -0,0 +1,55 @@ +import sys + +import distutils.msvc9compiler + +def patch_for_specialized_compiler(): + """ + Patch functions in distutils.msvc9compiler to use the standalone compiler + build for Python (Windows only). Fall back to original behavior when the + standalone compiler is not available. + """ + VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' + find_vcvarsall = distutils.msvc9compiler.find_vcvarsall + query_vcvarsall = distutils.msvc9compiler.query_vcvarsall + if find_vcvarsall and find_vcvarsall.__module__.startswith('setuptools.'): + # Already patched + return + + def _find_vcvarsall(version): + Reg = distutils.msvc9compiler.Reg + try: + # Per-user installs register the compiler path here + productdir = Reg.get_value(VC_BASE % ('', version), "installdir") + except KeyError: + try: + # All-user installs on a 64-bit system register here + productdir = Reg.get_value(VC_BASE % ('Wow6432Node\\', version), "installdir") + except KeyError: + productdir = None + + if productdir: + import os + vcvarsall = os.path.join(productdir, "vcvarsall.bat") + if os.path.isfile(vcvarsall): + return vcvarsall + + return find_vcvarsall(version) + + def _query_vcvarsall(version, *args, **kwargs): + try: + return query_vcvarsall(version, *args, **kwargs) + except distutils.errors.DistutilsPlatformError: + exc = sys.exc_info()[1] + if exc and "vcvarsall.bat" in exc.args[0]: + message = 'Microsoft Visual C++ %0.1f is required (%s).' % (version, exc.args[0]) + if int(version) == 9: + # This redirection link is maintained by Microsoft. + # Contact vspython@microsoft.com if it needs updating. + raise distutils.errors.DistutilsPlatformError( + message + ' Get it from http://aka.ms/vcpython27' + ) + raise distutils.errors.DistutilsPlatformError(message) + raise + + distutils.msvc9compiler.find_vcvarsall = _find_vcvarsall + distutils.msvc9compiler.query_vcvarsall = _query_vcvarsall -- cgit v1.2.3 From c735886bf4433d26f8c0679b722e46393a1dd92a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 15:21:56 -0400 Subject: Protect against import errors. --- setuptools/msvc9_support.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py index fba2a71a..f2e5cffc 100644 --- a/setuptools/msvc9_support.py +++ b/setuptools/msvc9_support.py @@ -1,13 +1,17 @@ import sys -import distutils.msvc9compiler - def patch_for_specialized_compiler(): """ Patch functions in distutils.msvc9compiler to use the standalone compiler build for Python (Windows only). Fall back to original behavior when the standalone compiler is not available. """ + try: + distutils = __import__('distutils.msvc9compiler') + except ImportError: + # The module isn't available to be patched + return + VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' find_vcvarsall = distutils.msvc9compiler.find_vcvarsall query_vcvarsall = distutils.msvc9compiler.query_vcvarsall -- cgit v1.2.3 From 15f29791a68addcb4e6166cd43f67c1f656f82d3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 17:08:20 -0400 Subject: Extract patched functions as top-level functions --- setuptools/msvc9_support.py | 78 ++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 37 deletions(-) (limited to 'setuptools') diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py index f2e5cffc..61ca8579 100644 --- a/setuptools/msvc9_support.py +++ b/setuptools/msvc9_support.py @@ -1,59 +1,63 @@ import sys +distutils = None +unpatched = dict() + def patch_for_specialized_compiler(): """ Patch functions in distutils.msvc9compiler to use the standalone compiler build for Python (Windows only). Fall back to original behavior when the standalone compiler is not available. """ + global distutils try: distutils = __import__('distutils.msvc9compiler') except ImportError: # The module isn't available to be patched return - VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' - find_vcvarsall = distutils.msvc9compiler.find_vcvarsall - query_vcvarsall = distutils.msvc9compiler.query_vcvarsall - if find_vcvarsall and find_vcvarsall.__module__.startswith('setuptools.'): + if unpatched: # Already patched return - def _find_vcvarsall(version): - Reg = distutils.msvc9compiler.Reg + unpatched.update(vars(distutils.msvc9compiler)) + + distutils.msvc9compiler.find_vcvarsall = find_vcvarsall + distutils.msvc9compiler.query_vcvarsall = query_vcvarsall + +def find_vcvarsall(version): + Reg = distutils.msvc9compiler.Reg + VC_BASE = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' + try: + # Per-user installs register the compiler path here + productdir = Reg.get_value(VC_BASE % ('', version), "installdir") + except KeyError: try: - # Per-user installs register the compiler path here - productdir = Reg.get_value(VC_BASE % ('', version), "installdir") + # All-user installs on a 64-bit system register here + productdir = Reg.get_value(VC_BASE % ('Wow6432Node\\', version), "installdir") except KeyError: - try: - # All-user installs on a 64-bit system register here - productdir = Reg.get_value(VC_BASE % ('Wow6432Node\\', version), "installdir") - except KeyError: - productdir = None + productdir = None - if productdir: - import os - vcvarsall = os.path.join(productdir, "vcvarsall.bat") - if os.path.isfile(vcvarsall): - return vcvarsall + if productdir: + import os + vcvarsall = os.path.join(productdir, "vcvarsall.bat") + if os.path.isfile(vcvarsall): + return vcvarsall - return find_vcvarsall(version) + return unpatched['find_vcvarsall'](version) - def _query_vcvarsall(version, *args, **kwargs): - try: - return query_vcvarsall(version, *args, **kwargs) - except distutils.errors.DistutilsPlatformError: - exc = sys.exc_info()[1] - if exc and "vcvarsall.bat" in exc.args[0]: - message = 'Microsoft Visual C++ %0.1f is required (%s).' % (version, exc.args[0]) - if int(version) == 9: - # This redirection link is maintained by Microsoft. - # Contact vspython@microsoft.com if it needs updating. - raise distutils.errors.DistutilsPlatformError( - message + ' Get it from http://aka.ms/vcpython27' - ) - raise distutils.errors.DistutilsPlatformError(message) - raise - - distutils.msvc9compiler.find_vcvarsall = _find_vcvarsall - distutils.msvc9compiler.query_vcvarsall = _query_vcvarsall +def query_vcvarsall(version, *args, **kwargs): + try: + return unpatched['query_vcvarsall'](version, *args, **kwargs) + except distutils.errors.DistutilsPlatformError: + exc = sys.exc_info()[1] + if exc and "vcvarsall.bat" in exc.args[0]: + message = 'Microsoft Visual C++ %0.1f is required (%s).' % (version, exc.args[0]) + if int(version) == 9: + # This redirection link is maintained by Microsoft. + # Contact vspython@microsoft.com if it needs updating. + raise distutils.errors.DistutilsPlatformError( + message + ' Get it from http://aka.ms/vcpython27' + ) + raise distutils.errors.DistutilsPlatformError(message) + raise -- cgit v1.2.3 From 84376ed5bb61c4a8a25048c83ad8d9fa60618db5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 17:09:44 -0400 Subject: Create global import more traditionally. Now the patched functions are available directly as well. --- setuptools/msvc9_support.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'setuptools') diff --git a/setuptools/msvc9_support.py b/setuptools/msvc9_support.py index 61ca8579..d0be70e2 100644 --- a/setuptools/msvc9_support.py +++ b/setuptools/msvc9_support.py @@ -1,6 +1,10 @@ import sys -distutils = None +try: + import distutils.msvc9compiler +except ImportError: + pass + unpatched = dict() def patch_for_specialized_compiler(): @@ -9,10 +13,7 @@ def patch_for_specialized_compiler(): build for Python (Windows only). Fall back to original behavior when the standalone compiler is not available. """ - global distutils - try: - distutils = __import__('distutils.msvc9compiler') - except ImportError: + if 'distutils' not in globals(): # The module isn't available to be patched return -- cgit v1.2.3 From 2d58fe235143f63f56e1207ab51e8ea6df1bb04d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 18:14:44 -0400 Subject: Remove excess whitespace --HG-- extra : amend_source : b8e14d29b2a36b84e30e22cf231d0b1730eeb7f4 --- setuptools/tests/test_msvc9compiler.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 272e99e8..33dca836 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -27,20 +27,20 @@ class MockReg: with an instance of this class that mocks out the functions that access the registry. """ - + def __init__(self, hkey_local_machine={}, hkey_current_user={}): self.hklm = hkey_local_machine self.hkcu = hkey_current_user - + def __enter__(self): self.original_read_keys = distutils.msvc9compiler.Reg.read_keys self.original_read_values = distutils.msvc9compiler.Reg.read_values - + hives = { HKEY_CURRENT_USER: self.hkcu, HKEY_LOCAL_MACHINE: self.hklm, } - + def read_keys(cls, base, key): """Return list of registry keys.""" hive = hives.get(base, {}) @@ -52,12 +52,12 @@ class MockReg: hive = hives.get(base, {}) return dict((k.rpartition('\\')[2], hive[k]) for k in hive if k.startswith(key.lower())) - + distutils.msvc9compiler.Reg.read_keys = classmethod(read_keys) distutils.msvc9compiler.Reg.read_values = classmethod(read_values) - + return self - + def __exit__(self, exc_type, exc_value, exc_tb): distutils.msvc9compiler.Reg.read_keys = self.original_read_keys distutils.msvc9compiler.Reg.read_values = self.original_read_values @@ -80,7 +80,7 @@ class TestMSVC9Compiler(unittest.TestCase): try: with MockReg(): self.assertIsNone(find_vcvarsall(9.0)) - + try: query_vcvarsall(9.0) self.fail('Expected DistutilsPlatformError from query_vcvarsall()') @@ -90,10 +90,10 @@ class TestMSVC9Compiler(unittest.TestCase): finally: if old_value: os.environ["VS90COMNTOOLS"] = old_value - + key_32 = r'software\microsoft\devdiv\vcforpython\9.0\installdir' key_64 = r'software\wow6432node\microsoft\devdiv\vcforpython\9.0\installdir' - + # Make two mock files so we can tell whether HCKU entries are # preferred to HKLM entries. mock_installdir_1 = tempfile.mkdtemp() @@ -105,7 +105,7 @@ class TestMSVC9Compiler(unittest.TestCase): try: # Ensure we get the current user's setting first with MockReg( - hkey_current_user={ key_32: mock_installdir_1 }, + hkey_current_user={key_32: mock_installdir_1}, hkey_local_machine={ key_32: mock_installdir_2, key_64: mock_installdir_2, @@ -114,7 +114,7 @@ class TestMSVC9Compiler(unittest.TestCase): self.assertEqual(mock_vcvarsall_bat_1, find_vcvarsall(9.0)) # Ensure we get the local machine value if it's there - with MockReg(hkey_local_machine={ key_32: mock_installdir_2 }): + with MockReg(hkey_local_machine={key_32: mock_installdir_2}): self.assertEqual(mock_vcvarsall_bat_2, find_vcvarsall(9.0)) # Ensure we prefer the 64-bit local machine key @@ -131,5 +131,3 @@ class TestMSVC9Compiler(unittest.TestCase): finally: shutil.rmtree(mock_installdir_1) shutil.rmtree(mock_installdir_2) - - \ No newline at end of file -- cgit v1.2.3 From d195bc900beccb22c8de243416c40564ea28402f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 18:25:32 -0400 Subject: Remove unused import --- setuptools/tests/test_msvc9compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 33dca836..3a2ef970 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -20,7 +20,7 @@ import distutils.msvc9compiler from distutils.errors import DistutilsPlatformError # importing only setuptools should apply the patch -import setuptools +__import__('setuptools') class MockReg: """Mock for distutils.msvc9compiler.Reg. We patch it -- cgit v1.2.3 From e87ba1aa48bb891bb29704d321754623956fef44 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 18:30:14 -0400 Subject: Move stable import into stdlib imports section --- setuptools/tests/test_msvc9compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 3a2ef970..74b5220b 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -10,6 +10,7 @@ import shutil import sys import tempfile import unittest +import distutils.errors try: from winreg import HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE @@ -17,7 +18,6 @@ except ImportError: from _winreg import HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE import distutils.msvc9compiler -from distutils.errors import DistutilsPlatformError # importing only setuptools should apply the patch __import__('setuptools') @@ -84,7 +84,7 @@ class TestMSVC9Compiler(unittest.TestCase): try: query_vcvarsall(9.0) self.fail('Expected DistutilsPlatformError from query_vcvarsall()') - except DistutilsPlatformError: + except distutils.errors.DistutilsPlatformError: exc_message = str(sys.exc_info()[1]) self.assertIn('aka.ms/vcpython27', exc_message) finally: -- cgit v1.2.3 From 57ff99e246a2fdb3d59e7aa977fe3b1e00924c99 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 18:38:39 -0400 Subject: Grab winreg module from distutils.msvc9compiler --- setuptools/tests/test_msvc9compiler.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 74b5220b..8f71c3d5 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -12,11 +12,6 @@ import tempfile import unittest import distutils.errors -try: - from winreg import HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE -except ImportError: - from _winreg import HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE - import distutils.msvc9compiler # importing only setuptools should apply the patch @@ -36,9 +31,12 @@ class MockReg: self.original_read_keys = distutils.msvc9compiler.Reg.read_keys self.original_read_values = distutils.msvc9compiler.Reg.read_values + _winreg = getattr(distutils.msvc9compiler, '_winreg', None) + winreg = getattr(distutils.msvc9compiler, 'winreg', _winreg) + hives = { - HKEY_CURRENT_USER: self.hkcu, - HKEY_LOCAL_MACHINE: self.hklm, + winreg.HKEY_CURRENT_USER: self.hkcu, + winreg.HKEY_LOCAL_MACHINE: self.hklm, } def read_keys(cls, base, key): -- cgit v1.2.3 From dfa59bff40dce47c485cdba1f28d1a8908e7e2be Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 18:47:55 -0400 Subject: Skip tests if msvc9compiler isn't available. --- setuptools/tests/test_msvc9compiler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 8f71c3d5..99afb10e 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -12,8 +12,6 @@ import tempfile import unittest import distutils.errors -import distutils.msvc9compiler - # importing only setuptools should apply the patch __import__('setuptools') @@ -63,6 +61,10 @@ class MockReg: class TestMSVC9Compiler(unittest.TestCase): def test_find_vcvarsall_patch(self): + if not hasattr(distutils, 'msvc9compiler'): + # skip + return + self.assertEqual( "setuptools.extension", distutils.msvc9compiler.find_vcvarsall.__module__, -- cgit v1.2.3 From 552e44fdce5a897f8e41efe07cf480759a59bb94 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 19:05:16 -0400 Subject: Extracting environment patcher --- setuptools/tests/test_msvc9compiler.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 99afb10e..80aac2f6 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -11,6 +11,7 @@ import sys import tempfile import unittest import distutils.errors +import contextlib # importing only setuptools should apply the patch __import__('setuptools') @@ -58,6 +59,25 @@ class MockReg: distutils.msvc9compiler.Reg.read_keys = self.original_read_keys distutils.msvc9compiler.Reg.read_values = self.original_read_values +@contextlib.contextmanager +def patch_env(**replacements): + saved = dict( + (key, os.environ['key']) + for key in replacements + if key in os.environ + ) + os.environ.update(replacements) + + # remove values that are null + null_keys = (key for (key, value) in replacements if value is None) + list(map(os.environ.pop, (null_keys))) + + yield + + for key in replacements: + os.environ.pop(key, None) + os.environ.update(saved) + class TestMSVC9Compiler(unittest.TestCase): def test_find_vcvarsall_patch(self): @@ -76,8 +96,7 @@ class TestMSVC9Compiler(unittest.TestCase): # No registry entries or environment variable means we should # not find anything - old_value = os.environ.pop("VS90COMNTOOLS", None) - try: + with patch_env(VS90COMNTOOLS=None): with MockReg(): self.assertIsNone(find_vcvarsall(9.0)) @@ -87,9 +106,6 @@ class TestMSVC9Compiler(unittest.TestCase): except distutils.errors.DistutilsPlatformError: exc_message = str(sys.exc_info()[1]) self.assertIn('aka.ms/vcpython27', exc_message) - finally: - if old_value: - os.environ["VS90COMNTOOLS"] = old_value key_32 = r'software\microsoft\devdiv\vcforpython\9.0\installdir' key_64 = r'software\wow6432node\microsoft\devdiv\vcforpython\9.0\installdir' -- cgit v1.2.3 From d501896d27cf94f62b80fe266d9369e681a32de6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 19:09:41 -0400 Subject: Correct test assertion --- setuptools/tests/test_msvc9compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 80aac2f6..02ced8cf 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -86,7 +86,7 @@ class TestMSVC9Compiler(unittest.TestCase): return self.assertEqual( - "setuptools.extension", + "setuptools.msvc9_support", distutils.msvc9compiler.find_vcvarsall.__module__, "find_vcvarsall was not patched" ) -- cgit v1.2.3 From 475e7c869bb60dba329a9642ff13bd10d1cbdced Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 19:11:04 -0400 Subject: Meant 'items' --- setuptools/tests/test_msvc9compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 02ced8cf..1c557d39 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -69,7 +69,7 @@ def patch_env(**replacements): os.environ.update(replacements) # remove values that are null - null_keys = (key for (key, value) in replacements if value is None) + null_keys = (key for (key, value) in replacements.items() if value is None) list(map(os.environ.pop, (null_keys))) yield -- cgit v1.2.3 From 813855aa5c9cb09c1e0faffcb80bfa2cb0cb2852 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 19:18:50 -0400 Subject: Avoid passing None values to os.environ. --- setuptools/tests/test_msvc9compiler.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 1c557d39..b2769759 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -66,13 +66,16 @@ def patch_env(**replacements): for key in replacements if key in os.environ ) - os.environ.update(replacements) # remove values that are null - null_keys = (key for (key, value) in replacements.items() if value is None) - list(map(os.environ.pop, (null_keys))) + remove = (key for (key, value) in replacements.items() if value is None) + for key in list(remove): + os.environ.pop(key, None) + replacements.pop(key) + + os.environ.update(replacements) - yield + yield saved for key in replacements: os.environ.pop(key, None) -- cgit v1.2.3 From 8759ca96ec6c6c318d65e0c93ca8b3c93f45e7f9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 19:20:32 -0400 Subject: Add docstring --- setuptools/tests/test_msvc9compiler.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index b2769759..ac5e3914 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -61,6 +61,10 @@ class MockReg: @contextlib.contextmanager def patch_env(**replacements): + """ + In a context, patch the environment with replacements. Pass None values + to clear the values. + """ saved = dict( (key, os.environ['key']) for key in replacements -- cgit v1.2.3 From 46a65a1a635cf3986c853907d1a16c5173cc125d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 26 Sep 2014 19:21:21 -0400 Subject: Always restore os.environ even if an exception occurs. --- setuptools/tests/test_msvc9compiler.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index ac5e3914..970f7679 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -79,11 +79,12 @@ def patch_env(**replacements): os.environ.update(replacements) - yield saved - - for key in replacements: - os.environ.pop(key, None) - os.environ.update(saved) + try: + yield saved + finally: + for key in replacements: + os.environ.pop(key, None) + os.environ.update(saved) class TestMSVC9Compiler(unittest.TestCase): -- cgit v1.2.3 From 39f98548e30b5e333276994fcaea4e529be4e40c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 27 Sep 2014 02:12:43 -0400 Subject: Bumped to 6.0 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 7244139e..5fa6331d 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.9' +__version__ = '6.0' -- cgit v1.2.3 From bb37802dc9f5bcaff5418438a88877b521208932 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 27 Sep 2014 02:13:23 -0400 Subject: Bumped to 6.1 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 5fa6331d..2d3f6733 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '6.0' +__version__ = '6.1' -- cgit v1.2.3 From 5802fd80e413b63af8be9198f14da1ade47d409c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 27 Sep 2014 09:29:53 -0400 Subject: Use rpartition here, essential to the algorithm. Fixes #259. --HG-- extra : amend_source : d7b3c001b4db616a67793dcc57d5c13e3828ad3a --- setuptools/command/install_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py index 3cd16a8f..9b772227 100644 --- a/setuptools/command/install_lib.py +++ b/setuptools/command/install_lib.py @@ -43,7 +43,7 @@ class install_lib(orig.install_lib): """ while pkg_name: yield pkg_name - pkg_name, sep, child = pkg_name.partition('.') + pkg_name, sep, child = pkg_name.rpartition('.') def _get_SVEM_NSPs(self): """ -- cgit v1.2.3 From 977e98de5785333c945cd61e4e5878d4484fc4c9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 27 Sep 2014 09:40:48 -0400 Subject: Bumped to 6.0.1 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index 2d3f6733..c4b0ef89 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '6.1' +__version__ = '6.0.1' -- cgit v1.2.3 From b08527744e3f6cec0412a5de5cae9837e403061a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 27 Sep 2014 09:41:26 -0400 Subject: Bumped to 6.0.2 in preparation for next release. --- setuptools/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/version.py b/setuptools/version.py index c4b0ef89..c974945d 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '6.0.1' +__version__ = '6.0.2' -- cgit v1.2.3 From 946652ee4def4236696a00d8873186bb07f15c71 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 29 Sep 2014 08:38:08 -0400 Subject: Backout 5692cd26a08e; Ref #262. --- setuptools/command/install_egg_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/command/install_egg_info.py b/setuptools/command/install_egg_info.py index 992709f1..fd0f118b 100755 --- a/setuptools/command/install_egg_info.py +++ b/setuptools/command/install_egg_info.py @@ -27,7 +27,7 @@ class install_egg_info(Command): ).egg_name() + '.egg-info' self.source = ei_cmd.egg_info self.target = os.path.join(self.install_dir, basename) - self.outputs = [] + self.outputs = [self.target] def run(self): self.run_command('egg_info') -- cgit v1.2.3