Skip to content

Commit 7236966

Browse files
authored
Add -n alias for --conda-env-name (#219)
1 parent 8a8013a commit 7236966

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ See `unidep merge -h` for more information:
485485
usage: unidep merge [-h] [-o OUTPUT] [-n NAME] [--stdout]
486486
[--selector {sel,comment}] [-d DIRECTORY] [--depth DEPTH]
487487
[-v]
488-
[--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
488+
[-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
489489
[--skip-dependency SKIP_DEPENDENCY]
490490
[--ignore-pin IGNORE_PIN] [--overwrite-pin OVERWRITE_PIN]
491491

@@ -514,7 +514,7 @@ options:
514514
--depth DEPTH Maximum depth to scan for `requirements.yaml` or
515515
`pyproject.toml` files, by default 1
516516
-v, --verbose Print verbose output
517-
--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, -p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
517+
-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, --platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
518518
The platform(s) to get the requirements for. Multiple
519519
platforms can be specified. By default, the current
520520
platform (`linux-64`) is used.
@@ -555,7 +555,7 @@ usage: unidep install [-h] [-v] [-e] [--skip-local] [--skip-pip]
555555
[--skip-conda] [--skip-dependency SKIP_DEPENDENCY]
556556
[--no-dependencies]
557557
[--conda-executable {conda,mamba,micromamba}]
558-
[--conda-env-name CONDA_ENV_NAME | --conda-env-prefix CONDA_ENV_PREFIX]
558+
[-n CONDA_ENV_NAME | --conda-env-prefix CONDA_ENV_PREFIX]
559559
[--dry-run] [--ignore-pin IGNORE_PIN]
560560
[--overwrite-pin OVERWRITE_PIN] [-f CONDA_LOCK_FILE]
561561
[--no-uv]
@@ -601,7 +601,7 @@ options:
601601
installed.
602602
--conda-executable {conda,mamba,micromamba}
603603
The conda executable to use
604-
--conda-env-name CONDA_ENV_NAME
604+
-n CONDA_ENV_NAME, --conda-env-name CONDA_ENV_NAME
605605
Name of the conda environment, if not provided, the
606606
currently active environment name is used, unless
607607
`--conda-env-prefix` is provided
@@ -647,7 +647,7 @@ usage: unidep install [-h] [-v] [-e] [--skip-local] [--skip-pip]
647647
[--skip-conda] [--skip-dependency SKIP_DEPENDENCY]
648648
[--no-dependencies]
649649
[--conda-executable {conda,mamba,micromamba}]
650-
[--conda-env-name CONDA_ENV_NAME | --conda-env-prefix CONDA_ENV_PREFIX]
650+
[-n CONDA_ENV_NAME | --conda-env-prefix CONDA_ENV_PREFIX]
651651
[--dry-run] [--ignore-pin IGNORE_PIN]
652652
[--overwrite-pin OVERWRITE_PIN] [-f CONDA_LOCK_FILE]
653653
[--no-uv]
@@ -693,7 +693,7 @@ options:
693693
installed.
694694
--conda-executable {conda,mamba,micromamba}
695695
The conda executable to use
696-
--conda-env-name CONDA_ENV_NAME
696+
-n CONDA_ENV_NAME, --conda-env-name CONDA_ENV_NAME
697697
Name of the conda environment, if not provided, the
698698
currently active environment name is used, unless
699699
`--conda-env-prefix` is provided
@@ -739,7 +739,7 @@ See `unidep conda-lock -h` for more information:
739739
usage: unidep conda-lock [-h] [--only-global] [--lockfile LOCKFILE]
740740
[--check-input-hash] [-d DIRECTORY] [--depth DEPTH]
741741
[-f FILE] [-v]
742-
[--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
742+
[-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
743743
[--skip-dependency SKIP_DEPENDENCY]
744744
[--ignore-pin IGNORE_PIN]
745745
[--overwrite-pin OVERWRITE_PIN]
@@ -784,7 +784,7 @@ options:
784784
all `requirements.yaml` or `pyproject.toml` files in
785785
the directory and its subdirectories.
786786
-v, --verbose Print verbose output
787-
--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, -p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
787+
-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, --platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
788788
The platform(s) to get the requirements for. Multiple
789789
platforms can be specified. By default, the current
790790
platform (`linux-64`) is used.
@@ -823,7 +823,7 @@ See `unidep pip-compile -h` for more information:
823823
```bash
824824
usage: unidep pip-compile [-h] [-o OUTPUT_FILE] [-d DIRECTORY] [--depth DEPTH]
825825
[-v]
826-
[--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
826+
[-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
827827
[--skip-dependency SKIP_DEPENDENCY]
828828
[--ignore-pin IGNORE_PIN]
829829
[--overwrite-pin OVERWRITE_PIN]
@@ -858,7 +858,7 @@ options:
858858
--depth DEPTH Maximum depth to scan for `requirements.yaml` or
859859
`pyproject.toml` files, by default 1
860860
-v, --verbose Print verbose output
861-
--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, -p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
861+
-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, --platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
862862
The platform(s) to get the requirements for. Multiple
863863
platforms can be specified. By default, the current
864864
platform (`linux-64`) is used.
@@ -896,7 +896,7 @@ See `unidep pip -h` for more information:
896896
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
897897
```bash
898898
usage: unidep pip [-h] [-f FILE] [-v]
899-
[--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
899+
[-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
900900
[--skip-dependency SKIP_DEPENDENCY]
901901
[--ignore-pin IGNORE_PIN] [--overwrite-pin OVERWRITE_PIN]
902902
[--separator SEPARATOR]
@@ -915,7 +915,7 @@ options:
915915
parse, or folder that contains that file, by default
916916
`.`
917917
-v, --verbose Print verbose output
918-
--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, -p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
918+
-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, --platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
919919
The platform(s) to get the requirements for. Multiple
920920
platforms can be specified. By default, the current
921921
platform (`linux-64`) is used.
@@ -955,7 +955,7 @@ See `unidep conda -h` for more information:
955955
<!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
956956
```bash
957957
usage: unidep conda [-h] [-f FILE] [-v]
958-
[--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
958+
[-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}]
959959
[--skip-dependency SKIP_DEPENDENCY]
960960
[--ignore-pin IGNORE_PIN] [--overwrite-pin OVERWRITE_PIN]
961961
[--separator SEPARATOR]
@@ -974,7 +974,7 @@ options:
974974
parse, or folder that contains that file, by default
975975
`.`
976976
-v, --verbose Print verbose output
977-
--platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, -p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
977+
-p {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}, --platform {linux-64,linux-aarch64,linux-ppc64le,osx-64,osx-arm64,win-64}
978978
The platform(s) to get the requirements for. Multiple
979979
platforms can be specified. By default, the current
980980
platform (`linux-64`) is used.

unidep/_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ def _add_common_args( # noqa: PLR0912, C901
127127
if "platform" in options:
128128
current_platform = identify_current_platform()
129129
sub_parser.add_argument(
130-
"--platform",
131130
"-p",
131+
"--platform",
132132
type=str,
133133
action="append", # Allow multiple instances of -p
134134
default=[],
@@ -195,6 +195,7 @@ def _add_common_args( # noqa: PLR0912, C901
195195
if "conda-env" in options:
196196
grp = sub_parser.add_mutually_exclusive_group()
197197
grp.add_argument(
198+
"-n",
198199
"--conda-env-name",
199200
type=str,
200201
default=None,

0 commit comments

Comments
 (0)