potiuk commented on code in PR #58231:
URL: https://github.com/apache/airflow/pull/58231#discussion_r2523363378
##########
dev/breeze/src/airflow_breeze/commands/common_options.py:
##########
@@ -413,12 +413,12 @@ def _set_default_from_parent(ctx: click.core.Context,
option: click.core.Option,
help="Use uv instead of pip as packaging tool to build the image.",
envvar="USE_UV",
)
-option_use_uv_default_disabled = click.option(
+option_use_uv_default_depends_on_installation_method = click.option(
"--use-uv/--no-use-uv",
is_flag=True,
- default=False,
- show_default=True,
- help="Use uv instead of pip as packaging tool to build the image.",
+ default=None,
Review Comment:
No. None is better. If we set it to False, then it will be set to False if
we do not specify it, and we want to - in this case - decide what should be the
default based on type of the build we run:
* sources -> uv
* packages -> pip
So effectively default on this one depends on value of other flags.
The way how it is done is Click is to have 3-state flag (True, False, None)
which translates to (bool | None)
- and then you can calculate the default based on other parameters later.
```python
if use_uv is None:
# calculate the default
```
Which is happening below.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]