From 0de81a7ce270eb5d07a51db12bc369a531945d86 Mon Sep 17 00:00:00 2001 From: Shubh Bapna Date: Tue, 23 Jul 2024 17:10:55 -0400 Subject: [PATCH] fix typings for requirements_file.py --- src/fromager/requirements_file.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fromager/requirements_file.py b/src/fromager/requirements_file.py index a59a246d..24dfc1fb 100644 --- a/src/fromager/requirements_file.py +++ b/src/fromager/requirements_file.py @@ -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: