mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #4385 from pypa/vendor/update
Update requirementslib to 1.5.12
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Fix a bug that Pipenv can't locate the correct file of special directives in ``setup.cfg`` of an editable package.
|
||||
@@ -0,0 +1 @@
|
||||
Fix a bug that ``setup.py`` can't be parsed correctly when the assignment is type-annotated.
|
||||
@@ -0,0 +1 @@
|
||||
Update ``requirementslib`` to ``1.5.12``.
|
||||
+1
-1
@@ -10,7 +10,7 @@ from .models.lockfile import Lockfile
|
||||
from .models.pipfile import Pipfile
|
||||
from .models.requirements import Requirement
|
||||
|
||||
__version__ = "1.5.11"
|
||||
__version__ = "1.5.12"
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
+1
-3
@@ -887,9 +887,7 @@ class Line(object):
|
||||
and self.setup_cfg
|
||||
):
|
||||
return {}
|
||||
base_dir = os.path.dirname(os.path.abspath(self.setup_cfg))
|
||||
setup_content = read_source(self.setup_cfg)
|
||||
return parse_setup_cfg(setup_content, base_dir)
|
||||
return self.setup_info.parse_setup_cfg()
|
||||
|
||||
@cached_property
|
||||
def parsed_setup_py(self):
|
||||
|
||||
+14
-5
@@ -250,7 +250,7 @@ def get_package_dir_from_setupcfg(parser, base_dir=None):
|
||||
if "find:" in pkg_dir:
|
||||
_, pkg_dir = pkg_dir.split("find:")
|
||||
pkg_dir = pkg_dir.strip()
|
||||
package_dir = os.path.join(package_dir, pkg_dir)
|
||||
package_dir = os.path.join(package_dir, pkg_dir)
|
||||
elif os.path.exists(os.path.join(package_dir, "setup.py")):
|
||||
setup_py = ast_parse_setup_py(os.path.join(package_dir, "setup.py"))
|
||||
if "package_dir" in setup_py:
|
||||
@@ -681,6 +681,11 @@ AST_COMPARATORS = dict(
|
||||
)
|
||||
)
|
||||
|
||||
if getattr(ast, "AnnAssign", None):
|
||||
ASSIGN_NODES = (ast.Assign, ast.AnnAssign)
|
||||
else:
|
||||
ASSIGN_NODES = (ast.Assign,)
|
||||
|
||||
|
||||
class Analyzer(ast.NodeVisitor):
|
||||
def __init__(self):
|
||||
@@ -704,7 +709,7 @@ class Analyzer(ast.NodeVisitor):
|
||||
self.name_types.append(node)
|
||||
if isinstance(node, ast.Str):
|
||||
self.strings.append(node)
|
||||
if isinstance(node, ast.Assign):
|
||||
if isinstance(node, ASSIGN_NODES):
|
||||
self.assignments.update(ast_unparse(node, initial_mapping=True))
|
||||
super(Analyzer, self).generic_visit(node)
|
||||
|
||||
@@ -1139,20 +1144,24 @@ def ast_unparse(item, initial_mapping=False, analyzer=None, recurse=True): # no
|
||||
unparsed[func_name].update(unparse(keyword))
|
||||
elif isinstance(item, ast.keyword):
|
||||
unparsed = {unparse(item.arg): unparse(item.value)}
|
||||
elif isinstance(item, ast.Assign):
|
||||
elif isinstance(item, ASSIGN_NODES):
|
||||
# XXX: DO NOT UNPARSE THIS
|
||||
# XXX: If we unparse this it becomes impossible to map it back
|
||||
# XXX: To the original node in the AST so we can find the
|
||||
# XXX: Original reference
|
||||
try:
|
||||
targets = item.targets # for ast.Assign
|
||||
except AttributeError: # for ast.AnnAssign
|
||||
targets = (item.target,)
|
||||
if not initial_mapping:
|
||||
target = unparse(next(iter(item.targets)), recurse=False)
|
||||
target = unparse(next(iter(targets)), recurse=False)
|
||||
val = unparse(item.value, recurse=False)
|
||||
if isinstance(target, (tuple, set, list)):
|
||||
unparsed = dict(zip(target, val))
|
||||
else:
|
||||
unparsed = {target: val}
|
||||
else:
|
||||
unparsed = {next(iter(item.targets)): item}
|
||||
unparsed = {next(iter(targets)): item}
|
||||
elif isinstance(item, Mapping):
|
||||
unparsed = {}
|
||||
for k, v in item.items():
|
||||
|
||||
Vendored
+1
-1
@@ -26,7 +26,7 @@ requests==2.23.0
|
||||
idna==2.9
|
||||
urllib3==1.25.9
|
||||
certifi==2020.4.5.1
|
||||
requirementslib==1.5.11
|
||||
requirementslib==1.5.12
|
||||
attrs==19.3.0
|
||||
distlib==0.3.0
|
||||
packaging==20.3
|
||||
|
||||
@@ -574,7 +574,10 @@ def packages_missing_licenses(
|
||||
for lic in itertools.product(("LICENSE", "LICENSE-MIT"), LICENSE_EXTS)
|
||||
]
|
||||
for i, req in enumerate(requirements):
|
||||
pkg = req.strip().split("=")[0]
|
||||
if req.startswith("git+"):
|
||||
pkg = req.strip().split("#egg=")[1]
|
||||
else:
|
||||
pkg = req.strip().split("=")[0]
|
||||
possible_pkgs = [pkg, pkg.replace("-", "_")]
|
||||
match_found = False
|
||||
if pkg in PY2_DOWNLOAD:
|
||||
|
||||
@@ -10,3 +10,16 @@ index 53b19b17..358cc33b 100644
|
||||
return
|
||||
|
||||
|
||||
diff --git a/pipenv/vendor/passa/models/projects.py b/pipenv/vendor/passa/models/projects.py
|
||||
index f6e037d6..c7807c05 100644
|
||||
--- a/pipenv/vendor/passa/models/projects.py
|
||||
+++ b/pipenv/vendor/passa/models/projects.py
|
||||
@@ -6,7 +6,7 @@ import collections
|
||||
import io
|
||||
import os
|
||||
|
||||
-import attr
|
||||
+from pipenv.vendor import attr
|
||||
import packaging.markers
|
||||
import packaging.utils
|
||||
import plette
|
||||
|
||||
@@ -1,16 +1,3 @@
|
||||
diff --git a/pipenv/vendor/passa/models/projects.py b/pipenv/vendor/passa/models/projects.py
|
||||
index f6e037d6..c7807c05 100644
|
||||
--- a/pipenv/vendor/passa/models/projects.py
|
||||
+++ b/pipenv/vendor/passa/models/projects.py
|
||||
@@ -6,7 +6,7 @@ import collections
|
||||
import io
|
||||
import os
|
||||
|
||||
-import attr
|
||||
+from pipenv.vendor import attr
|
||||
import packaging.markers
|
||||
import packaging.utils
|
||||
import plette
|
||||
diff --git a/pipenv/vendor/requirementslib/models/dependencies.py b/pipenv/vendor/requirementslib/models/dependencies.py
|
||||
index 2608479a..1a610ce7 100644
|
||||
--- a/pipenv/vendor/requirementslib/models/dependencies.py
|
||||
|
||||
Reference in New Issue
Block a user