@@ -115,14 +115,14 @@ def parse_requirements(
115115
116116 # This may call to Python, so execute it early (before calling to the
117117 # internet below) and ensure that we call it only once.
118- env_marker_target_platforms = evaluate_markers (ctx , reqs_with_env_markers )
118+ resolved_marker_platforms = evaluate_markers (ctx , reqs_with_env_markers )
119119 logger .trace (lambda : "Evaluated env markers from:\n {}\n \n To:\n {}" .format (
120120 reqs_with_env_markers ,
121- env_marker_target_platforms ,
121+ resolved_marker_platforms ,
122122 ))
123123
124124 requirements_by_platform = {}
125- for target_platform , parse_results in requirements .items ():
125+ for plat , parse_results in requirements .items ():
126126 # Replicate a surprising behavior that WORKSPACE builds allowed:
127127 # Defining a repo with the same name multiple times, but only the last
128128 # definition is respected.
@@ -143,16 +143,12 @@ def parse_requirements(
143143 req_line = entry [1 ]
144144 req = requirement (req_line )
145145
146- if req .marker :
147- plats = env_marker_target_platforms .get (req_line , [])
148- if not plats :
149- continue
150- elif target_platform not in plats :
151- continue
146+ if req .marker and plat not in resolved_marker_platforms .get (req_line , []):
147+ continue
152148
153149 requirements_dict [req .name ] = entry
154150
155- extra_pip_args = options [target_platform ]
151+ extra_pip_args = options [plat ]
156152
157153 for distribution , requirement_line in requirements_dict .values ():
158154 for_whl = requirements_by_platform .setdefault (
@@ -170,7 +166,7 @@ def parse_requirements(
170166 extra_pip_args = extra_pip_args ,
171167 ),
172168 )
173- for_req .target_platforms .append (target_platform )
169+ for_req .target_platforms .append (plat )
174170
175171 index_urls = {}
176172 if get_index_urls :
0 commit comments