-
-
Notifications
You must be signed in to change notification settings - Fork 646
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
See https://python-poetry.org/docs/dependency-specification/#wildcard-requirements [ci skip-rust] [ci skip-build-wheels] Co-authored-by: Benjy Weinberger <[email protected]>
- Loading branch information
1 parent
f1187f4
commit de437a9
Showing
2 changed files
with
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,21 @@ def test_max_tilde(test, exp) -> None: | |
assert get_max_tilde(version) == exp | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"test, exp", | ||
[ | ||
("*", ""), | ||
("1.*", ">=1.0,<2.0.0"), | ||
("1.2.*", ">=1.2.0,<1.3.0"), | ||
], | ||
) | ||
def test_wildcard(test, exp) -> None: | ||
assert ( | ||
parse_str_version(test, proj_name="foo", file_path="", extras_str="") | ||
== f"foo {exp}".rstrip() | ||
) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"test, exp", | ||
[ | ||
|
@@ -363,6 +378,9 @@ def test_parse_multi_reqs() -> None: | |
[tool.poetry.group.mygroup.dependencies] | ||
myrequirement = "1.2.3" | ||
awildcard = "6.7.*" | ||
anotherwildcard = "44.*" | ||
aglobalwildcard = "*" | ||
[tool.poetry.group.mygroup2.dependencies] | ||
myrequirement2 = "1.2.3" | ||
|
@@ -379,6 +397,9 @@ def test_parse_multi_reqs() -> None: | |
actual_reqs = { | ||
PipRequirement.parse("junk[security]@ https://github.com/myrepo/junk.whl"), | ||
PipRequirement.parse("myrequirement==1.2.3"), | ||
PipRequirement.parse("awildcard>=6.7.0,<6.8.0"), | ||
PipRequirement.parse("anotherwildcard>=44.0,<45.0.0"), | ||
PipRequirement.parse("aglobalwildcard"), | ||
PipRequirement.parse("myrequirement2==1.2.3"), | ||
PipRequirement.parse("poetry@ git+https://github.com/python-poetry/[email protected]"), | ||
PipRequirement.parse('requests[security, random]<3.0.0,>=2.25.1; python_version > "2.7"'), | ||
|