diff options
-rwxr-xr-x | setup.py | 1 | ||||
-rw-r--r-- | setuptools/__init__.py | 2 | ||||
-rwxr-xr-x | setuptools/archive_util.py | 1 | ||||
-rw-r--r-- | setuptools/command/bdist_egg.py | 1 | ||||
-rwxr-xr-x | setuptools/command/easy_install.py | 2 | ||||
-rw-r--r-- | setuptools/depends.py | 1 | ||||
-rw-r--r-- | setuptools/dist.py | 6 | ||||
-rw-r--r-- | setuptools/extension.py | 2 | ||||
-rwxr-xr-x | setuptools/package_index.py | 3 | ||||
-rw-r--r-- | setuptools/py26compat.py | 1 | ||||
-rw-r--r-- | setuptools/py27compat.py | 1 | ||||
-rwxr-xr-x | setuptools/sandbox.py | 1 | ||||
-rw-r--r-- | setuptools/site-patch.py | 1 | ||||
-rw-r--r-- | setuptools/tests/py26compat.py | 1 | ||||
-rw-r--r-- | setuptools/tests/test_easy_install.py | 1 | ||||
-rw-r--r-- | tests/manual_test.py | 2 |
16 files changed, 27 insertions, 0 deletions
@@ -47,6 +47,7 @@ def _gen_console_scripts(): yield ("easy_install-{shortver} = setuptools.command.easy_install:main" .format(shortver=sys.version[:3])) + console_scripts = list(_gen_console_scripts()) readme_file = io.open('README.rst', encoding='utf-8') diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 2523ccc7..cf0c39f2 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -116,6 +116,7 @@ class PEP420PackageFinder(PackageFinder): def _looks_like_package(path): return True + find_packages = PackageFinder.find setup = distutils.core.setup @@ -141,6 +142,7 @@ class Command(_Command): vars(cmd).update(kw) return cmd + # we can't patch distutils.cmd, alas distutils.core.Command = Command diff --git a/setuptools/archive_util.py b/setuptools/archive_util.py index 3b41db15..24d4e7bb 100755 --- a/setuptools/archive_util.py +++ b/setuptools/archive_util.py @@ -169,4 +169,5 @@ def unpack_tarfile(filename, extract_dir, progress_filter=default_filter): pass return True + extraction_drivers = unpack_directory, unpack_zipfile, unpack_tarfile diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index c40022a1..50744b87 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -432,6 +432,7 @@ def can_scan(): # Attribute names of options for commands that might need to be convinced to # install to the egg build directory + INSTALL_DIRECTORY_ATTRS = [ 'install_lib', 'install_dir', 'install_data', 'install_base' ] diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 73bdb0cb..5ce529b2 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1831,6 +1831,7 @@ def _remove_and_clear_zip_directory_cache_data(normalized_path): normalized_path, zipimport._zip_directory_cache, updater=clear_and_remove_cached_zip_archive_directory_data) + # PyPy Python implementation does not allow directly writing to the # zipimport._zip_directory_cache and so prevents us from attempting to correct # its content. The best we can do there is clear the problematic cache content @@ -1990,6 +1991,7 @@ class CommandSpec(list): cmdline = subprocess.list2cmdline(items) return '#!' + cmdline + '\n' + # For pbr compat; will be removed in a future version. sys_executable = CommandSpec._sys_executable() diff --git a/setuptools/depends.py b/setuptools/depends.py index 75344590..d5a344ad 100644 --- a/setuptools/depends.py +++ b/setuptools/depends.py @@ -213,4 +213,5 @@ def _update_globals(): del globals()[name] __all__.remove(name) + _update_globals() diff --git a/setuptools/dist.py b/setuptools/dist.py index bfdbb3b5..0a192553 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -36,12 +36,14 @@ def _get_unpatched(cls): ) return cls + _Distribution = _get_unpatched(_Distribution) def _patch_distribution_metadata_write_pkg_file(): """Patch write_pkg_file to also write Requires-Python/Requires-External""" original_write = distutils.dist.DistributionMetadata.write_pkg_file + def write_pkg_file(self, file): """Write the PKG-INFO format data to a file object. """ @@ -50,6 +52,8 @@ def _patch_distribution_metadata_write_pkg_file(): file.write('Requires-Python: %s\n' % self.python_requires) distutils.dist.DistributionMetadata.write_pkg_file = write_pkg_file + + _patch_distribution_metadata_write_pkg_file() @@ -72,6 +76,8 @@ def _patch_distribution_metadata_write_pkg_info(): self.write_pkg_file(pkg_info) distutils.dist.DistributionMetadata.write_pkg_info = write_pkg_info + + _patch_distribution_metadata_write_pkg_info() sequence = tuple, list diff --git a/setuptools/extension.py b/setuptools/extension.py index d265b7a3..5ea72c06 100644 --- a/setuptools/extension.py +++ b/setuptools/extension.py @@ -28,6 +28,7 @@ def _have_cython(): pass return False + # for compatibility have_pyrex = _have_cython @@ -53,6 +54,7 @@ class Extension(_Extension): class Library(Extension): """Just like a regular Extension, but built as a library instead""" + distutils.core.Extension = Extension distutils.extension.Extension = Extension if 'distutils.command.build_ext' in sys.modules: diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 77f5f96e..0ea09bd6 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -194,6 +194,7 @@ def unique_values(func): return unique_everseen(func(*args, **kwargs)) return wrapper + REL = re.compile("""<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>""", re.I) # this line is here to fix emacs' cruddy broken syntax highlighting @@ -894,6 +895,7 @@ class PackageIndex(Environment): def warn(self, msg, *args): log.warn(msg, *args) + # This pattern matches a character entity reference (a decimal numeric # references, a hexadecimal numeric reference, or a named reference). entity_sub = re.compile(r'&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?').sub @@ -1059,6 +1061,7 @@ def open_with_auth(url, opener=urllib.request.urlopen): return fp + # adding a timeout to avoid freezing package_index open_with_auth = socket_timeout(_SOCKET_TIMEOUT)(open_with_auth) diff --git a/setuptools/py26compat.py b/setuptools/py26compat.py index 7c60c90e..90cd695a 100644 --- a/setuptools/py26compat.py +++ b/setuptools/py26compat.py @@ -19,5 +19,6 @@ def strip_fragment(url): url, fragment = splittag(url) return url + if sys.version_info >= (2, 7): strip_fragment = lambda x: x diff --git a/setuptools/py27compat.py b/setuptools/py27compat.py index 66aecc2a..57eb150b 100644 --- a/setuptools/py27compat.py +++ b/setuptools/py27compat.py @@ -11,6 +11,7 @@ def get_all_headers(message, key): """ return message.get_all(key) + if sys.version_info < (3,): def get_all_headers(message, key): return message.getheaders(key) diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index c89593b1..df630d3e 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -460,6 +460,7 @@ class DirectorySandbox(AbstractSandbox): self._violation("os.open", file, flags, mode, *args, **kw) return _os.open(file, flags, mode, *args, **kw) + WRITE_FLAGS = functools.reduce( operator.or_, [getattr(_os, a, 0) for a in "O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARY".split()] diff --git a/setuptools/site-patch.py b/setuptools/site-patch.py index a7d13fcd..f09ab522 100644 --- a/setuptools/site-patch.py +++ b/setuptools/site-patch.py @@ -68,6 +68,7 @@ def __boot(): sys.path[:] = new_path + if __name__ == 'site': __boot() del __boot diff --git a/setuptools/tests/py26compat.py b/setuptools/tests/py26compat.py index 5325dad6..18cece05 100644 --- a/setuptools/tests/py26compat.py +++ b/setuptools/tests/py26compat.py @@ -9,6 +9,7 @@ def _tarfile_open_ex(*args, **kwargs): """ return contextlib.closing(tarfile.open(*args, **kwargs)) + if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[:2] < (3, 2): tarfile_open = _tarfile_open_ex else: diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index aa905f5a..2c17ac76 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -50,6 +50,7 @@ class FakeDist(object): def as_requirement(self): return 'spec' + SETUP_PY = DALS(""" from setuptools import setup diff --git a/tests/manual_test.py b/tests/manual_test.py index 0904b607..9987e662 100644 --- a/tests/manual_test.py +++ b/tests/manual_test.py @@ -27,6 +27,7 @@ def tempdir(func): shutil.rmtree(test_dir) return _tempdir + SIMPLE_BUILDOUT = """\ [buildout] @@ -90,6 +91,7 @@ def test_full(): assert eggs == ['extensions-0.3-py2.6.egg', 'zc.recipe.egg-1.2.2-py2.6.egg'] + if __name__ == '__main__': test_virtualenv() test_full() |