mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
pipfile spec 4, path= instead of file=
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
@@ -9,6 +9,11 @@ twine = "*"
|
||||
sphinx-click = "*"
|
||||
|
||||
[packages]
|
||||
requests = "*"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[requires]
|
||||
python_version = "3.6"
|
||||
|
||||
+13
-2
@@ -467,6 +467,7 @@ def convert_deps_from_pip(dep):
|
||||
dependency = {}
|
||||
|
||||
req = [r for r in requirements.parse(dep)][0]
|
||||
|
||||
# File installs.
|
||||
if (req.uri or (os.path.exists(req.path) if req.path else False)) and not req.vcs:
|
||||
|
||||
@@ -475,8 +476,8 @@ def convert_deps_from_pip(dep):
|
||||
req.name = hashlib.sha256(hashable_path.encode('utf-8')).hexdigest()
|
||||
req.name = req.name[len(req.name) - 7:]
|
||||
|
||||
# {file: uri} TOML (spec 3 I guess...)
|
||||
dependency[req.name] = {'file': hashable_path}
|
||||
# {path: uri} TOML (spec 4 I guess...)
|
||||
dependency[req.name] = {'path': hashable_path}
|
||||
|
||||
# Add --editable if applicable
|
||||
if req.editable:
|
||||
@@ -575,6 +576,16 @@ def convert_deps_to_pip(deps, r=True):
|
||||
else:
|
||||
dep = ''
|
||||
|
||||
# Support for paths.
|
||||
if 'path' in deps[dep]:
|
||||
extra = deps[dep]['path']
|
||||
|
||||
# Flag the file as editable if it is a local relative path
|
||||
if 'editable' in deps[dep]:
|
||||
dep = '-e '
|
||||
else:
|
||||
dep = ''
|
||||
|
||||
if vcs:
|
||||
extra = '{0}+{1}'.format(vcs, deps[dep][vcs])
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -142,7 +142,7 @@ class Pipfile(object):
|
||||
"""Returns a JSON representation of the Pipfile."""
|
||||
data = self.data
|
||||
data['_meta']['hash'] = {"sha256": self.hash}
|
||||
data['_meta']['pipfile-spec'] = 3
|
||||
data['_meta']['pipfile-spec'] = 4
|
||||
return json.dumps(data, indent=4, separators=(',', ': '))
|
||||
|
||||
def assert_requirements(self):
|
||||
|
||||
Reference in New Issue
Block a user