Skip to content

Commit 13541e1

Browse files
authored
reword the --with help text and deprecate --without (#212)
1 parent 680b1a9 commit 13541e1

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ poetry export -f requirements.txt --output requirements.txt
4444

4545
* `--format (-f)`: The format to export to (default: `requirements.txt`). Currently, only `constraints.txt` and `requirements.txt` are supported.
4646
* `--output (-o)`: The name of the output file. If omitted, print to standard output.
47-
* `--without`: The dependency groups to ignore when exporting.
48-
* `--with`: The optional dependency groups to include when exporting.
49-
* `--only`: The only dependency groups to include when exporting.
47+
* `--with`: The optional and non-optional dependency groups to include. By default, only the main dependencies are included.
48+
* `--only`: The only dependency groups to include. It is possible to exclude the `main` group this way.
49+
* `--without`: The dependency groups to ignore. (**Deprecated**)
5050
* `--default`: Only export the main dependencies. (**Deprecated**)
5151
* `--dev`: Include development dependencies. (**Deprecated**)
5252
* `--extras (-E)`: Extra sets of dependencies to include.

docs/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ poetry export --only test,docs
6767

6868
* `--format (-f)`: The format to export to (default: `requirements.txt`). Currently, only `constraints.txt` and `requirements.txt` are supported.
6969
* `--output (-o)`: The name of the output file. If omitted, print to standard output.
70-
* `--without`: The dependency groups to ignore when exporting.
71-
* `--with`: The optional dependency groups to include when exporting.
72-
* `--only`: The only dependency groups to include when exporting.
73-
* `--default`: Only export the main dependencies. (**Deprecated**)
70+
* `--with`: The optional and non-optional dependency groups to include. By default, only the main dependencies are included.
71+
* `--only`: The only dependency groups to include. It is possible to exclude the `main` group this way.
72+
* {{< option name="without" deprecated=true >}}The dependency groups to ignore.{{< /option >}}
73+
* {{< option name="default" deprecated=true >}}Only export the main dependencies.{{< /option >}}
7474
* {{< option name="dev" deprecated=true >}}Include development dependencies.{{< /option >}}
7575
* `--extras (-E)`: Extra sets of dependencies to include.
7676
* `--all-extras`: Include all sets of extra dependencies.

src/poetry_plugin_export/command.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,31 @@ class ExportCommand(GroupCommand):
4141
None,
4242
"Include development dependencies. (<warning>Deprecated</warning>)",
4343
),
44-
*GroupCommand._group_dependency_options(),
4544
option("all-groups", None, "Include all dependency groups"),
45+
option(
46+
"with",
47+
None,
48+
# note: unlike poetry install, the default excludes non-optional groups
49+
"The optional and non-optional dependency groups to include."
50+
" By default, only the main dependencies are included.",
51+
flag=False,
52+
multiple=True,
53+
),
54+
option(
55+
"only",
56+
None,
57+
"The only dependency groups to include.",
58+
flag=False,
59+
multiple=True,
60+
),
61+
option(
62+
"without",
63+
None,
64+
# deprecated: groups are always excluded by default
65+
"The dependency groups to ignore. (<warning>Deprecated</warning>)",
66+
flag=False,
67+
multiple=True,
68+
),
4669
option(
4770
"extras",
4871
"E",

0 commit comments

Comments
 (0)