-
-
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.
Lock vcs deps to exact commit with dependencies
- Manually obtain and update VCS repository with exact commit - Always store exact commit in the lockfile - Fixes #2180, #1690, #1611, #2096 Signed-off-by: Dan Ryan <[email protected]>
- Loading branch information
1 parent
ea6f02d
commit be6f4b8
Showing
3 changed files
with
107 additions
and
85 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
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 |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
import os | ||
from flaky import flaky | ||
import delegator | ||
try: | ||
from pathlib import Path | ||
except ImportError: | ||
from pathlib2 import Path | ||
|
||
|
||
@pytest.mark.vcs | ||
|
@@ -144,3 +148,25 @@ def test_install_local_vcs_not_in_lockfile(PipenvInstance, pip_src_dir): | |
assert six_key in p.lockfile['default'] | ||
# Make sure we didn't put six in the lockfile by accident as a vcs ref | ||
assert 'six' not in p.lockfile['default'] | ||
|
||
|
||
@pytest.mark.vcs | ||
@pytest.mark.install | ||
@pytest.mark.needs_internet | ||
def test_get_vcs_refs(PipenvInstance, pip_src_dir): | ||
with PipenvInstance(chdir=True) as p: | ||
c = p.pipenv('install -e git+https://github.com/hynek/[email protected]#egg=structlog') | ||
assert c.return_code == 0 | ||
assert 'structlog' in p.pipfile['packages'] | ||
assert 'structlog' in p.lockfile['default'] | ||
assert 'six' in p.lockfile['default'] | ||
assert p.lockfile['default']['structlog']['ref'] == 'a39f6906a268fb2f4c365042b31d0200468fb492' | ||
pipfile = Path(p.pipfile_path) | ||
new_content = pipfile.read_bytes().replace(b'16.1.0', b'18.1.0') | ||
pipfile.write_bytes(new_content) | ||
c = p.pipenv('lock') | ||
assert c.return_code == 0 | ||
assert p.lockfile['default']['structlog']['ref'] == 'a73fbd3a9c3cafb11f43168582083f839b883034' | ||
assert 'structlog' in p.pipfile['packages'] | ||
assert 'structlog' in p.lockfile['default'] | ||
assert 'six' in p.lockfile['default'] |