-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update vendor libraries #4302
Update vendor libraries #4302
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- Updated vendored dependencies: | ||
|
||
- **pythonfinder**: ``1.2.2`` => ``1.2.4`` | ||
- **requirementslib**: ``1.5.9`` => ``1.5.10`` |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ | |
Sequence, | ||
dedup, | ||
ensure_path, | ||
expand_paths, | ||
filter_pythons, | ||
is_in_path, | ||
normalize_path, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -469,21 +469,18 @@ def iter_metadata(path, pkg_name=None, metadata_type="egg-info"): | |
# type: (AnyStr, Optional[AnyStr], AnyStr) -> Generator | ||
if pkg_name is not None: | ||
pkg_variants = get_name_variants(pkg_name) | ||
non_matching_dirs = [] | ||
with contextlib.closing(ScandirCloser(path)) as path_iterator: | ||
for entry in path_iterator: | ||
if entry.is_dir(): | ||
entry_name, ext = os.path.splitext(entry.name) | ||
if ext.endswith(metadata_type): | ||
if pkg_name is None or entry_name.lower() in pkg_variants: | ||
yield entry | ||
elif not entry.name.endswith(metadata_type): | ||
non_matching_dirs.append(entry) | ||
for entry in non_matching_dirs: | ||
for dir_entry in iter_metadata( | ||
entry.path, pkg_name=pkg_name, metadata_type=metadata_type | ||
): | ||
yield dir_entry | ||
dirs_to_search = [path] | ||
while dirs_to_search: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. glad to get this merged, so much nesting though! |
||
p = dirs_to_search.pop(0) | ||
with contextlib.closing(ScandirCloser(p)) as path_iterator: | ||
for entry in path_iterator: | ||
if entry.is_dir(): | ||
entry_name, ext = os.path.splitext(entry.name) | ||
if ext.endswith(metadata_type): | ||
if pkg_name is None or entry_name.lower() in pkg_variants: | ||
yield entry | ||
elif not entry.name.endswith(metadata_type): | ||
dirs_to_search.append(entry.path) | ||
|
||
|
||
def find_egginfo(target, pkg_name=None): | ||
|
@@ -729,14 +726,16 @@ def unmap_binops(self): | |
self.binOps_map[binop] = ast_unparse(binop, analyzer=self) | ||
|
||
def match_assignment_str(self, match): | ||
return next( | ||
iter(k for k in self.assignments if getattr(k, "id", "") == match), None | ||
) | ||
matches = [k for k in self.assignments if getattr(k, "id", "") == match] | ||
if matches: | ||
return matches[-1] | ||
return None | ||
|
||
def match_assignment_name(self, match): | ||
return next( | ||
iter(k for k in self.assignments if getattr(k, "id", "") == match.id), None | ||
) | ||
matches = [k for k in self.assignments if getattr(k, "id", "") == match.id] | ||
if matches: | ||
return matches[-1] | ||
return None | ||
|
||
def generic_unparse(self, item): | ||
if any(isinstance(item, k) for k in AST_BINOP_MAP.keys()): | ||
|
@@ -771,7 +770,7 @@ def unparse_Subscript(self, item): | |
if isinstance(item.slice, ast.Index): | ||
try: | ||
unparsed = unparsed[self.unparse(item.slice.value)] | ||
except KeyError: | ||
except (KeyError, TypeError): | ||
# not everything can be looked up before runtime | ||
unparsed = item | ||
return unparsed | ||
|
@@ -838,7 +837,7 @@ def unparse_Compare(self, item): | |
if isinstance(item.left, ast.Attribute) or isinstance(item.left, ast.Str): | ||
import importlib | ||
|
||
left = unparse(item.left) | ||
left = self.unparse(item.left) | ||
if "." in left: | ||
name, _, val = left.rpartition(".") | ||
left = getattr(importlib.import_module(name), val, left) | ||
|
@@ -1002,7 +1001,7 @@ def ast_unparse(item, initial_mapping=False, analyzer=None, recurse=True): # no | |
if isinstance(item.slice, ast.Index): | ||
try: | ||
unparsed = unparsed[unparse(item.slice.value)] | ||
except KeyError: | ||
except (KeyError, TypeError): | ||
# not everything can be looked up before runtime | ||
unparsed = item | ||
elif any(isinstance(item, k) for k in AST_BINOP_MAP.keys()): | ||
|
@@ -1848,7 +1847,7 @@ def from_ireq(cls, ireq, subdir=None, finder=None, session=None): | |
is_vcs = True if vcs else is_artifact_or_vcs | ||
if is_file and not is_vcs and path is not None and os.path.isdir(path): | ||
target = os.path.join(kwargs["src_dir"], os.path.basename(path)) | ||
shutil.copytree(path, target) | ||
shutil.copytree(path, target, symlinks=True) | ||
ireq.source_dir = target | ||
if not (ireq.editable and is_file and is_vcs): | ||
if ireq.is_wheel: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,18 +20,18 @@ pipdeptree==0.13.2 | |
pipreqs==0.4.10 | ||
docopt==0.6.2 | ||
yarg==0.1.9 | ||
pythonfinder==1.2.2 | ||
pythonfinder==1.2.4 | ||
requests==2.23.0 | ||
chardet==3.0.4 | ||
idna==2.9 | ||
urllib3==1.25.9 | ||
certifi==2020.4.5.1 | ||
requirementslib==1.5.9 | ||
requirementslib==1.5.10 | ||
attrs==19.3.0 | ||
distlib==0.3.0 | ||
packaging==20.3 | ||
pyparsing==2.4.7 | ||
git+https://github.com/sarugaku/plette.git@master#egg=plette | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the release in sync with master now? that's nice to know anyhow |
||
plette==0.2.3 | ||
tomlkit==0.5.11 | ||
shellingham==1.3.2 | ||
six==1.14.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
diff --git a/pipenv/vendor/pythonfinder/compat.py b/pipenv/vendor/pythonfinder/compat.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry again for the patches. For most of these they really should be caught by the vendoring import rewrites but for some reason they arent |
||
index 6fb4542f..d76c4efc 100644 | ||
--- a/pipenv/vendor/pythonfinder/compat.py | ||
+++ b/pipenv/vendor/pythonfinder/compat.py | ||
@@ -4,7 +4,7 @@ import sys | ||
import six | ||
|
||
if sys.version_info[:2] <= (3, 4): | ||
- from pathlib2 import Path # type: ignore # noqa | ||
+ from pipenv.vendor.pathlib2 import Path # type: ignore # noqa | ||
else: | ||
from pathlib import Path | ||
|
||
diff --git a/pipenv/vendor/pythonfinder/models/mixins.py b/pipenv/vendor/pythonfinder/models/mixins.py | ||
index 76327115..aeba0443 100644 | ||
--- a/pipenv/vendor/pythonfinder/models/mixins.py | ||
+++ b/pipenv/vendor/pythonfinder/models/mixins.py | ||
@@ -5,7 +5,7 @@ import abc | ||
import operator | ||
from collections import defaultdict | ||
|
||
-import attr | ||
+from pipenv.vendor import attr | ||
import six | ||
|
||
from ..compat import fs_str | ||
diff --git a/pipenv/vendor/pythonfinder/models/path.py b/pipenv/vendor/pythonfinder/models/path.py | ||
index b855a05d..a8070c91 100644 | ||
--- a/pipenv/vendor/pythonfinder/models/path.py | ||
+++ b/pipenv/vendor/pythonfinder/models/path.py | ||
@@ -7,7 +7,7 @@ import sys | ||
from collections import defaultdict | ||
from itertools import chain | ||
|
||
-import attr | ||
+from pipenv.vendor import attr | ||
import six | ||
from cached_property import cached_property | ||
from ..compat import Path, fs_str | ||
diff --git a/pipenv/vendor/pythonfinder/models/python.py b/pipenv/vendor/pythonfinder/models/python.py | ||
index 619e7761..ff249be2 100644 | ||
--- a/pipenv/vendor/pythonfinder/models/python.py | ||
+++ b/pipenv/vendor/pythonfinder/models/python.py | ||
@@ -7,7 +7,7 @@ import platform | ||
import sys | ||
from collections import defaultdict | ||
|
||
-import attr | ||
+from pipenv.vendor import attr | ||
import six | ||
from packaging.version import Version | ||
|
||
diff --git a/pipenv/vendor/pythonfinder/models/windows.py b/pipenv/vendor/pythonfinder/models/windows.py | ||
index a0e69b03..39353cdb 100644 | ||
--- a/pipenv/vendor/pythonfinder/models/windows.py | ||
+++ b/pipenv/vendor/pythonfinder/models/windows.py | ||
@@ -4,7 +4,7 @@ from __future__ import absolute_import, print_function | ||
import operator | ||
from collections import defaultdict | ||
|
||
-import attr | ||
+from pipenv.vendor import attr | ||
|
||
from ..environment import MYPY_RUNNING | ||
from ..exceptions import InvalidPythonVersion | ||
diff --git a/pipenv/vendor/pythonfinder/utils.py b/pipenv/vendor/pythonfinder/utils.py | ||
index 8150545c..ef48e628 100644 | ||
--- a/pipenv/vendor/pythonfinder/utils.py | ||
+++ b/pipenv/vendor/pythonfinder/utils.py | ||
@@ -10,7 +10,7 @@ from collections import OrderedDict | ||
from fnmatch import fnmatch | ||
from threading import Timer | ||
|
||
-import attr | ||
+from pipenv.vendor import attr | ||
import six | ||
from packaging.version import LegacyVersion, Version | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this from the last release? I think I forgot to update
pythonfinder
!