Skip to content

Commit

Permalink
apply pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Jul 20, 2021
1 parent 45f900b commit 03ebe12
Show file tree
Hide file tree
Showing 192 changed files with 13,332 additions and 9,266 deletions.
9 changes: 4 additions & 5 deletions _distutils_hack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
is_pypy = '__pypy__' in sys.builtin_module_names


warnings.filterwarnings('ignore',
r'.+ distutils\b.+ deprecated',
DeprecationWarning)
warnings.filterwarnings('ignore', r'.+ distutils\b.+ deprecated', DeprecationWarning)


def warn_distutils_present():
Expand All @@ -26,7 +24,8 @@ def warn_distutils_present():
"to undesirable behaviors or errors. To avoid these issues, avoid "
"using distutils directly, ensure that setuptools is installed in the "
"traditional way (e.g. not an editable install), and/or make sure "
"that setuptools is always imported before distutils.")
"that setuptools is always imported before distutils."
)


def clear_distutils():
Expand Down Expand Up @@ -83,7 +82,6 @@ def spec_for_distutils(self):
import importlib.util

class DistutilsLoader(importlib.abc.Loader):

def create_module(self, spec):
return importlib.import_module('setuptools._distutils')

Expand All @@ -108,6 +106,7 @@ def pip_imported_during_build():
Detect if pip is being imported in a build script. Ref #2355.
"""
import traceback

return any(
frame.f_globals['__file__'].endswith('setup.py')
for frame, line in traceback.walk_stack(None)
Expand Down
4 changes: 3 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

def pytest_addoption(parser):
parser.addoption(
"--package_name", action="append", default=[],
"--package_name",
action="append",
default=[],
help="list of package_name to pass to test functions",
)

Expand Down
15 changes: 7 additions & 8 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,20 @@ def clean(vendor):
Remove all files out of the vendor directory except the meta
data (as pip uninstall doesn't support -t).
"""
remove_all(
path
for path in vendor.glob('*')
if path.basename() != 'vendored.txt'
)
remove_all(path for path in vendor.glob('*') if path.basename() != 'vendored.txt')


def install(vendor):
clean(vendor)
install_args = [
sys.executable,
'-m', 'pip',
'-m',
'pip',
'install',
'-r', str(vendor / 'vendored.txt'),
'-t', str(vendor),
'-r',
str(vendor / 'vendored.txt'),
'-t',
str(vendor),
]
subprocess.check_call(install_args)
remove_all(vendor.glob('*.dist-info'))
Expand Down
Loading

0 comments on commit 03ebe12

Please sign in to comment.