Skip to content

Commit

Permalink
Make seed option implicit and add --no-seed (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Dec 23, 2024
1 parent ce96fdb commit 1a346e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/ansible_dev_environment/arg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ def parse() -> argparse.Namespace:
install.add_argument(
# "-adt",
"--seed",
action="store_true",
dest="adt",
action=argparse.BooleanOptionalAction,
default=True,
dest="seed",
help="Install seed packages inside the virtual environment (ansible-dev-tools).",
)

Expand Down
2 changes: 1 addition & 1 deletion src/ansible_dev_environment/subcommands/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def run(self) -> None:
err = "Multiple optional dependencies are not supported at this time."
self._output.critical(err)

if self._config.args.adt:
if self._config.args.seed:
self._install_dev_tools()
else:
self._install_core()
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def session_venv(session_dir: Path, monkey_session: pytest.MonkeyPatch) -> Confi
[
"ade",
"install",
"--no-seed",
"-r",
str(GALAXY_CACHE / REQS_FILE_NAME),
"--venv",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def test_no_adt_install(
args = Namespace(
venv=venv,
verbose=0,
adt=False,
seed=False,
system_site_packages=False,
collection_specifier=None,
requirement=None,
Expand Down Expand Up @@ -302,7 +302,7 @@ def test_adt_install(
args = Namespace(
venv=venv,
verbose=0,
adt=True,
seed=True,
system_site_packages=False,
collection_specifier=None,
requirement=None,
Expand Down

0 comments on commit 1a346e3

Please sign in to comment.