Skip to content

Commit 342dda9

Browse files
authored
Merge pull request python-poetry#7 from python-poetry/docs
Add documentation
2 parents 97b576e + 0c7fb3b commit 342dda9

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ poetry export -f requirements.txt --output requirements.txt
4242

4343
* `--format (-f)`: The format to export to (default: `requirements.txt`). Currently, only `requirements.txt` is supported.
4444
* `--output (-o)`: The name of the output file. If omitted, print to standard output.
45-
* `--dev`: Include development dependencies.
45+
* `--without`: The dependency groups to ignore when exporting.
46+
* `--with`: The optional dependency groups to include when exporting.
47+
* `--only`: The only dependency groups to include when exporting.
48+
* `--default`: Only export the default dependencies.
49+
* `--dev`: Include development dependencies. (**Deprecated**)
4650
* `--extras (-E)`: Extra sets of dependencies to include.
4751
* `--without-hashes`: Exclude hashes from the exported file.
4852
* `--with-credentials`: Include credentials for extra indices.

docs/_index.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: "Export plugin"
3+
draft: false
4+
type: docs
5+
layout: single
6+
7+
menu:
8+
docs:
9+
weight: 1001
10+
---
11+
12+
# Export plugin
13+
14+
The export plugin allows the export of locked packages to various formats.
15+
16+
{{% note %}}
17+
Only the `requirements.txt` format is currently supported.
18+
{{% /note %}}
19+
20+
## Exporting packages
21+
22+
The plugin provides an `export` command to export the locked packages to
23+
various formats.
24+
25+
The default export format is the `requirements.txt` format which is currently
26+
the most compatible one. You can specify a format with the `--format (-f)` option:
27+
28+
```bash
29+
poetry export -f requirements.txt
30+
```
31+
32+
By default, the `export` command will export to the standard output.
33+
You can specify a file to export to with the `--output (-o)` option:
34+
35+
```bash
36+
poetry export --output requirements.txt
37+
```
38+
39+
Similarly to the [`install`]({{< relref "../cli#install" >}}) command, you can control
40+
which [dependency groups]({{< relref "managing-dependencies#dependency-groups" >}})
41+
need to be exported.
42+
43+
If you want to exclude one or more dependency group from the export, you can use
44+
the `--without` option.
45+
46+
```bash
47+
poetry export --without test,docs
48+
```
49+
50+
You can also select optional dependency groups with the `--with` option.
51+
52+
```bash
53+
poetry export --with test,docs
54+
```
55+
56+
{{% note %}}
57+
The `--dev` option is now deprecated. You should use the `--with dev` notation instead.
58+
{{% /note %}}
59+
60+
It's also possible to only export specific dependency groups by using the `only` option.
61+
62+
```bash
63+
poetry export --only test,docs
64+
```
65+
66+
### Available options
67+
68+
* `--format (-f)`: The format to export to (default: `requirements.txt`). Currently, only `requirements.txt` is supported.
69+
* `--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 default dependencies.
74+
* {{< option name="dev" deprecated=true >}}Include development dependencies.{{< /option >}}
75+
* `--extras (-E)`: Extra sets of dependencies to include.
76+
* `--without-hashes`: Exclude hashes from the exported file.
77+
* `--with-credentials`: Include credentials for extra indices.

0 commit comments

Comments
 (0)