@@ -75,9 +75,13 @@ def _args(ctx):
7575
7676def _lock_impl (ctx ):
7777 srcs = ctx .files .srcs
78+ python_version = full_version (
79+ version = ctx .attr .python_version or DEFAULT_PYTHON_VERSION ,
80+ minor_mapping = MINOR_MAPPING ,
81+ )
7882 output = ctx .actions .declare_file ("{}.{}.out" .format (
7983 ctx .label .name ,
80- ctx . attr . python_version .replace ("." , "_" ),
84+ python_version .replace ("." , "_" ),
8185 ))
8286
8387 toolchain_info = ctx .toolchains [UV_TOOLCHAIN_TYPE ]
@@ -216,10 +220,6 @@ modifications and the locking is not done from scratch.
216220 ),
217221 "python_version" : attr .string (
218222 doc = "Public, see the docs in the macro." ,
219- default = full_version (
220- version = DEFAULT_PYTHON_VERSION ,
221- minor_mapping = MINOR_MAPPING ,
222- ) if BZLMOD_ENABLED else "" ,
223223 ),
224224 "srcs" : attr .label_list (
225225 mandatory = True ,
@@ -412,7 +412,8 @@ def lock(
412412 are compiling the requirements file for using it as a constraints
413413 file. Defaults to `False`.
414414 python_version: {type}`str | None` the python_version to transition to
415- when locking the requirements.
415+ when locking the requirements. Defaults to the default python version
416+ configured by the {obj}`python` module extension.
416417 target_compatible_with: The `target_compatible_with` for the locking action.
417418 tags: The common tags for all of the targets. This defaults to [`manual`].
418419 Note, that the locking target also adds `requires-network` and
0 commit comments