mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #818 from techalchemy/non-editable-file-fix
Fix install for local sdist packages
This commit is contained in:
+2
-2
@@ -65,10 +65,10 @@ class Project(object):
|
||||
else:
|
||||
ps.update({k: v})
|
||||
else:
|
||||
if 'file' not in v and not is_vcs(v) and not is_vcs(k):
|
||||
if not is_file(v) and not is_file(k) and not is_vcs(v) and not is_vcs(k):
|
||||
ps.update({k: v})
|
||||
else:
|
||||
if not is_vcs(k):
|
||||
if not is_vcs(k) and not is_file(k):
|
||||
ps.update({k: v})
|
||||
return ps
|
||||
|
||||
|
||||
+8
-1
@@ -497,8 +497,12 @@ def convert_deps_from_pip(dep):
|
||||
extras = {'extras': req.extras}
|
||||
|
||||
# File installs.
|
||||
if (req.uri or (os.path.exists(req.path) if req.path else False)) and not req.vcs:
|
||||
if (req.uri or (os.path.exists(req.path) if req.path else False) or
|
||||
os.path.exists(req.name)) and not req.vcs:
|
||||
# Assign a package name to the file, last 7 of it's sha256 hex digest.
|
||||
if not req.uri and not req.path:
|
||||
req.path = os.path.abspath(req.name)
|
||||
|
||||
hashable_path = req.uri if req.uri else req.path
|
||||
req.name = hashlib.sha256(hashable_path.encode('utf-8')).hexdigest()
|
||||
req.name = req.name[len(req.name) - 7:]
|
||||
@@ -721,6 +725,9 @@ def is_vcs(pipfile_entry):
|
||||
|
||||
def is_file(package):
|
||||
"""Determine if a package name is for a File dependency."""
|
||||
if hasattr(package, 'keys'):
|
||||
return any(key for key in package.keys() if key in ['file', 'path'])
|
||||
|
||||
if os.path.exists(str(package)):
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user