File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -200,18 +200,23 @@ The `build` command builds the source and wheels archives.
200
200
poetry build
201
201
```
202
202
203
- Note that, at the moment, only pure python wheels are supported.
203
+ The command will trigger the build system defined in the ` pyproject.toml ` file according to [ PEP 517] ( https://peps.python.org/pep-0517/ ) .
204
+ If necessary the build process happens in an isolated environment.
204
205
205
206
#### Options
206
207
207
208
* ` --format (-f) ` : Limit the format to either ` wheel ` or ` sdist ` .
208
209
* ` --clean ` : Clean output directory before building.
209
- * ` --local-version (-l) ` : Add or replace a local version label to the build.
210
+ * ` --local-version (-l) ` : Add or replace a local version label to the build (deprecated) .
210
211
* ` --output (-o) ` : Set output directory for build artifacts. Default is ` dist ` .
212
+ * ` --config-settings=<key>=<value> (-c) ` : Config settings to be passed to the build back-end. (multiple allowed)
211
213
212
214
{{% note %}}
213
215
When using ` --local-version ` , the identifier must be [ PEP 440] ( https://peps.python.org/pep-0440/#local-version-identifiers )
214
216
compliant. This is useful for adding build numbers, platform specificities etc. for private packages.
217
+
218
+ ` --local-version ` is deprecated and will be removed in a future version of Poetry.
219
+ Use ` --config-settings local-version=<version> ` instead.
215
220
{{% /note %}}
216
221
217
222
{{% warning %}}
Original file line number Diff line number Diff line change @@ -45,6 +45,16 @@ If you do not want to commit the lock file and you are using git, add it to the
45
45
46
46
Before you can actually publish your library, you will need to package it.
47
47
48
+ You need to define a build-system according to [ PEP 517] ( https://peps.python.org/pep-0517/ ) in the ` pyproject.toml ` file:
49
+
50
+ ``` toml
51
+ [build-system ]
52
+ requires = [" poetry-core>=2.0.0,<3.0.0" ]
53
+ build-backend = " poetry.core.masonry.api"
54
+ ```
55
+
56
+ Then you can package your library by running:
57
+
48
58
``` bash
49
59
poetry build
50
60
```
@@ -63,6 +73,21 @@ a `wheel`, the following files are included in the `.dist-info` directory:
63
73
When building an ` sdist ` , the following files will be included in the root folder:
64
74
- ` LICENSE* `
65
75
76
+ ### Alternative build backends
77
+
78
+ If you want to use a different build backend, you can specify it in the ` pyproject.toml ` file:
79
+
80
+ ``` toml
81
+ [build-system ]
82
+ requires = [" maturin>=0.8.1,<0.9" ]
83
+ build-backend = " maturin"
84
+ ```
85
+
86
+ The ` poetry build ` command will then use the specified build backend to build your package in
87
+ an isolated environment. Ensure you have specified any additional settings according to the
88
+ documentation of the build backend you are using.
89
+
90
+
66
91
Once building is done you are ready to publish your library.
67
92
68
93
## Publishing to PyPI
You can’t perform that action at this time.
0 commit comments