aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorstepshal <nessento@openmailbox.org>2016-10-18 20:24:35 +0700
committerstepshal <nessento@openmailbox.org>2016-10-18 20:29:34 +0700
commit31bd37c6ac8de9e8c1bacebc2d8e1215df91eb96 (patch)
tree3a25ce5765a8c9ae633a3eaeec1ce88f7b382e21 /setuptools
parentf774a0be095c3873c2881d393605fefa5ca0d0d6 (diff)
downloadexternal_python_setuptools-31bd37c6ac8de9e8c1bacebc2d8e1215df91eb96.tar.gz
external_python_setuptools-31bd37c6ac8de9e8c1bacebc2d8e1215df91eb96.tar.bz2
external_python_setuptools-31bd37c6ac8de9e8c1bacebc2d8e1215df91eb96.zip
Fix quantity of blank lines.
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/__init__.py1
-rwxr-xr-xsetuptools/archive_util.py1
-rw-r--r--setuptools/command/__init__.py1
-rw-r--r--setuptools/command/bdist_egg.py2
-rwxr-xr-xsetuptools/command/bdist_wininst.py1
-rw-r--r--setuptools/command/build_ext.py2
-rwxr-xr-xsetuptools/command/easy_install.py7
-rwxr-xr-xsetuptools/command/sdist.py2
-rwxr-xr-xsetuptools/command/setopt.py1
-rw-r--r--setuptools/command/test.py2
-rw-r--r--setuptools/extension.py1
-rw-r--r--setuptools/extern/__init__.py1
-rw-r--r--setuptools/glob.py11
-rw-r--r--setuptools/lib2to3_ex.py2
-rw-r--r--setuptools/monkey.py1
-rw-r--r--setuptools/msvc.py3
-rwxr-xr-xsetuptools/package_index.py7
-rw-r--r--setuptools/py26compat.py2
-rw-r--r--setuptools/py27compat.py1
-rw-r--r--setuptools/py31compat.py1
-rwxr-xr-xsetuptools/sandbox.py6
-rw-r--r--setuptools/ssl_support.py5
-rw-r--r--setuptools/tests/__init__.py4
-rw-r--r--setuptools/tests/server.py1
-rw-r--r--setuptools/tests/test_bdist_egg.py2
-rw-r--r--setuptools/tests/test_build_ext.py1
-rw-r--r--setuptools/tests/test_develop.py1
-rw-r--r--setuptools/tests/test_easy_install.py8
-rw-r--r--setuptools/tests/test_egg_info.py1
-rw-r--r--setuptools/tests/test_find_packages.py1
-rw-r--r--setuptools/tests/test_integration.py1
-rw-r--r--setuptools/tests/test_manifest.py4
-rw-r--r--setuptools/tests/test_packageindex.py3
-rw-r--r--setuptools/tests/test_sandbox.py6
-rw-r--r--setuptools/tests/test_sdist.py5
-rw-r--r--setuptools/tests/test_test.py1
-rw-r--r--setuptools/tests/test_upload_docs.py2
-rw-r--r--setuptools/tests/test_windows_wrappers.py2
38 files changed, 42 insertions, 62 deletions
diff --git a/setuptools/__init__.py b/setuptools/__init__.py
index baec3884..54577ced 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -102,7 +102,6 @@ class PackageFinder(object):
class PEP420PackageFinder(PackageFinder):
-
@staticmethod
def _looks_like_package(path):
return True
diff --git a/setuptools/archive_util.py b/setuptools/archive_util.py
index b6411cc5..cc82b3da 100755
--- a/setuptools/archive_util.py
+++ b/setuptools/archive_util.py
@@ -10,7 +10,6 @@ from distutils.errors import DistutilsError
from pkg_resources import ensure_directory, ContextualZipFile
-
__all__ = [
"unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter",
"UnrecognizedFormat", "extraction_drivers", "unpack_directory",
diff --git a/setuptools/command/__init__.py b/setuptools/command/__init__.py
index 3fb2f6df..efbe9411 100644
--- a/setuptools/command/__init__.py
+++ b/setuptools/command/__init__.py
@@ -10,7 +10,6 @@ import sys
from setuptools.command import install_scripts
-
if 'egg' not in bdist.format_commands:
bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
bdist.format_commands.append('egg')
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py
index cbea7537..8cd9dfef 100644
--- a/setuptools/command/bdist_egg.py
+++ b/setuptools/command/bdist_egg.py
@@ -429,10 +429,10 @@ def can_scan():
log.warn("Please ask the author to include a 'zip_safe'"
" setting (either True or False) in the package's setup.py")
+
# 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/bdist_wininst.py b/setuptools/command/bdist_wininst.py
index 8243c917..073de97b 100755
--- a/setuptools/command/bdist_wininst.py
+++ b/setuptools/command/bdist_wininst.py
@@ -2,7 +2,6 @@ import distutils.command.bdist_wininst as orig
class bdist_wininst(orig.bdist_wininst):
-
def reinitialize_command(self, command, reinit_subcommands=0):
"""
Supplement reinitialize_command to work around
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py
index 454c91fb..12dc88cd 100644
--- a/setuptools/command/build_ext.py
+++ b/setuptools/command/build_ext.py
@@ -56,7 +56,6 @@ elif os.name != 'nt':
except ImportError:
pass
-
if_dl = lambda s: s if have_rtld else ''
@@ -70,7 +69,6 @@ def get_abi3_suffix():
class build_ext(_build_ext):
-
def run(self):
"""Build extensions in build directory, then copy if --inplace"""
old_inplace, self.inplace = self.inplace, 0
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index a3792ce2..03dd6768 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python
-
"""
Easy Install
------------
@@ -64,7 +63,6 @@ import pkg_resources
# Turn on PEP440Warnings
warnings.filterwarnings("default", category=pkg_resources.PEP440Warning)
-
__all__ = [
'samefile', 'easy_install', 'PthDistributions', 'extract_wininst_cfg',
'main', 'get_exe_prefixes',
@@ -92,6 +90,7 @@ def samefile(p1, p2):
if six.PY2:
+
def _to_ascii(s):
return s
@@ -102,6 +101,7 @@ if six.PY2:
except UnicodeError:
return False
else:
+
def _to_ascii(s):
return s.encode('ascii')
@@ -1632,7 +1632,6 @@ class PthDistributions(Environment):
class RewritePthDistributions(PthDistributions):
-
@classmethod
def _wrap_lines(cls, lines):
yield cls.prelude
@@ -1837,6 +1836,7 @@ if '__pypy__' in sys.builtin_module_names:
_replace_zip_directory_cache_data = \
_remove_and_clear_zip_directory_cache_data
else:
+
def _replace_zip_directory_cache_data(normalized_path):
def replace_cached_zip_archive_directory_data(path, old_entry):
# N.B. In theory, we could load the zip directory information just
@@ -2164,7 +2164,6 @@ class WindowsScriptWriter(ScriptWriter):
class WindowsExecutableLauncherWriter(WindowsScriptWriter):
-
@classmethod
def _get_script_args(cls, type_, name, header, script_text):
"""
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py
index b85d7d03..9975753d 100755
--- a/setuptools/command/sdist.py
+++ b/setuptools/command/sdist.py
@@ -89,8 +89,10 @@ class sdist(sdist_add_defaults, orig.sdist):
"""
In a context, remove and restore os.link if it exists
"""
+
class NoValue:
pass
+
orig_val = getattr(os, 'link', NoValue)
try:
del os.link
diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py
index 7f332be5..7e57cc02 100755
--- a/setuptools/command/setopt.py
+++ b/setuptools/command/setopt.py
@@ -8,7 +8,6 @@ from setuptools.extern.six.moves import configparser
from setuptools import Command
-
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index 38bbcd8b..270674e2 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -17,7 +17,6 @@ from setuptools.py31compat import unittest_main
class ScanningLoader(TestLoader):
-
def loadTestsFromModule(self, module, pattern=None):
"""Return a suite of all tests cases contained in the given module
@@ -50,7 +49,6 @@ class ScanningLoader(TestLoader):
# adapted from jaraco.classes.properties:NonDataProperty
class NonDataProperty(object):
-
def __init__(self, fget):
self.fget = fget
diff --git a/setuptools/extension.py b/setuptools/extension.py
index 03068d35..29468894 100644
--- a/setuptools/extension.py
+++ b/setuptools/extension.py
@@ -26,7 +26,6 @@ def _have_cython():
# for compatibility
have_pyrex = _have_cython
-
_Extension = get_unpatched(distutils.core.Extension)
diff --git a/setuptools/extern/__init__.py b/setuptools/extern/__init__.py
index 6859aa5b..2cd08b7e 100644
--- a/setuptools/extern/__init__.py
+++ b/setuptools/extern/__init__.py
@@ -1,5 +1,4 @@
from pkg_resources.extern import VendorImporter
-
names = 'six',
VendorImporter(__name__, names, 'pkg_resources._vendor').install()
diff --git a/setuptools/glob.py b/setuptools/glob.py
index f51b9c83..6c781de3 100644
--- a/setuptools/glob.py
+++ b/setuptools/glob.py
@@ -14,6 +14,7 @@ from setuptools.extern.six import binary_type
__all__ = ["glob", "iglob", "escape"]
+
def glob(pathname, recursive=False):
"""Return a list of paths matching a pathname pattern.
@@ -27,6 +28,7 @@ def glob(pathname, recursive=False):
"""
return list(iglob(pathname, recursive=recursive))
+
def iglob(pathname, recursive=False):
"""Return an iterator which yields the paths matching a pathname pattern.
@@ -44,6 +46,7 @@ def iglob(pathname, recursive=False):
assert not s
return it
+
def _iglob(pathname, recursive):
dirname, basename = os.path.split(pathname)
if not has_magic(pathname):
@@ -81,10 +84,12 @@ def _iglob(pathname, recursive):
for name in glob_in_dir(dirname, basename):
yield os.path.join(dirname, name)
+
# These 2 helper functions non-recursively glob inside a literal directory.
# They return a list of basenames. `glob1` accepts a pattern while `glob0`
# takes a literal basename (so it only has to check for its existence).
+
def glob1(dirname, pattern):
if not dirname:
if isinstance(pattern, binary_type):
@@ -97,6 +102,7 @@ def glob1(dirname, pattern):
return []
return fnmatch.filter(names, pattern)
+
def glob0(dirname, basename):
if not basename:
# `os.path.split()` returns an empty basename for paths ending with a
@@ -108,9 +114,11 @@ def glob0(dirname, basename):
return [basename]
return []
+
# This helper function recursively yields relative pathnames inside a literal
# directory.
+
def glob2(dirname, pattern):
assert _isrecursive(pattern)
yield pattern[:0]
@@ -139,6 +147,7 @@ def _rlistdir(dirname):
magic_check = re.compile('([*?[])')
magic_check_bytes = re.compile(b'([*?[])')
+
def has_magic(s):
if isinstance(s, binary_type):
match = magic_check_bytes.search(s)
@@ -146,12 +155,14 @@ def has_magic(s):
match = magic_check.search(s)
return match is not None
+
def _isrecursive(pattern):
if isinstance(pattern, binary_type):
return pattern == b'**'
else:
return pattern == '**'
+
def escape(pathname):
"""Escape all special characters.
"""
diff --git a/setuptools/lib2to3_ex.py b/setuptools/lib2to3_ex.py
index c8632bc5..4b1a73fe 100644
--- a/setuptools/lib2to3_ex.py
+++ b/setuptools/lib2to3_ex.py
@@ -15,7 +15,6 @@ import setuptools
class DistutilsRefactoringTool(RefactoringTool):
-
def log_error(self, msg, *args, **kw):
log.error(msg, *args)
@@ -27,7 +26,6 @@ class DistutilsRefactoringTool(RefactoringTool):
class Mixin2to3(_Mixin2to3):
-
def run_2to3(self, files, doctests=False):
# See of the distribution option has been set, otherwise check the
# setuptools default.
diff --git a/setuptools/monkey.py b/setuptools/monkey.py
index 43b97b4d..aabc280f 100644
--- a/setuptools/monkey.py
+++ b/setuptools/monkey.py
@@ -13,7 +13,6 @@ from setuptools.extern import six
import setuptools
-
__all__ = []
"""
Everything is private. Contact the project team
diff --git a/setuptools/msvc.py b/setuptools/msvc.py
index e9665e10..ef85f64a 100644
--- a/setuptools/msvc.py
+++ b/setuptools/msvc.py
@@ -34,11 +34,13 @@ else:
Mock winreg and environ so the module can be imported
on this platform.
"""
+
class winreg:
HKEY_USERS = None
HKEY_CURRENT_USER = None
HKEY_LOCAL_MACHINE = None
HKEY_CLASSES_ROOT = None
+
safe_env = dict()
try:
@@ -458,6 +460,7 @@ class SystemInfo:
vc_ver: float
Required Microsoft Visual C++ version.
"""
+
# Variables and properties in this class use originals CamelCase variables
# names from Microsoft source files for more easy comparaison.
WinDir = safe_env.get('WinDir', '')
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 3e8d6818..3bb97154 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -47,7 +47,6 @@ __all__ = [
_SOCKET_TIMEOUT = 15
-
_tmpl = "setuptools/{setuptools.__version__} Python-urllib/{py_major}"
user_agent = _tmpl.format(py_major=sys.version[:3], **globals())
@@ -198,9 +197,11 @@ def unique_values(func):
Wrap a function returning an iterable such that the resulting iterable
only ever yields unique items.
"""
+
@wraps(func)
def wrapper(*args, **kwargs):
return unique_everseen(func(*args, **kwargs))
+
return wrapper
@@ -415,6 +416,7 @@ class PackageIndex(Environment):
def process_index(self, url, page):
"""Process the contents of a PyPI page"""
+
def scan(link):
# Process a URL to see if it's for a package page
if link.startswith(self.index_url):
@@ -946,7 +948,9 @@ def socket_timeout(timeout=15):
return func(*args, **kwargs)
finally:
socket.setdefaulttimeout(old_timeout)
+
return _socket_timeout
+
return _socket_timeout
@@ -991,7 +995,6 @@ class Credential(object):
class PyPIConfig(configparser.RawConfigParser):
-
def __init__(self):
"""
Load from ~/.pypirc
diff --git a/setuptools/py26compat.py b/setuptools/py26compat.py
index 5778cdf1..4d3add8c 100644
--- a/setuptools/py26compat.py
+++ b/setuptools/py26compat.py
@@ -23,9 +23,9 @@ def strip_fragment(url):
if sys.version_info >= (2, 7):
strip_fragment = lambda x: x
-
try:
from importlib import import_module
except ImportError:
+
def import_module(module_name):
return __import__(module_name, fromlist=['__name__'])
diff --git a/setuptools/py27compat.py b/setuptools/py27compat.py
index 57eb150b..4e3e4ab3 100644
--- a/setuptools/py27compat.py
+++ b/setuptools/py27compat.py
@@ -13,5 +13,6 @@ def get_all_headers(message, key):
if sys.version_info < (3,):
+
def get_all_headers(message, key):
return message.getheaders(key)
diff --git a/setuptools/py31compat.py b/setuptools/py31compat.py
index 1e959e28..44b025d4 100644
--- a/setuptools/py31compat.py
+++ b/setuptools/py31compat.py
@@ -14,6 +14,7 @@ except ImportError:
raise ValueError("Name must be purelib or platlib")
return get_python_lib(name == 'platlib')
+
try:
# Python >=3.2
from tempfile import TemporaryDirectory
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py
index 2babb636..53ce1551 100755
--- a/setuptools/sandbox.py
+++ b/setuptools/sandbox.py
@@ -99,6 +99,7 @@ class UnpickleableException(Exception):
"""
An exception representing another Exception that could not be pickled.
"""
+
@staticmethod
def dump(type, exc):
"""
@@ -243,6 +244,7 @@ def run_setup(setup_script, args):
def runner():
ns = dict(__file__=setup_script, __name__='__main__')
_execfile(setup_script, ns)
+
DirectorySandbox(setup_dir).run(runner)
except SystemExit as v:
if v.args and v.args[0]:
@@ -301,6 +303,7 @@ class AbstractSandbox:
if self._active:
path = self._remap_input(name, path, *args, **kw)
return original(path, *args, **kw)
+
return wrap
if _file:
@@ -322,6 +325,7 @@ class AbstractSandbox:
path = self._remap_input(name, path, *args, **kw)
return self._remap_output(name, original(path, *args, **kw))
return original(path, *args, **kw)
+
return wrap
for name in ['readlink', 'tempnam']:
@@ -336,6 +340,7 @@ class AbstractSandbox:
if self._active:
return self._remap_output(name, retval)
return retval
+
return wrap
for name in ['getcwd', 'tmpnam']:
@@ -404,6 +409,7 @@ class DirectorySandbox(AbstractSandbox):
raise SandboxViolation(operation, args, kw)
if _file:
+
def _file(self, path, mode='r', *args, **kw):
if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path):
self._violation("file", path, mode, *args, **kw)
diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py
index 16272630..82f8870a 100644
--- a/setuptools/ssl_support.py
+++ b/setuptools/ssl_support.py
@@ -29,7 +29,6 @@ cert_paths = """
/etc/ssl/ca-bundle.pem
""".strip().split()
-
try:
HTTPSHandler = urllib.request.HTTPSHandler
HTTPSConnection = http_client.HTTPSConnection
@@ -50,10 +49,13 @@ except ImportError:
match_hostname = None
if not CertificateError:
+
class CertificateError(ValueError):
pass
+
if not match_hostname:
+
def _dnsname_match(dn, hostname, max_wildcards=1):
"""Matching according to RFC 6125, section 6.4.3
@@ -216,7 +218,6 @@ def get_win_certfile():
return None
class MyCertFile(CertFile):
-
def __init__(self, stores=(), certs=()):
CertFile.__init__(self)
for store in stores:
diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py
index 53bd836c..dbf16201 100644
--- a/setuptools/tests/__init__.py
+++ b/setuptools/tests/__init__.py
@@ -42,7 +42,6 @@ needs_bytecode = pytest.mark.skipif(
class TestDepends:
-
def testExtractConst(self):
if not hasattr(dep, 'extract_constant'):
# skip on non-bytecode platforms
@@ -123,7 +122,6 @@ class TestDepends:
class TestDistro:
-
def setup_method(self, method):
self.e1 = Extension('bar.ext', ['bar.c'])
self.e2 = Extension('c.y', ['y.c'])
@@ -214,7 +212,6 @@ class TestDistro:
class TestFeatures:
-
def setup_method(self, method):
self.req = Require('Distutils', '1.0.3', 'distutils')
self.dist = makeSetup(
@@ -292,7 +289,6 @@ class TestFeatures:
class TestCommandTests:
-
def testTestIsCommand(self):
test_cmd = makeSetup().get_command_obj('test')
assert (isinstance(test_cmd, distutils.cmd.Command))
diff --git a/setuptools/tests/server.py b/setuptools/tests/server.py
index 9e5fefb7..35312120 100644
--- a/setuptools/tests/server.py
+++ b/setuptools/tests/server.py
@@ -45,7 +45,6 @@ class IndexServer(BaseHTTPServer.HTTPServer):
class RequestRecorder(BaseHTTPServer.BaseHTTPRequestHandler):
-
def do_GET(self):
requests = vars(self.server).setdefault('requests', [])
requests.append(self)
diff --git a/setuptools/tests/test_bdist_egg.py b/setuptools/tests/test_bdist_egg.py
index c77aa226..5aabf404 100644
--- a/setuptools/tests/test_bdist_egg.py
+++ b/setuptools/tests/test_bdist_egg.py
@@ -9,7 +9,6 @@ from setuptools.dist import Distribution
from . import contexts
-
SETUP_PY = """\
from setuptools import setup
@@ -28,7 +27,6 @@ def setup_context(tmpdir):
class Test:
-
def test_bdist_egg(self, setup_context, user_override):
dist = Distribution(dict(
script_name='setup.py',
diff --git a/setuptools/tests/test_build_ext.py b/setuptools/tests/test_build_ext.py
index ac002f44..60257154 100644
--- a/setuptools/tests/test_build_ext.py
+++ b/setuptools/tests/test_build_ext.py
@@ -10,7 +10,6 @@ from setuptools.extension import Extension
class TestBuildExt:
-
def test_get_ext_filename(self):
"""
Setuptools needs to give back the same
diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py
index f1580785..4cf483f2 100644
--- a/setuptools/tests/test_develop.py
+++ b/setuptools/tests/test_develop.py
@@ -13,7 +13,6 @@ from setuptools.command.develop import develop
from setuptools.dist import Distribution
from . import contexts
-
SETUP_PY = """\
from setuptools import setup
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 82e1d7e8..209e6b78 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-
"""Easy install Tests
"""
from __future__ import absolute_import
@@ -42,7 +41,6 @@ from .textwrap import DALS
class FakeDist(object):
-
def get_entry_map(self, group):
if group != 'console_scripts':
return {}
@@ -60,7 +58,6 @@ SETUP_PY = DALS("""
class TestEasyInstallTest:
-
def test_install_site_py(self, tmpdir):
dist = Distribution()
cmd = ei.easy_install(dist)
@@ -194,7 +191,6 @@ class TestEasyInstallTest:
class TestPTHFileWriter:
-
def test_add_from_cwd_site_sets_dirty(self):
'''a pth file manager should set dirty
if a distribution is in site but also the cwd
@@ -328,13 +324,11 @@ def distutils_package():
class TestDistutilsPackage:
-
def test_bdist_egg_available_on_distutils_pkg(self, distutils_package):
run_setup('setup.py', ['bdist_egg'])
class TestSetupRequires:
-
def test_setup_requires_honors_fetch_params(self):
"""
When easy_install installs a source distribution which specifies
@@ -623,7 +617,6 @@ class TestScriptHeader:
class TestCommandSpec:
-
def test_custom_launch_command(self):
"""
Show how a custom CommandSpec could be used to specify a #! executable
@@ -659,7 +652,6 @@ class TestCommandSpec:
class TestWindowsScriptWriter:
-
def test_header(self):
hdr = ei.WindowsScriptWriter.get_script_header('')
assert hdr.startswith('#!')
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 4c767826..12c10497 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -262,7 +262,6 @@ class TestEggInfo(object):
def _find_egg_info_files(self, root):
class DirList(list):
-
def __init__(self, files, base):
super(DirList, self).__init__(files)
self.base = base
diff --git a/setuptools/tests/test_find_packages.py b/setuptools/tests/test_find_packages.py
index 6dc1b3ac..a6023de9 100644
--- a/setuptools/tests/test_find_packages.py
+++ b/setuptools/tests/test_find_packages.py
@@ -38,7 +38,6 @@ def has_symlink():
class TestFindPackages:
-
def setup_method(self, method):
self.dist_dir = tempfile.mkdtemp()
self._make_pkg_structure()
diff --git a/setuptools/tests/test_integration.py b/setuptools/tests/test_integration.py
index 04772ba5..78fb0627 100644
--- a/setuptools/tests/test_integration.py
+++ b/setuptools/tests/test_integration.py
@@ -49,6 +49,7 @@ def install_context(request, tmpdir, monkeypatch):
user_base.remove()
user_site.remove()
install_dir.remove()
+
request.addfinalizer(fin)
# Change the environment and site settings to control where the
diff --git a/setuptools/tests/test_manifest.py b/setuptools/tests/test_manifest.py
index 8bcf4f5c..602c43a2 100644
--- a/setuptools/tests/test_manifest.py
+++ b/setuptools/tests/test_manifest.py
@@ -30,7 +30,6 @@ SETUP_ATTRS = {
'packages': ['app'],
}
-
SETUP_PY = """\
from setuptools import setup
@@ -95,7 +94,6 @@ def test_translated_pattern_test():
class TempDirTestCase(object):
-
def setup_method(self, method):
self.temp_dir = tempfile.mkdtemp()
self.old_cwd = os.getcwd()
@@ -107,14 +105,12 @@ class TempDirTestCase(object):
class TestManifestTest(TempDirTestCase):
-
def setup_method(self, method):
super(TestManifestTest, self).setup_method(method)
f = open(os.path.join(self.temp_dir, 'setup.py'), 'w')
f.write(SETUP_PY)
f.close()
-
"""
Create a file tree like:
- LICENSE
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index f9bf895b..f09dd78c 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -14,7 +14,6 @@ from .textwrap import DALS
class TestPackageIndex:
-
def test_regex(self):
hash_url = 'http://other_url?:action=show_md5&amp;'
hash_url += 'digest=0123456789abcdef0123456789abcdef'
@@ -184,7 +183,6 @@ class TestPackageIndex:
class TestContentCheckers:
-
def test_md5(self):
checker = setuptools.package_index.HashChecker.from_url(
'http://foo/bar#md5=f12895fdffbd45007040d2e44df98478')
@@ -219,7 +217,6 @@ class TestContentCheckers:
class TestPyPIConfig:
-
def test_percent_in_password(self, tmpdir, monkeypatch):
monkeypatch.setitem(os.environ, 'HOME', str(tmpdir))
pypirc = tmpdir / '.pypirc'
diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py
index aa6138e4..b92a477a 100644
--- a/setuptools/tests/test_sandbox.py
+++ b/setuptools/tests/test_sandbox.py
@@ -11,7 +11,6 @@ from setuptools.sandbox import DirectorySandbox
class TestSandbox:
-
def test_devnull(self, tmpdir):
sandbox = DirectorySandbox(str(tmpdir))
sandbox.run(self._file_writer(os.devnull))
@@ -21,6 +20,7 @@ class TestSandbox:
def do_write():
with open(path, 'w') as f:
f.write('xxx')
+
return do_write
def test_win32com(self, tmpdir):
@@ -57,7 +57,6 @@ class TestSandbox:
class TestExceptionSaver:
-
def test_exception_trapped(self):
with setuptools.sandbox.ExceptionSaver():
raise ValueError("details")
@@ -107,6 +106,7 @@ class TestExceptionSaver:
As revealed in #440, an infinite recursion can occur if an unpickleable
exception while setuptools is hidden. Ensure this doesn't happen.
"""
+
class ExceptionUnderTest(Exception):
"""
An unpickleable exception (not in globals).
@@ -126,10 +126,12 @@ class TestExceptionSaver:
should reflect a proper exception and not be wrapped in
an UnpickleableException.
"""
+
def write_file():
"Trigger a SandboxViolation by writing outside the sandbox"
with open('/etc/foo', 'w'):
pass
+
sandbox = DirectorySandbox(str(tmpdir))
with pytest.raises(setuptools.sandbox.SandboxViolation) as caught:
with setuptools.sandbox.save_modules():
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py
index 16d0eb07..609c7830 100644
--- a/setuptools/tests/test_sdist.py
+++ b/setuptools/tests/test_sdist.py
@@ -20,10 +20,8 @@ from setuptools.command.egg_info import manifest_maker
from setuptools.dist import Distribution
from setuptools.tests import fail_on_ascii
-
py3_only = pytest.mark.xfail(six.PY2, reason="Test runs on Python 3 only")
-
SETUP_ATTRS = {
'name': 'sdist_test',
'version': '0.0',
@@ -31,14 +29,12 @@ SETUP_ATTRS = {
'package_data': {'sdist_test': ['*.txt']}
}
-
SETUP_PY = """\
from setuptools import setup
setup(**%r)
""" % SETUP_ATTRS
-
if six.PY3:
LATIN1_FILENAME = 'smörbröd.py'.encode('latin-1')
else:
@@ -90,7 +86,6 @@ def read_all_bytes(filename):
class TestSdistTest:
-
def setup_method(self, method):
self.temp_dir = tempfile.mkdtemp()
f = open(os.path.join(self.temp_dir, 'setup.py'), 'w')
diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py
index 4155a5b1..7ea43c57 100644
--- a/setuptools/tests/test_test.py
+++ b/setuptools/tests/test_test.py
@@ -70,7 +70,6 @@ def sample_test(tmpdir_cwd):
@pytest.mark.usefixtures('user_override')
@pytest.mark.usefixtures('sample_test')
class TestTestTest:
-
def test_test(self):
params = dict(
name='foo',
diff --git a/setuptools/tests/test_upload_docs.py b/setuptools/tests/test_upload_docs.py
index d3dee616..5d50bb0b 100644
--- a/setuptools/tests/test_upload_docs.py
+++ b/setuptools/tests/test_upload_docs.py
@@ -10,7 +10,6 @@ from setuptools.dist import Distribution
from .textwrap import DALS
from . import contexts
-
SETUP_PY = DALS(
"""
from setuptools import setup
@@ -38,7 +37,6 @@ def sample_project(tmpdir_cwd):
@pytest.mark.usefixtures('sample_project')
@pytest.mark.usefixtures('user_override')
class TestUploadDocsTest:
-
def test_create_zipfile(self):
"""
Ensure zipfile creation handles common cases, including a folder
diff --git a/setuptools/tests/test_windows_wrappers.py b/setuptools/tests/test_windows_wrappers.py
index 5b14d07b..d2871c0f 100644
--- a/setuptools/tests/test_windows_wrappers.py
+++ b/setuptools/tests/test_windows_wrappers.py
@@ -23,12 +23,10 @@ import pytest
from setuptools.command.easy_install import nt_quote_arg
import pkg_resources
-
pytestmark = pytest.mark.skipif(sys.platform != 'win32', reason="Windows only")
class WrapperTester:
-
@classmethod
def prep_script(cls, template):
python_exe = nt_quote_arg(sys.executable)