-
Notifications
You must be signed in to change notification settings - Fork 3k
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 #5664 from cjerdonek/issue-5375-svn-ssh-auth
Fix #5375: add editable install support for svn+ssh URLs with a username
- Loading branch information
Showing
5 changed files
with
62 additions
and
17 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 |
---|---|---|
|
@@ -426,6 +426,12 @@ Subversion | |
|
||
pip supports the URL schemes ``svn``, ``svn+svn``, ``svn+http``, ``svn+https``, ``svn+ssh``. | ||
|
||
Here are some of the supported forms:: | ||
|
||
[-e] svn+https://svn.example.com/MyProject#egg=MyProject | ||
[-e] svn+ssh://svn.example.com/MyProject#egg=MyProject | ||
[-e] svn+ssh://[email protected]/MyProject#egg=MyProject | ||
|
||
You can also give specific revisions to an SVN URL, like so:: | ||
|
||
[-e] svn+svn://svn.example.com/svn/MyProject#egg=MyProject | ||
|
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 @@ | ||
Support passing ``svn+ssh`` URLs with a username to ``pip install -e``. |
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 |
---|---|---|
|
@@ -169,33 +169,39 @@ def test_git_is_commit_id_equal(git, rev_name, result): | |
|
||
# The non-SVN backends all use the same get_netloc_and_auth(), so only test | ||
# Git as a representative. | ||
@pytest.mark.parametrize('netloc, expected', [ | ||
@pytest.mark.parametrize('args, expected', [ | ||
# Test a basic case. | ||
('example.com', ('example.com', (None, None))), | ||
(('example.com', 'https'), ('example.com', (None, None))), | ||
# Test with username and password. | ||
('user:[email protected]', ('user:[email protected]', (None, None))), | ||
(('user:[email protected]', 'https'), | ||
('user:[email protected]', (None, None))), | ||
]) | ||
def test_git__get_netloc_and_auth(netloc, expected): | ||
def test_git__get_netloc_and_auth(args, expected): | ||
""" | ||
Test VersionControl.get_netloc_and_auth(). | ||
""" | ||
actual = Git().get_netloc_and_auth(netloc) | ||
netloc, scheme = args | ||
actual = Git().get_netloc_and_auth(netloc, scheme) | ||
assert actual == expected | ||
|
||
|
||
@pytest.mark.parametrize('netloc, expected', [ | ||
# Test a basic case. | ||
('example.com', ('example.com', (None, None))), | ||
# Test with username and no password. | ||
('[email protected]', ('example.com', ('user', None))), | ||
# Test with username and password. | ||
('user:[email protected]', ('example.com', ('user', 'pass'))), | ||
@pytest.mark.parametrize('args, expected', [ | ||
# Test https. | ||
(('example.com', 'https'), ('example.com', (None, None))), | ||
# Test https with username and no password. | ||
(('[email protected]', 'https'), ('example.com', ('user', None))), | ||
# Test https with username and password. | ||
(('user:[email protected]', 'https'), ('example.com', ('user', 'pass'))), | ||
# Test ssh with username and password. | ||
(('user:[email protected]', 'ssh'), | ||
('user:[email protected]', (None, None))), | ||
]) | ||
def test_subversion__get_netloc_and_auth(netloc, expected): | ||
def test_subversion__get_netloc_and_auth(args, expected): | ||
""" | ||
Test Subversion.get_netloc_and_auth(). | ||
""" | ||
actual = Subversion().get_netloc_and_auth(netloc) | ||
netloc, scheme = args | ||
actual = Subversion().get_netloc_and_auth(netloc, scheme) | ||
assert actual == expected | ||
|
||
|
||
|
@@ -276,6 +282,28 @@ def test_bazaar__get_url_rev_and_auth(url, expected): | |
assert actual == (expected, None, (None, None)) | ||
|
||
|
||
@pytest.mark.parametrize('url, expected', [ | ||
# Test an https URL. | ||
('svn+https://svn.example.com/MyProject#egg=MyProject', | ||
('https://svn.example.com/MyProject', None, (None, None))), | ||
# Test an https URL with a username and password. | ||
('svn+https://user:[email protected]/MyProject#egg=MyProject', | ||
('https://svn.example.com/MyProject', None, ('user', 'pass'))), | ||
# Test an ssh URL. | ||
('svn+ssh://svn.example.com/MyProject#egg=MyProject', | ||
('svn+ssh://svn.example.com/MyProject', None, (None, None))), | ||
# Test an ssh URL with a username. | ||
('svn+ssh://[email protected]/MyProject#egg=MyProject', | ||
('svn+ssh://[email protected]/MyProject', None, (None, None))), | ||
]) | ||
def test_subversion__get_url_rev_and_auth(url, expected): | ||
""" | ||
Test Subversion.get_url_rev_and_auth(). | ||
""" | ||
actual = Subversion().get_url_rev_and_auth(url) | ||
assert actual == expected | ||
|
||
|
||
# The non-SVN backends all use the same make_rev_args(), so only test | ||
# Git as a representative. | ||
@pytest.mark.parametrize('username, password, expected', [ | ||
|