-
Notifications
You must be signed in to change notification settings - Fork 103
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 #470 from jacksmith15/feat/461/private-pypi-strip-…
…auth Implement auth stripping for private PyPi packages
- Loading branch information
Showing
3 changed files
with
62 additions
and
7 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 |
---|---|---|
|
@@ -60,7 +60,7 @@ | |
) | ||
from conda_lock.models.channel import Channel | ||
from conda_lock.models.lock_spec import VCSDependency, VersionedDependency | ||
from conda_lock.pypi_solver import parse_pip_requirement, solve_pypi | ||
from conda_lock.pypi_solver import _strip_auth, parse_pip_requirement, solve_pypi | ||
from conda_lock.src_parser import ( | ||
DEFAULT_PLATFORMS, | ||
LockSpecification, | ||
|
@@ -1621,6 +1621,39 @@ def test__strip_auth_from_line(line: str, stripped: str): | |
assert _strip_auth_from_line(line) == stripped | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"url,stripped", | ||
( | ||
( | ||
"https://example.com/path?query=string#fragment", | ||
"https://example.com/path?query=string#fragment", | ||
), | ||
( | ||
"https://username:[email protected]/path?query=string#fragment", | ||
"https://example.com/path?query=string#fragment", | ||
), | ||
( | ||
"https://username:@example.com/path?query=string#fragment", | ||
"https://example.com/path?query=string#fragment", | ||
), | ||
( | ||
"https://:[email protected]/path?query=string#fragment", | ||
"https://example.com/path?query=string#fragment", | ||
), | ||
( | ||
"https://[email protected]:[email protected]/path?query=string#fragment", | ||
"https://example.com/path?query=string#fragment", | ||
), | ||
( | ||
"https://username:password@[email protected]/path?query=string#fragment", | ||
"https://example.com/path?query=string#fragment", | ||
), | ||
), | ||
) | ||
def test_strip_auth_from_url(url: str, stripped: str): | ||
assert _strip_auth(url) == stripped | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"line,stripped", | ||
( | ||
|