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

cleanup: fix typings for requirements_file.py #231

Merged
merged 1 commit into from
Jul 24, 2024
Merged
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
5 changes: 3 additions & 2 deletions src/fromager/requirements_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ def parse_requirements_file(
def evaluate_marker(
parent_req: Requirement,
req: Requirement,
extras: dict | None = None,
extras: set[str] | None = None,
) -> bool:
if not req.marker:
return True

default_env = markers.default_environment()
# fixes mypy complaining about types: https://github.com/pypa/packaging/blob/main/src/packaging/markers.py#L310
default_env = typing.cast(dict[str, str], markers.default_environment())
if not extras:
marker_envs = [default_env]
else:
Expand Down
Loading