mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #4512 from pypa/bugfix/4480
Bugfix: editable packages matched the wrong metadata directory
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Fix a bug that dist-info inside ``venv`` directory will be mistaken as the editable package's metadata.
|
||||
@@ -0,0 +1 @@
|
||||
Update ``requirementslib`` from ``1.5.13`` to ``1.5.14``.
|
||||
+1
-1
@@ -10,7 +10,7 @@ from .models.lockfile import Lockfile
|
||||
from .models.pipfile import Pipfile
|
||||
from .models.requirements import Requirement
|
||||
|
||||
__version__ = "1.5.13"
|
||||
__version__ = "1.5.14"
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -465,6 +465,18 @@ class ScandirCloser(object):
|
||||
pass
|
||||
|
||||
|
||||
def _is_venv_dir(path):
|
||||
# type: (AnyStr) -> bool
|
||||
if os.name == "nt":
|
||||
return os.path.isfile(os.path.join(path, "Scripts/python.exe")) or os.path.isfile(
|
||||
os.path.join(path, "Scripts/activate")
|
||||
)
|
||||
else:
|
||||
return os.path.isfile(os.path.join(path, "bin/python")) or os.path.isfile(
|
||||
os.path.join(path, "bin/activate")
|
||||
)
|
||||
|
||||
|
||||
def iter_metadata(path, pkg_name=None, metadata_type="egg-info"):
|
||||
# type: (AnyStr, Optional[AnyStr], AnyStr) -> Generator
|
||||
if pkg_name is not None:
|
||||
@@ -472,6 +484,9 @@ def iter_metadata(path, pkg_name=None, metadata_type="egg-info"):
|
||||
dirs_to_search = [path]
|
||||
while dirs_to_search:
|
||||
p = dirs_to_search.pop(0)
|
||||
# Skip when the directory is like a venv
|
||||
if _is_venv_dir(p):
|
||||
continue
|
||||
with contextlib.closing(ScandirCloser(p)) as path_iterator:
|
||||
for entry in path_iterator:
|
||||
if entry.is_dir():
|
||||
|
||||
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.13
|
||||
requirementslib==1.5.14
|
||||
attrs==19.3.0
|
||||
distlib==0.3.0
|
||||
packaging==20.3
|
||||
|
||||
Reference in New Issue
Block a user