Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix parsing PEP 508 url requirements with extras #345

Merged
merged 1 commit into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
abn marked this conversation as resolved.
Show resolved Hide resolved
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"}