summaryrefslogtreecommitdiff
path: root/setuptools
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/command/bdist_egg.py14
-rw-r--r--setuptools/extension.py2
-rwxr-xr-xsetuptools/package_index.py15
-rw-r--r--setuptools/tests/test_easy_install.py5
4 files changed, 22 insertions, 14 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py
index 50744b87..cbea7537 100644
--- a/setuptools/command/bdist_egg.py
+++ b/setuptools/command/bdist_egg.py
@@ -129,7 +129,7 @@ class bdist_egg(Command):
self.distribution.data_files.append(item)
try:
- log.info("installing package data to %s" % self.bdist_dir)
+ log.info("installing package data to %s", self.bdist_dir)
self.call_command('install_data', force=0, root=None)
finally:
self.distribution.data_files = old
@@ -152,7 +152,7 @@ class bdist_egg(Command):
self.run_command("egg_info")
# We run install_lib before install_data, because some data hacks
# pull their data path from the install_lib command.
- log.info("installing library code to %s" % self.bdist_dir)
+ log.info("installing library code to %s", self.bdist_dir)
instcmd = self.get_finalized_command('install')
old_root = instcmd.root
instcmd.root = None
@@ -169,7 +169,7 @@ class bdist_egg(Command):
pyfile = os.path.join(self.bdist_dir, strip_module(filename) +
'.py')
self.stubs.append(pyfile)
- log.info("creating stub loader for %s" % ext_name)
+ log.info("creating stub loader for %s", ext_name)
if not self.dry_run:
write_stub(os.path.basename(ext_name), pyfile)
to_compile.append(pyfile)
@@ -186,14 +186,14 @@ class bdist_egg(Command):
self.mkpath(egg_info)
if self.distribution.scripts:
script_dir = os.path.join(egg_info, 'scripts')
- log.info("installing scripts to %s" % script_dir)
+ log.info("installing scripts to %s", script_dir)
self.call_command('install_scripts', install_dir=script_dir,
no_ep=1)
self.copy_metadata_to(egg_info)
native_libs = os.path.join(egg_info, "native_libs.txt")
if all_outputs:
- log.info("writing %s" % native_libs)
+ log.info("writing %s", native_libs)
if not self.dry_run:
ensure_directory(native_libs)
libs_file = open(native_libs, 'wt')
@@ -201,7 +201,7 @@ class bdist_egg(Command):
libs_file.write('\n')
libs_file.close()
elif os.path.isfile(native_libs):
- log.info("removing %s" % native_libs)
+ log.info("removing %s", native_libs)
if not self.dry_run:
os.unlink(native_libs)
@@ -458,7 +458,7 @@ def make_zipfile(zip_filename, base_dir, verbose=0, dry_run=0, compress=True,
p = path[len(base_dir) + 1:]
if not dry_run:
z.write(path, p)
- log.debug("adding '%s'" % p)
+ log.debug("adding '%s'", p)
compression = zipfile.ZIP_DEFLATED if compress else zipfile.ZIP_STORED
if not dry_run:
diff --git a/setuptools/extension.py b/setuptools/extension.py
index 5ea72c06..6b9c19f8 100644
--- a/setuptools/extension.py
+++ b/setuptools/extension.py
@@ -19,7 +19,7 @@ def _have_cython():
"""
Return True if Cython can be imported.
"""
- cython_impl = 'Cython.Distutils.build_ext',
+ cython_impl = 'Cython.Distutils.build_ext'
try:
# from (cython_impl) import build_ext
__import__(cython_impl, fromlist=['build_ext']).build_ext
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 8d965f49..82cd608f 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -290,7 +290,12 @@ class PackageIndex(Environment):
self.package_pages = {}
self.allows = re.compile('|'.join(map(translate, hosts))).match
self.to_scan = []
- if verify_ssl and ssl_support.is_available and (ca_bundle or ssl_support.find_ca_bundle()):
+ use_ssl = (
+ verify_ssl
+ and ssl_support.is_available
+ and (ca_bundle or ssl_support.find_ca_bundle())
+ )
+ if use_ssl:
self.opener = ssl_support.opener_for(ca_bundle)
else:
self.opener = urllib.request.urlopen
@@ -320,7 +325,8 @@ class PackageIndex(Environment):
self.info("Reading %s", url)
self.fetched_urls[url] = True # prevent multiple fetch attempts
- f = self.open_url(url, "Download error on %s: %%s -- Some packages may not be found!" % url)
+ tmpl = "Download error on %s: %%s -- Some packages may not be found!"
+ f = self.open_url(url, tmpl % url)
if f is None:
return
self.fetched_urls[f.url] = True
@@ -362,7 +368,8 @@ class PackageIndex(Environment):
def url_ok(self, url, fatal=False):
s = URL_SCHEME(url)
- if (s and s.group(1).lower() == 'file') or self.allows(urllib.parse.urlparse(url)[1]):
+ is_file = s and s.group(1).lower() == 'file'
+ if is_file or self.allows(urllib.parse.urlparse(url)[1]):
return True
msg = ("\nNote: Bypassing %s (disallowed host; see "
"http://bit.ly/1dg9ijs for details).\n")
@@ -1039,7 +1046,7 @@ def open_with_auth(url, opener=urllib.request.urlopen):
if cred:
auth = str(cred)
info = cred.username, url
- log.info('Authenticating as %s for %s (from .pypirc)' % info)
+ log.info('Authenticating as %s for %s (from .pypirc)', *info)
if auth:
auth = "Basic " + _encode_auth(auth)
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 9b10c428..da0a355c 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -170,9 +170,10 @@ class TestEasyInstallTest:
sdist_zip.close()
return str(sdist)
- @pytest.mark.xfail(setuptools.tests.is_ascii,
- reason="https://github.com/pypa/setuptools/issues/706")
@pytest.mark.xfail(reason="#709 and #710")
+ # also
+ #@pytest.mark.xfail(setuptools.tests.is_ascii,
+ # reason="https://github.com/pypa/setuptools/issues/706")
def test_unicode_filename_in_sdist(self, sdist_unicode, tmpdir, monkeypatch):
"""
The install command should execute correctly even if