@@ -372,7 +372,8 @@ def lock(
372372 generate_hashes = True ,
373373 python_version = None ,
374374 strip_extras = False ,
375- ** kwargs ):
375+ target_compatible_with = None ,
376+ tags = ["manual" ]):
376377 """Pin the requirements based on the src files.
377378
378379 This macro creates the following targets:
@@ -411,7 +412,10 @@ def lock(
411412 file. Defaults to `False`.
412413 python_version: {type}`str | None` the python_version to transition to
413414 when locking the requirements.
414- **kwargs: Extra kwargs passed to the `name.update` {obj}`py_binary` target.
415+ target_compatible_with: The `target_compatible_with` for the locking action.
416+ tags: The common tags for all of the targets. This defaults to [`manual`].
417+ Note, that the locking target also adds `requires-network` and
418+ `no-cache` due to the nature of how `uv` works.
415419 """
416420 update_target = "{}.update" .format (name )
417421 locker_target = "{}.run" .format (name )
@@ -420,7 +424,6 @@ def lock(
420424 # output file location in order to make `uv` not change the requirements if
421425 # we are just running the command.
422426 maybe_out = _maybe_file (out )
423- target_compatible_with = kwargs .pop ("target_compatible_with" , None )
424427 if target_compatible_with == None and not BZLMOD_ENABLED :
425428 target_compatible_with = ["@platforms//:incompatible" ]
426429 elif target_compatible_with == None :
@@ -444,10 +447,9 @@ def lock(
444447 update_target = update_target ,
445448 output = out ,
446449 tags = [
447- "manual" ,
448450 "no-cache" ,
449451 "requires-network" ,
450- ],
452+ ] + tags ,
451453 )
452454
453455 # A target for updating the in-tree version directly by skipping the in-action
@@ -460,7 +462,7 @@ def lock(
460462 "@platforms//os:windows" : True ,
461463 "//conditions:default" : False ,
462464 }),
463- tags = [ "manual" ] ,
465+ tags = tags ,
464466 )
465467
466468 # FIXME @aignas 2025-03-20: is it possible to extend `py_binary` so that the
@@ -472,12 +474,12 @@ def lock(
472474 src = name ,
473475 output = out ,
474476 update_target = update_target ,
475- tags = [ "manual" ] ,
477+ tags = tags ,
476478 )
477479
478480 py_binary (
479481 name = update_target ,
480482 srcs = [template_target ],
481483 data = [name ] + ([maybe_out ] if maybe_out else []),
482- tags = [ "manual" ] ,
484+ tags = tags ,
483485 )
0 commit comments