You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This option is already usable via the toml config or env variables as per #252 but is still not available through the CLI.
This issue is to be tackled after some more progress and visibility have been obtained on #256.
Collecting here pieces of feedback from @jherland when I attempted to add the option in #252.
I don't think the default=False is needed when action="store_true" is used. Furthermore, I think it actually defeats the configuration cascade (which really depends on all relevant CLI options having default=argparse.SUPPRESS). What we want is that this behavior:
--install-deps on the command-line causes args.install_deps == True to be returned from argparse
No --install-deps on the command-line causes args.install_deps to NOT EXIST, allowing the install_deps option from the config file to take effect.
Additionally, I think the help message should emphasize that the deps are installed in a temporary/separate venv:
parser.add_argument(
"--install-deps",
action="store_true",
help=(
"Allow FawltyDeps to `pip install` declared dependencies into a"
" separate temporary virtualenv to discover the imports they expose"
),
)
This change highlights the problem that I talked about above: Setting install_deps = True in the config file, and then running without --install-deps on the command line should let the config file decide, but this illustrates that it doesn't: the default=False will always override whatever comes from the config file...
However, I realize there is an inherent problem with boolean command-line flags here: If you can only enable some behavior with a command-line option, then - if the behavior has already been enabled in the config file - how could you then disable this behavior at the command-line? I think the answer here is to provide a corresponding (mutually exclusive) --no-install-deps option that sets install_deps to False.
In other words we should have:
--install-deps: Set install_deps to True
--no-install-deps: Set install_deps to False
(nothing): Don't change install_deps at all. Use the value from the config file, falling back to the ultimate hardcoded default (False)
This option is already usable via the toml config or env variables as per #252 but is still not available through the CLI.
This issue is to be tackled after some more progress and visibility have been obtained on #256.
Collecting here pieces of feedback from @jherland when I attempted to add the option in #252.
Originally posted by @jherland in #252 (comment)
Originally posted by @jherland in #252 (comment)
The text was updated successfully, but these errors were encountered: