mirror of https://github.com/pypa/pip
Turn on everything in flake8
flake8 ignores some errors by default, these ignored by defaults change sometimes. This will make things stabler by selecting everything.
This commit is contained in:
parent
c8d9368e71
commit
95035fc5c4
|
@ -247,8 +247,10 @@ class FrozenRequirement(object):
|
|||
if ver_match or date_match:
|
||||
svn_backend = vcs.get_backend('svn')
|
||||
if svn_backend:
|
||||
svn_location = svn_backend(
|
||||
).get_location(dist, dependency_links)
|
||||
svn_location = svn_backend().get_location(
|
||||
dist,
|
||||
dependency_links,
|
||||
)
|
||||
if not svn_location:
|
||||
logger.warn(
|
||||
'Warning: cannot find svn location for %s' % req)
|
||||
|
|
|
@ -357,7 +357,7 @@ class InstallCommand(Command):
|
|||
for item in os.listdir(lib_dir):
|
||||
shutil.move(
|
||||
os.path.join(lib_dir, item),
|
||||
os.path.join(options.target_dir, item)
|
||||
os.path.join(options.target_dir, item),
|
||||
)
|
||||
shutil.rmtree(temp_target_dir)
|
||||
return requirement_set
|
||||
|
|
|
@ -704,7 +704,8 @@ exec(compile(
|
|||
|
||||
def _clean_zip_name(self, name, prefix):
|
||||
assert name.startswith(prefix + os.path.sep), (
|
||||
"name %r doesn't start with prefix %r" % (name, prefix))
|
||||
"name %r doesn't start with prefix %r" % (name, prefix)
|
||||
)
|
||||
name = name[len(prefix) + 1:]
|
||||
name = name.replace(os.path.sep, '/')
|
||||
return name
|
||||
|
|
|
@ -729,7 +729,8 @@ class RequirementSet(object):
|
|||
|
||||
def _clean_zip_name(self, name, prefix):
|
||||
assert name.startswith(prefix + os.path.sep), (
|
||||
"name %r doesn't start with prefix %r" % (name, prefix))
|
||||
"name %r doesn't start with prefix %r" % (name, prefix)
|
||||
)
|
||||
name = name[len(prefix) + 1:]
|
||||
name = name.replace(os.path.sep, '/')
|
||||
return name
|
||||
|
|
|
@ -509,7 +509,8 @@ def test_install_package_which_contains_dev_in_name(script):
|
|||
result = script.pip('install', 'django-devserver==0.0.4')
|
||||
devserver_folder = script.site_packages / 'devserver'
|
||||
egg_info_folder = (
|
||||
script.site_packages/'django_devserver-0.0.4-py%s.egg-info' % pyversion
|
||||
script.site_packages / 'django_devserver-0.0.4-py%s.egg-info' %
|
||||
pyversion
|
||||
)
|
||||
assert devserver_folder in result.files_created, str(result.stdout)
|
||||
assert egg_info_folder in result.files_created, str(result)
|
||||
|
|
|
@ -139,9 +139,9 @@ def test_install_local_editable_with_extras(script, data):
|
|||
assert script.site_packages / 'easy-install.pth' in res.files_updated, (
|
||||
str(res)
|
||||
)
|
||||
assert script.site_packages/'LocalExtras.egg-link' in res.files_created, (
|
||||
str(res)
|
||||
)
|
||||
assert (
|
||||
script.site_packages / 'LocalExtras.egg-link' in res.files_created
|
||||
), str(res)
|
||||
assert script.site_packages / 'simple' in res.files_created, str(res)
|
||||
|
||||
|
||||
|
|
|
@ -124,7 +124,8 @@ class Tests_UserSite:
|
|||
)
|
||||
initools_v3_file = (
|
||||
# file only in 0.3
|
||||
script.base_path/script.user_site/'initools'/'configparser.py'
|
||||
script.base_path / script.user_site / 'initools' /
|
||||
'configparser.py'
|
||||
)
|
||||
assert egg_info_folder in result2.files_created, str(result2)
|
||||
assert not isfile(initools_v3_file), initools_v3_file
|
||||
|
@ -245,7 +246,8 @@ class Tests_UserSite:
|
|||
)
|
||||
initools_v3_file = (
|
||||
# file only in 0.3
|
||||
script.base_path/script.user_site/'initools'/'configparser.py'
|
||||
script.base_path / script.user_site / 'initools' /
|
||||
'configparser.py'
|
||||
)
|
||||
assert egg_info_folder in result3.files_created, str(result3)
|
||||
assert not isfile(initools_v3_file), initools_v3_file
|
||||
|
|
|
@ -144,7 +144,8 @@ def test_git_with_editable_where_egg_contains_dev_string(script, tmpdir):
|
|||
'%s#egg=django-devserver' %
|
||||
local_checkout(
|
||||
'git+git://github.com/dcramer/django-devserver.git',
|
||||
tmpdir.join("cache"))
|
||||
tmpdir.join("cache")
|
||||
)
|
||||
)
|
||||
result.assert_installed('django-devserver', with_files=['.git'])
|
||||
|
||||
|
@ -159,7 +160,8 @@ def test_git_with_non_editable_where_egg_contains_dev_string(script, tmpdir):
|
|||
'%s#egg=django-devserver' %
|
||||
local_checkout(
|
||||
'git+git://github.com/dcramer/django-devserver.git',
|
||||
tmpdir.join("cache")),
|
||||
tmpdir.join("cache")
|
||||
),
|
||||
)
|
||||
devserver_folder = script.site_packages / 'devserver'
|
||||
assert devserver_folder in result.files_created, str(result)
|
||||
|
|
|
@ -105,7 +105,8 @@ def test_check_submodule_addition(script):
|
|||
|
||||
# expect error because git may write to stderr
|
||||
update_result = script.pip(
|
||||
'install', '-e', 'git+'+module_path+'#egg=version_pkg', '--upgrade',
|
||||
'install', '-e', 'git+' + module_path + '#egg=version_pkg',
|
||||
'--upgrade',
|
||||
expect_error=True,
|
||||
)
|
||||
|
||||
|
|
|
@ -58,7 +58,11 @@ def test_uninstall_easy_install_after_import(script):
|
|||
assert_all_changes(
|
||||
result,
|
||||
result2,
|
||||
[script.venv/'build', 'cache', script.site_packages/'easy-install.pth']
|
||||
[
|
||||
script.venv / 'build',
|
||||
'cache',
|
||||
script.site_packages / 'easy-install.pth',
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
|
@ -150,7 +154,11 @@ def test_uninstall_easy_installed_console_scripts(script):
|
|||
assert_all_changes(
|
||||
result,
|
||||
result2,
|
||||
[script.venv/'build', 'cache', script.site_packages/'easy-install.pth']
|
||||
[
|
||||
script.venv / 'build',
|
||||
'cache',
|
||||
script.site_packages / 'easy-install.pth',
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -84,5 +84,9 @@ class Tests_UninstallUserSite:
|
|||
assert_all_changes(
|
||||
result1,
|
||||
result2,
|
||||
[script.venv/'build', 'cache', script.user_site/'easy-install.pth']
|
||||
[
|
||||
script.venv / 'build',
|
||||
'cache',
|
||||
script.user_site / 'easy-install.pth',
|
||||
]
|
||||
)
|
||||
|
|
|
@ -55,7 +55,9 @@ def _get_vcs_and_checkout_url(remote_repository, directory):
|
|||
if vcs == 'svn':
|
||||
branch = os.path.basename(remote_repository)
|
||||
# remove the slash
|
||||
repository_name = os.path.basename(remote_repository[:-len(branch)-1])
|
||||
repository_name = os.path.basename(
|
||||
remote_repository[:-len(branch) - 1]
|
||||
)
|
||||
else:
|
||||
repository_name = os.path.basename(remote_repository)
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ def test_finder_detects_latest_already_satisfied_pypi_links():
|
|||
satisfied_by = Mock(
|
||||
location="/path",
|
||||
parsed_version=parse_version(latest_version),
|
||||
version=latest_version
|
||||
version=latest_version,
|
||||
)
|
||||
req.satisfied_by = satisfied_by
|
||||
finder = PackageFinder([], ["http://pypi.python.org/simple"])
|
||||
|
@ -156,7 +156,7 @@ class TestWheel:
|
|||
satisfied_by = Mock(
|
||||
location="/path",
|
||||
parsed_version=parse_version(latest_version),
|
||||
version=latest_version
|
||||
version=latest_version,
|
||||
)
|
||||
req.satisfied_by = satisfied_by
|
||||
finder = PackageFinder([data.find_links], [], use_wheel=True)
|
||||
|
|
|
@ -38,14 +38,14 @@ class TestOptionPrecedence(object):
|
|||
def get_config_section(self, section):
|
||||
config = {
|
||||
'global': [('timeout', '-3')],
|
||||
'fake': [('timeout', '-2')]
|
||||
'fake': [('timeout', '-2')],
|
||||
}
|
||||
return config[section]
|
||||
|
||||
def get_config_section_global(self, section):
|
||||
config = {
|
||||
'global': [('timeout', '-3')],
|
||||
'fake': []
|
||||
'fake': [],
|
||||
}
|
||||
return config[section]
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class TestRequirementSet(object):
|
|||
build_dir=os.path.join(self.tempdir, 'build'),
|
||||
src_dir=os.path.join(self.tempdir, 'src'),
|
||||
download_dir=None,
|
||||
download_cache=os.path.join(self.tempdir, 'download_cache')
|
||||
download_cache=os.path.join(self.tempdir, 'download_cache'),
|
||||
)
|
||||
|
||||
def test_no_reuse_existing_build_dir(self, data):
|
||||
|
@ -51,7 +51,7 @@ class TestRequirementSet(object):
|
|||
"pip can't proceed with [\s\S]*%s[\s\S]*%s" %
|
||||
(req, build_dir.replace('\\', '\\\\')),
|
||||
reqset.prepare_files,
|
||||
finder
|
||||
finder,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -335,8 +335,7 @@ class TestUnpackArchives(object):
|
|||
('script_group.sh', 0o755, os.path.isfile),
|
||||
('script_world.sh', 0o755, os.path.isfile),
|
||||
('dir', 0o755, os.path.isdir),
|
||||
(os.path.join('dir', 'dirfile'), 0o644, os.path.isfile),
|
||||
]:
|
||||
(os.path.join('dir', 'dirfile'), 0o644, os.path.isfile)]:
|
||||
path = os.path.join(self.tempdir, fname)
|
||||
if path.endswith('symlink.txt') and sys.platform == 'win32':
|
||||
# no symlinks created on windows
|
||||
|
|
Loading…
Reference in New Issue