Skip to content

Commit

Permalink
fix parsing PEP 508 url requirements with extras
Browse files Browse the repository at this point in the history
  • Loading branch information
abn authored and neersighted committed May 7, 2022
1 parent 6f1ed6f commit dee2c33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/poetry/core/packages/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def create_from_pep_508(
name, "git", link.url_without_fragment, extras=req.extras
)
elif link.scheme in ["http", "https"]:
dep = URLDependency(name, link.url)
dep = URLDependency(name, link.url, extras=req.extras)
elif is_file_uri:
# handle RFC 8089 references
path = url_to_path(req.url)
Expand Down
5 changes: 5 additions & 0 deletions tests/packages/test_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,8 @@ def test_marker_properly_unsets_python_constraint() -> None:

dependency.marker = "*" # type: ignore[assignment]
assert str(dependency.python_constraint) == "*"


def test_create_from_pep_508_url_with_activated_extras() -> None:
dependency = Dependency.create_from_pep_508("name [fred,bar] @ http://foo.com")
assert dependency.extras == {"fred", "bar"}

0 comments on commit dee2c33

Please sign in to comment.