Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

546 boolean options flags #600

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mlem/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ def _option_from_field(
else NOT_SET,
help=field.help,
show_default=not field.required,
is_flag=type_ is bool,
)
option.name = path
return option
Expand Down
17 changes: 1 addition & 16 deletions tests/cli/test_declare.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,24 +303,9 @@ class BooleanField(_MockBuilder):
(
pytest.param(
BooleanField(field=True),
"--field 1",
id="bool_true_1",
),
pytest.param(
BooleanField(field=False),
"--field 0",
id="bool_false_0",
),
pytest.param(
BooleanField(field=True),
"--field True",
"--field",
id="bool_true",
),
pytest.param(
BooleanField(field=False),
"--field False",
id="bool_false",
),
)
)

Expand Down