Skip to content

Commit

Permalink
install: rename --dev-only to --only-dev
Browse files Browse the repository at this point in the history
This aligns option to existing options like --no-dev and --no-root.

Relates-to: python-poetry#2917
  • Loading branch information
abn committed May 7, 2021
1 parent 4122379 commit 66f9dde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions docs/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ poetry install --no-dev
```

Conversely, you can specify to the command that you only want to install the development dependencies
by passing the `--dev-only` option. Note that `--no-dev` takes priority if both options are passed.
by passing the `--only-dev` option. Note that `--no-dev` takes priority if both options are passed.

```bash
poetry install --dev-only
poetry install --only-dev
```

If you want to remove old dependencies no longer present in the lock file, use the
Expand Down Expand Up @@ -168,13 +168,13 @@ If you want to skip this installation, use the `--no-root` option.
poetry install --no-root
```

Installation of your project's package is also skipped when the `--dev-only`
Installation of your project's package is also skipped when the `--only-dev`
option is passed.

### Options

* `--no-dev`: Do not install dev dependencies.
* `--dev-only`: Only install dev dependencies.
* `--only-dev`: Only install dev dependencies.
* `--no-root`: Do not install the root package (your project).
* `--dry-run`: Output the operations but do not execute anything (implicitly enables --verbose).
* `--remove-untracked`: Remove dependencies not presented in the lock file
Expand Down
6 changes: 3 additions & 3 deletions poetry/console/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class InstallCommand(InstallerCommand):

options = [
option("no-dev", None, "Do not install the development dependencies."),
option("dev-only", None, "Only install the development dependencies."),
option("only-dev", None, "Only install the development dependencies."),
option(
"no-root", None, "Do not install the root package (the current project)."
),
Expand Down Expand Up @@ -67,7 +67,7 @@ def handle(self) -> int:

self._installer.extras(extras)
self._installer.dev_mode(not self.option("no-dev"))
self._installer.dev_only(self.option("dev-only"))
self._installer.dev_only(self.option("only-dev"))
self._installer.dry_run(self.option("dry-run"))
self._installer.remove_untracked(self.option("remove-untracked"))
self._installer.verbose(self._io.is_verbose())
Expand All @@ -77,7 +77,7 @@ def handle(self) -> int:
if return_code != 0:
return return_code

if self.option("no-root") or self.option("dev-only"):
if self.option("no-root") or self.option("only-dev"):
return 0

try:
Expand Down

0 comments on commit 66f9dde

Please sign in to comment.