@@ -146,6 +146,7 @@ def _pip_parse(self, module_ctx, pip_attr):
146146 self ,
147147 module_ctx ,
148148 pip_attr = pip_attr ,
149+ enable_pipstar = self ._config .enable_pipstar or self ._get_index_urls .get (pip_attr .python_version ),
149150 )
150151
151152### end of PUBLIC methods
@@ -188,7 +189,7 @@ def _add_extra_aliases(self, extra_hub_aliases):
188189 {alias : True for alias in aliases },
189190 )
190191
191- def _add_whl_library (self , * , python_version , whl , repo ):
192+ def _add_whl_library (self , * , python_version , whl , repo , enable_pipstar ):
192193 if repo == None :
193194 # NOTE @aignas 2025-07-07: we guard against an edge-case where there
194195 # are more platforms defined than there are wheels for and users
@@ -208,7 +209,7 @@ def _add_whl_library(self, *, python_version, whl, repo):
208209 ))
209210 self ._whl_libraries [repo_name ] = repo .args
210211
211- if not self . _config . enable_pipstar and "experimental_target_platforms" in repo .args :
212+ if not enable_pipstar and "experimental_target_platforms" in repo .args :
212213 self ._whl_libraries [repo_name ] |= {
213214 "experimental_target_platforms" : sorted ({
214215 # TODO @aignas 2025-07-07: this should be solved in a better way
@@ -342,11 +343,11 @@ def _platforms(*, python_version, config):
342343 )
343344 return platforms
344345
345- def _evaluate_markers (self , pip_attr ):
346+ def _evaluate_markers (self , pip_attr , enable_pipstar ):
346347 if self ._evaluate_markers_fn :
347348 return self ._evaluate_markers_fn
348349
349- if self . _config . enable_pipstar :
350+ if enable_pipstar :
350351 return lambda _ , requirements : evaluate_markers_star (
351352 requirements = requirements ,
352353 platforms = self ._platforms [pip_attr .python_version ],
@@ -387,13 +388,15 @@ def _create_whl_repos(
387388 self ,
388389 module_ctx ,
389390 * ,
390- pip_attr ):
391+ pip_attr ,
392+ enable_pipstar = False ):
391393 """create all of the whl repositories
392394
393395 Args:
394396 self: the builder.
395397 module_ctx: {type}`module_ctx`.
396398 pip_attr: {type}`struct` - the struct that comes from the tag class iteration.
399+ enable_pipstar: {type}`bool` - enable the pipstar or not.
397400 """
398401 logger = self ._logger
399402 platforms = self ._platforms [pip_attr .python_version ]
@@ -416,7 +419,7 @@ def _create_whl_repos(
416419 platforms = platforms ,
417420 extra_pip_args = pip_attr .extra_pip_args ,
418421 get_index_urls = self ._get_index_urls .get (pip_attr .python_version ),
419- evaluate_markers = _evaluate_markers (self , pip_attr ),
422+ evaluate_markers = _evaluate_markers (self , pip_attr , enable_pipstar ),
420423 logger = logger ,
421424 )
422425
@@ -435,6 +438,7 @@ def _create_whl_repos(
435438 self ,
436439 module_ctx ,
437440 pip_attr = pip_attr ,
441+ enable_pipstar = enable_pipstar ,
438442 )
439443 for whl in requirements_by_platform :
440444 whl_library_args = common_args | _whl_library_args (
@@ -452,16 +456,17 @@ def _create_whl_repos(
452456 auth_patterns = self ._config .auth_patterns or pip_attr .auth_patterns ,
453457 python_version = _major_minor_version (pip_attr .python_version ),
454458 is_multiple_versions = whl .is_multiple_versions ,
455- enable_pipstar = self . _config . enable_pipstar ,
459+ enable_pipstar = enable_pipstar ,
456460 )
457461 _add_whl_library (
458462 self ,
459463 python_version = pip_attr .python_version ,
460464 whl = whl ,
461465 repo = repo ,
466+ enable_pipstar = enable_pipstar ,
462467 )
463468
464- def _common_args (self , module_ctx , * , pip_attr ):
469+ def _common_args (self , module_ctx , * , pip_attr , enable_pipstar ):
465470 interpreter = _detect_interpreter (self , pip_attr )
466471
467472 # Construct args separately so that the lock file can be smaller and does not include unused
@@ -481,7 +486,7 @@ def _common_args(self, module_ctx, *, pip_attr):
481486 python_interpreter = interpreter .path ,
482487 python_interpreter_target = interpreter .target ,
483488 )
484- if not self . _config . enable_pipstar :
489+ if not enable_pipstar :
485490 maybe_args ["experimental_target_platforms" ] = pip_attr .experimental_target_platforms
486491
487492 whl_library_args .update ({k : v for k , v in maybe_args .items () if v })
0 commit comments