-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes of
requirements
with git requirements
Solved by using existing convert_deps_to_pip function. Fix #5076. Original implementation by @fraser-langton. This also solves the export of packages with editable mode, as suggested by @hoyaaaa (#5071).
- Loading branch information
Showing
4 changed files
with
56 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixes issue of requirements command where git requirements cause the command to fail, solved by using existing convert_deps_to_pip function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import json | ||
import pytest | ||
|
||
|
||
|
@@ -66,3 +67,27 @@ def test_requirements_generates_requirements_from_lockfile_multiple_sources(Pipe | |
|
||
assert '-i https://pypi.org/simple' in c.stdout | ||
assert '--extra-index-url https://some_other_source.org' in c.stdout | ||
|
||
@pytest.mark.requirements | ||
def test_requirements_with_git_requirements(PipenvInstance): | ||
req_name, req_hash = 'example-repo', 'cc858e89f19bc0dbd70983f86b811ab625dc9292' | ||
lockfile = { | ||
"_meta": {"sources": []}, | ||
"default": { | ||
req_name: { | ||
"editable": True, | ||
"git": F"ssh://[email protected]/code/{req_name}.git", | ||
"ref": req_hash | ||
} | ||
}, | ||
"develop": {} | ||
} | ||
|
||
with PipenvInstance(chdir=True) as p: | ||
with open(p.lockfile_path, 'w') as f: | ||
json.dump(lockfile, f) | ||
|
||
c = p.pipenv('requirements') | ||
assert c.returncode == 0 | ||
assert req_name in c.stdout | ||
assert req_hash in c.stdout |