Skip to content

Commit

Permalink
reword the --with help text and deprecate --without (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonapich authored Nov 17, 2024
1 parent 680b1a9 commit 13541e1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ poetry export -f requirements.txt --output requirements.txt

* `--format (-f)`: The format to export to (default: `requirements.txt`). Currently, only `constraints.txt` and `requirements.txt` are supported.
* `--output (-o)`: The name of the output file. If omitted, print to standard output.
* `--without`: The dependency groups to ignore when exporting.
* `--with`: The optional dependency groups to include when exporting.
* `--only`: The only dependency groups to include when exporting.
* `--with`: The optional and non-optional dependency groups to include. By default, only the main dependencies are included.
* `--only`: The only dependency groups to include. It is possible to exclude the `main` group this way.
* `--without`: The dependency groups to ignore. (**Deprecated**)
* `--default`: Only export the main dependencies. (**Deprecated**)
* `--dev`: Include development dependencies. (**Deprecated**)
* `--extras (-E)`: Extra sets of dependencies to include.
Expand Down
8 changes: 4 additions & 4 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ poetry export --only test,docs

* `--format (-f)`: The format to export to (default: `requirements.txt`). Currently, only `constraints.txt` and `requirements.txt` are supported.
* `--output (-o)`: The name of the output file. If omitted, print to standard output.
* `--without`: The dependency groups to ignore when exporting.
* `--with`: The optional dependency groups to include when exporting.
* `--only`: The only dependency groups to include when exporting.
* `--default`: Only export the main dependencies. (**Deprecated**)
* `--with`: The optional and non-optional dependency groups to include. By default, only the main dependencies are included.
* `--only`: The only dependency groups to include. It is possible to exclude the `main` group this way.
* {{< option name="without" deprecated=true >}}The dependency groups to ignore.{{< /option >}}
* {{< option name="default" deprecated=true >}}Only export the main dependencies.{{< /option >}}
* {{< option name="dev" deprecated=true >}}Include development dependencies.{{< /option >}}
* `--extras (-E)`: Extra sets of dependencies to include.
* `--all-extras`: Include all sets of extra dependencies.
Expand Down
25 changes: 24 additions & 1 deletion src/poetry_plugin_export/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,31 @@ class ExportCommand(GroupCommand):
None,
"Include development dependencies. (<warning>Deprecated</warning>)",
),
*GroupCommand._group_dependency_options(),
option("all-groups", None, "Include all dependency groups"),
option(
"with",
None,
# note: unlike poetry install, the default excludes non-optional groups
"The optional and non-optional dependency groups to include."
" By default, only the main dependencies are included.",
flag=False,
multiple=True,
),
option(
"only",
None,
"The only dependency groups to include.",
flag=False,
multiple=True,
),
option(
"without",
None,
# deprecated: groups are always excluded by default
"The dependency groups to ignore. (<warning>Deprecated</warning>)",
flag=False,
multiple=True,
),
option(
"extras",
"E",
Expand Down

0 comments on commit 13541e1

Please sign in to comment.