Skip to content

Commit

Permalink
Simplify cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusvniekerk committed Sep 10, 2020
1 parent 8acb9de commit 202e612
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions conda_lock/conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,21 +391,16 @@ def parser():
action="append",
help="generate lock files for the following platforms",
)
parser.add_argument(
"--override-channels",
action="store_true",
help="""
Do not use channel information from source files. This should be used in
conjunction with the -c/--channel flag to specify the channels desired
""",
default=False,
)
parser.add_argument(
"-c",
"--channel",
dest="channel_overrides",
nargs="?",
action="append",
help="Additional channels to include in the solve. Requires the --override-channels flag",
help="""
Override the channels to use when solving the environment. These will
replace the channels as listed in the various source files.
""",
)

group = parser.add_mutually_exclusive_group()
Expand Down Expand Up @@ -460,16 +455,15 @@ def run_lock(
platforms: Optional[List[str]] = None,
no_mamba: bool = False,
include_dev_dependencies: bool = True,
channels: Optional[Sequence[str]] = None,
override_channels=False,
channel_overrides: Optional[Sequence[str]] = None,
) -> None:
_conda_exe = ensure_conda(conda_exe, no_mamba=no_mamba)
make_lock_files(
conda=_conda_exe,
src_file=environment_file,
platforms=platforms or DEFAULT_PLATFORMS,
include_dev_dependencies=include_dev_dependencies,
channel_overrides=channels if override_channels else None,
channel_overrides=channel_overrides,
)


Expand All @@ -481,8 +475,7 @@ def main():
platforms=args.platform,
no_mamba=args.no_mamba,
include_dev_dependencies=args.dev_dependencies,
channels=args.channels,
override_channels=args.override_channels,
channel_overrides=args.channel_overrides,
)


Expand Down

0 comments on commit 202e612

Please sign in to comment.