Skip to content

Commit 5535e13

Browse files
[1.2] Add missing deprecation warning for --dev (#6493)
Backport 844a720 from #6475. Co-authored-by: Mathieu Kniewallner <[email protected]>
1 parent 22741bb commit 5535e13

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

docs/cli.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ poetry install --no-root
235235
* `--dry-run`: Output the operations but do not execute anything (implicitly enables --verbose).
236236
* `--extras (-E)`: Features to install (multiple values allowed).
237237
* `--all-extras`: Install all extra features (conflicts with --extras).
238-
* `--no-dev`: Do not install dev dependencies. (**Deprecated**)
239-
* `--remove-untracked`: Remove dependencies not presented in the lock file. (**Deprecated**)
238+
* `--no-dev`: Do not install dev dependencies. (**Deprecated**, use `--without dev` or `--only main` instead)
239+
* `--remove-untracked`: Remove dependencies not presented in the lock file. (**Deprecated**, use `--sync` instead)
240240

241241
{{% note %}}
242242
When `--only` is specified, `--with` and `--without` options are ignored.
@@ -271,7 +271,7 @@ update the constraint, for example `^2.3`. You can do this using the `add` comma
271271
* `--with`: The optional dependency groups to include.
272272
* `--only`: The only dependency groups to include.
273273
* `--dry-run` : Outputs the operations but will not execute anything (implicitly enables --verbose).
274-
* `--no-dev` : Do not update the development dependencies. (**Deprecated**)
274+
* `--no-dev` : Do not update the development dependencies. (**Deprecated**, use `--without dev` or `--only main` instead)
275275
* `--lock` : Do not perform install (only update the lockfile).
276276

277277
{{% note %}}
@@ -409,7 +409,7 @@ about dependency groups.
409409
### Options
410410

411411
* `--group (-G)`: The group to add the dependency to.
412-
* `--dev (-D)`: Add package as development dependency. (**Deprecated**)
412+
* `--dev (-D)`: Add package as development dependency. (**Deprecated**, use `-G dev` instead)
413413
* `--editable (-e)`: Add vcs/path dependencies as editable.
414414
* `--extras (-E)`: Extras to activate for the dependency. (multiple values allowed)
415415
* `--optional`: Add as an optional dependency.
@@ -442,13 +442,13 @@ about dependency groups.
442442
### Options
443443

444444
* `--group (-G)`: The group to remove the dependency from.
445-
* `--dev (-D)`: Removes a package from the development dependencies. (**Deprecated**)
445+
* `--dev (-D)`: Removes a package from the development dependencies. (**Deprecated**, use `-G dev` instead)
446446
* `--dry-run` : Outputs the operations but will not execute anything (implicitly enables --verbose).
447447

448448

449449
## show
450450

451-
To list all of the available packages, you can use the `show` command.
451+
To list all the available packages, you can use the `show` command.
452452

453453
```bash
454454
poetry show
@@ -478,7 +478,7 @@ required by
478478
* `--why`: When showing the full list, or a `--tree` for a single package, display why a package is included.
479479
* `--with`: The optional dependency groups to include.
480480
* `--only`: The only dependency groups to include.
481-
* `--no-dev`: Do not list the dev dependencies. (**Deprecated**)
481+
* `--no-dev`: Do not list the dev dependencies. (**Deprecated**, use `--without dev` or `--only main` instead)
482482
* `--tree`: List the dependencies as a tree.
483483
* `--latest (-l)`: Show the latest version.
484484
* `--outdated (-o)`: Show the latest version but only for packages that are outdated.
@@ -689,7 +689,7 @@ group defined in `tool.poetry.dependencies` when used without specifying any opt
689689
Currently, only `requirements.txt` is supported.
690690
* `--output (-o)`: The name of the output file. If omitted, print to standard
691691
output.
692-
* `--dev`: Include development dependencies. (**Deprecated**)
692+
* `--dev`: Include development dependencies. (**Deprecated**, use `--with dev` instead)
693693
* `--extras (-E)`: Extra sets of dependencies to include.
694694
* `--without`: The dependency groups to ignore.
695695
* `--with`: The optional dependency groups to include.

src/poetry/console/commands/add.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ class AddCommand(InstallerCommand, InitCommand):
2727
flag=False,
2828
default=MAIN_GROUP,
2929
),
30-
option("dev", "D", "Add as a development dependency."),
30+
option(
31+
"dev",
32+
"D",
33+
"Add as a development dependency. (<warning>Deprecated</warning>)",
34+
),
3135
option("editable", "e", "Add vcs/path dependencies as editable."),
3236
option(
3337
"extras",

src/poetry/console/commands/remove.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ class RemoveCommand(InstallerCommand):
1818
arguments = [argument("packages", "The packages to remove.", multiple=True)]
1919
options = [
2020
option("group", "G", "The group to remove the dependency from.", flag=False),
21-
option("dev", "D", "Remove a package from the development dependencies."),
21+
option(
22+
"dev",
23+
"D",
24+
"Remove a package from the development dependencies."
25+
" (<warning>Deprecated</warning>)",
26+
),
2227
option(
2328
"dry-run",
2429
None,

0 commit comments

Comments
 (0)