-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6383 from cjerdonek/fix-freeze-debug-message
Fix a freeze debug log message.
- Loading branch information
Showing
7 changed files
with
87 additions
and
62 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,2 @@ | ||
Fix a debug log message when freezing an editable, non-version controlled | ||
requirement. |
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 |
---|---|---|
|
@@ -40,7 +40,7 @@ def _get_branch_remote(script, package_name, branch): | |
return result.stdout.strip() | ||
|
||
|
||
def _github_checkout(url_path, temp_dir, egg=None, scheme=None): | ||
def _github_checkout(url_path, temp_dir, rev=None, egg=None, scheme=None): | ||
""" | ||
Call local_checkout() with a GitHub URL, and return the resulting URL. | ||
|
@@ -56,6 +56,8 @@ def _github_checkout(url_path, temp_dir, egg=None, scheme=None): | |
scheme = 'https' | ||
url = 'git+{}://github.com/{}'.format(scheme, url_path) | ||
local_url = local_checkout(url, temp_dir.join('cache')) | ||
if rev is not None: | ||
local_url += '@{}'.format(rev) | ||
if egg is not None: | ||
local_url += '#egg={}'.format(egg) | ||
|
||
|
@@ -150,7 +152,7 @@ def test_install_editable_from_git_with_https(script, tmpdir): | |
""" | ||
url_path = 'pypa/pip-test-package.git' | ||
local_url = _github_checkout(url_path, tmpdir, egg='pip-test-package') | ||
result = script.pip('install', '-e', local_url, expect_error=True) | ||
result = script.pip('install', '-e', local_url) | ||
result.assert_installed('pip-test-package', with_files=['.git']) | ||
|
||
|
||
|
@@ -184,9 +186,7 @@ def test_git_with_sha1_revisions(script): | |
'git', 'rev-parse', 'HEAD~1', | ||
cwd=version_pkg_path, | ||
).stdout.strip() | ||
version = _install_version_pkg( | ||
script, version_pkg_path, rev=sha1, expect_stderr=True, | ||
) | ||
version = _install_version_pkg(script, version_pkg_path, rev=sha1) | ||
assert '0.1' == version | ||
|
||
|
||
|
@@ -200,9 +200,7 @@ def test_git_with_short_sha1_revisions(script): | |
'git', 'rev-parse', 'HEAD~1', | ||
cwd=version_pkg_path, | ||
).stdout.strip()[:7] | ||
version = _install_version_pkg( | ||
script, version_pkg_path, rev=sha1, expect_stderr=True, | ||
) | ||
version = _install_version_pkg(script, version_pkg_path, rev=sha1) | ||
assert '0.1' == version | ||
|
||
|
||
|
@@ -212,11 +210,7 @@ def test_git_with_branch_name_as_revision(script): | |
""" | ||
version_pkg_path = _create_test_package(script) | ||
branch = 'test_branch' | ||
script.run( | ||
'git', 'checkout', '-b', branch, | ||
expect_stderr=True, | ||
cwd=version_pkg_path, | ||
) | ||
script.run('git', 'checkout', '-b', branch, cwd=version_pkg_path) | ||
_change_test_package_version(script, version_pkg_path) | ||
version = _install_version_pkg(script, version_pkg_path, rev=branch) | ||
assert 'some different version' == version | ||
|
@@ -227,11 +221,7 @@ def test_git_with_tag_name_as_revision(script): | |
Git backend should be able to install from tag names | ||
""" | ||
version_pkg_path = _create_test_package(script) | ||
script.run( | ||
'git', 'tag', 'test_tag', | ||
expect_stderr=True, | ||
cwd=version_pkg_path, | ||
) | ||
script.run('git', 'tag', 'test_tag', cwd=version_pkg_path) | ||
_change_test_package_version(script, version_pkg_path) | ||
version = _install_version_pkg(script, version_pkg_path, rev='test_tag') | ||
assert '0.1' == version | ||
|
@@ -241,7 +231,7 @@ def _add_ref(script, path, ref): | |
""" | ||
Add a new ref to a repository at the given path. | ||
""" | ||
script.run('git', 'update-ref', ref, 'HEAD', expect_stderr=True, cwd=path) | ||
script.run('git', 'update-ref', ref, 'HEAD', cwd=path) | ||
|
||
|
||
def test_git_install_ref(script): | ||
|
@@ -253,7 +243,7 @@ def test_git_install_ref(script): | |
_change_test_package_version(script, version_pkg_path) | ||
|
||
version = _install_version_pkg( | ||
script, version_pkg_path, rev='refs/foo/bar', expect_stderr=True, | ||
script, version_pkg_path, rev='refs/foo/bar', | ||
) | ||
assert '0.1' == version | ||
|
||
|
@@ -267,14 +257,12 @@ def test_git_install_then_install_ref(script): | |
_add_ref(script, version_pkg_path, 'refs/foo/bar') | ||
_change_test_package_version(script, version_pkg_path) | ||
|
||
version = _install_version_pkg( | ||
script, version_pkg_path, expect_stderr=True, | ||
) | ||
version = _install_version_pkg(script, version_pkg_path) | ||
assert 'some different version' == version | ||
|
||
# Now install the ref. | ||
version = _install_version_pkg( | ||
script, version_pkg_path, rev='refs/foo/bar', expect_stderr=True, | ||
script, version_pkg_path, rev='refs/foo/bar', | ||
) | ||
assert '0.1' == version | ||
|
||
|
@@ -286,14 +274,13 @@ def test_git_with_tag_name_and_update(script, tmpdir): | |
""" | ||
url_path = 'pypa/pip-test-package.git' | ||
local_url = _github_checkout(url_path, tmpdir, egg='pip-test-package') | ||
result = script.pip('install', '-e', local_url, expect_error=True) | ||
result = script.pip('install', '-e', local_url) | ||
result.assert_installed('pip-test-package', with_files=['.git']) | ||
|
||
new_local_url = _github_checkout(url_path, tmpdir) | ||
new_local_url += '@0.1.2#egg=pip-test-package' | ||
result = script.pip( | ||
'install', '--global-option=--version', '-e', new_local_url, | ||
expect_error=True, | ||
) | ||
assert '0.1.2' in result.stdout | ||
|
||
|
@@ -306,7 +293,7 @@ def test_git_branch_should_not_be_changed(script, tmpdir): | |
""" | ||
url_path = 'pypa/pip-test-package.git' | ||
local_url = _github_checkout(url_path, tmpdir, egg='pip-test-package') | ||
script.pip('install', '-e', local_url, expect_error=True) | ||
script.pip('install', '-e', local_url) | ||
branch = _get_editable_branch(script, 'pip-test-package') | ||
assert 'master' == branch | ||
|
||
|
@@ -316,11 +303,11 @@ def test_git_with_non_editable_unpacking(script, tmpdir): | |
""" | ||
Test cloning a git repository from a non-editable URL with a given tag. | ||
""" | ||
url_path = 'pypa/[email protected]#egg=pip-test-package' | ||
local_url = _github_checkout(url_path, tmpdir) | ||
result = script.pip( | ||
'install', '--global-option=--version', local_url, expect_error=True, | ||
url_path = 'pypa/pip-test-package.git' | ||
local_url = _github_checkout( | ||
url_path, tmpdir, rev='0.1.2', egg='pip-test-package', | ||
) | ||
result = script.pip('install', '--global-option=--version', local_url) | ||
assert '0.1.2' in result.stdout | ||
|
||
|
||
|
@@ -388,13 +375,8 @@ def test_editable__branch_with_sha_same_as_default(script): | |
""" | ||
version_pkg_path = _create_test_package(script) | ||
# Create a second branch with the same SHA. | ||
script.run( | ||
'git', 'branch', 'develop', expect_stderr=True, | ||
cwd=version_pkg_path, | ||
) | ||
_install_version_pkg_only( | ||
script, version_pkg_path, rev='develop', expect_stderr=True | ||
) | ||
script.run('git', 'branch', 'develop', cwd=version_pkg_path) | ||
_install_version_pkg_only(script, version_pkg_path, rev='develop') | ||
|
||
branch = _get_editable_branch(script, 'version-pkg') | ||
assert branch == 'develop' | ||
|
@@ -410,16 +392,11 @@ def test_editable__branch_with_sha_different_from_default(script): | |
""" | ||
version_pkg_path = _create_test_package(script) | ||
# Create a second branch. | ||
script.run( | ||
'git', 'branch', 'develop', expect_stderr=True, | ||
cwd=version_pkg_path, | ||
) | ||
script.run('git', 'branch', 'develop', cwd=version_pkg_path) | ||
# Add another commit to the master branch to give it a different sha. | ||
_change_test_package_version(script, version_pkg_path) | ||
|
||
version = _install_version_pkg( | ||
script, version_pkg_path, rev='develop', expect_stderr=True | ||
) | ||
version = _install_version_pkg(script, version_pkg_path, rev='develop') | ||
assert version == '0.1' | ||
|
||
branch = _get_editable_branch(script, 'version-pkg') | ||
|
@@ -437,10 +414,7 @@ def test_editable__non_master_default_branch(script): | |
version_pkg_path = _create_test_package(script) | ||
# Change the default branch of the remote repo to a name that is | ||
# alphabetically after "master". | ||
script.run( | ||
'git', 'checkout', '-b', 'release', expect_stderr=True, | ||
cwd=version_pkg_path, | ||
) | ||
script.run('git', 'checkout', '-b', 'release', cwd=version_pkg_path) | ||
_install_version_pkg_only(script, version_pkg_path) | ||
|
||
branch = _get_editable_branch(script, 'version-pkg') | ||
|
@@ -492,7 +466,6 @@ def test_check_submodule_addition(script): | |
update_result = script.pip( | ||
'install', '-e', 'git+' + module_path + '#egg=version_pkg', | ||
'--upgrade', | ||
expect_error=True, | ||
) | ||
|
||
assert ( | ||
|
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