Commit 2efa19d2 authored by Jason R. Coombs's avatar Jason R. Coombs

Delint

parent 9a66194a
...@@ -90,6 +90,21 @@ if six.PY2: ...@@ -90,6 +90,21 @@ if six.PY2:
# satisfy the linters. # satisfy the linters.
require = None require = None
working_set = None working_set = None
add_activation_listener = None
resources_stream = None
cleanup_resources = None
resource_dir = None
resource_stream = None
set_extraction_path = None
resource_isdir = None
resource_string = None
iter_entry_points = None
resource_listdir = None
resource_filename = None
resource_exists = None
_distribution_finders = None
_namespace_handlers = None
_namespace_packages = None
class PEP440Warning(RuntimeWarning): class PEP440Warning(RuntimeWarning):
...@@ -1074,9 +1089,12 @@ class Environment(object): ...@@ -1074,9 +1089,12 @@ class Environment(object):
requirements specified when this environment was created, or False requirements specified when this environment was created, or False
is returned. is returned.
""" """
return (self.python is None or dist.py_version is None py_compat = (
or dist.py_version == self.python) \ self.python is None
and compatible_platforms(dist.platform, self.platform) or dist.py_version is None
or dist.py_version == self.python
)
return py_compat and compatible_platforms(dist.platform, self.platform)
def remove(self, dist): def remove(self, dist):
"""Remove `dist` from the environment""" """Remove `dist` from the environment"""
...@@ -1621,11 +1639,16 @@ DefaultProvider._register() ...@@ -1621,11 +1639,16 @@ DefaultProvider._register()
class EmptyProvider(NullProvider): class EmptyProvider(NullProvider):
"""Provider that returns nothing for all requests""" """Provider that returns nothing for all requests"""
_isdir = _has = lambda self, path: False
_get = lambda self, path: ''
_listdir = lambda self, path: []
module_path = None module_path = None
_isdir = _has = lambda self, path: False
def _get(self, path):
return ''
def _listdir(self, path):
return []
def __init__(self): def __init__(self):
pass pass
...@@ -2515,7 +2538,8 @@ def _version_from_file(lines): ...@@ -2515,7 +2538,8 @@ def _version_from_file(lines):
Given an iterable of lines from a Metadata file, return Given an iterable of lines from a Metadata file, return
the value of the Version field, if present, or None otherwise. the value of the Version field, if present, or None otherwise.
""" """
is_version_line = lambda line: line.lower().startswith('version:') def is_version_line(line):
return line.lower().startswith('version:')
version_lines = filter(is_version_line, lines) version_lines = filter(is_version_line, lines)
line = next(iter(version_lines), '') line = next(iter(version_lines), '')
_, _, value = line.partition(':') _, _, value = line.partition(':')
......
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