Commit fd3ff004 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #662 from stepshal/blank_lines

Add missing blank lines after class or function definition.
parents 966e2fa4 39bf3155
......@@ -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')
......
......@@ -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
......
......@@ -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
......@@ -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'
]
......
......@@ -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()
......
......@@ -213,4 +213,5 @@ def _update_globals():
del globals()[name]
__all__.remove(name)
_update_globals()
......@@ -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
......
......@@ -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:
......
......@@ -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)
......
......@@ -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
......@@ -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)
......@@ -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()]
......
......@@ -68,6 +68,7 @@ def __boot():
sys.path[:] = new_path
if __name__ == 'site':
__boot()
del __boot
......@@ -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:
......
......@@ -50,6 +50,7 @@ class FakeDist(object):
def as_requirement(self):
return 'spec'
SETUP_PY = DALS("""
from setuptools import setup
......
......@@ -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()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment