File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -546,26 +546,28 @@ def _whl_library_impl(rctx):
546546 rctx .file ("MODULE.bazel" )
547547 rctx .file ("REPO.bazel" )
548548
549+ # BUILD files interfere with globbing and Bazel package boundaries.
550+ _remove_files (rctx , "BUILD" , "BUILD.bazel" )
551+ rctx .file ("BUILD.bazel" , build_file_contents )
552+
553+ if enable_pipstar and enable_pipstar_extract :
554+ if hasattr (rctx , "repo_metadata" ):
555+ return rctx .repo_metadata (reproducible = True )
556+
557+ return None
558+
559+ def _remove_files (rctx , * basenames ):
549560 paths = list (rctx .path ("." ).readdir ())
550561 for _ in range (10000000 ):
551562 if not paths :
552563 break
553564 path = paths .pop ()
554565
555- # BUILD files interfere with globbing and Bazel package boundaries.
556- if path .basename in ("BUILD" , "BUILD.bazel" ):
566+ if path .basename in basenames :
557567 rctx .delete (path )
558568 elif path .is_dir :
559569 paths .extend (path .readdir ())
560570
561- rctx .file ("BUILD.bazel" , build_file_contents )
562-
563- if enable_pipstar and enable_pipstar_extract :
564- if hasattr (rctx , "repo_metadata" ):
565- return rctx .repo_metadata (reproducible = True )
566-
567- return None
568-
569571def _generate_entry_point_contents (
570572 module ,
571573 attribute ,
You can’t perform that action at this time.
0 commit comments