Skip to content

Commit 9c1afb5

Browse files
committed
docs: update docs about the new behavior of the build command
1 parent 1a27daa commit 9c1afb5

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

docs/cli.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,23 @@ The `build` command builds the source and wheels archives.
200200
poetry build
201201
```
202202

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.
204205

205206
#### Options
206207

207208
* `--format (-f)`: Limit the format to either `wheel` or `sdist`.
208209
* `--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).
210211
* `--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)
211213

212214
{{% note %}}
213215
When using `--local-version`, the identifier must be [PEP 440](https://peps.python.org/pep-0440/#local-version-identifiers)
214216
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.
215220
{{% /note %}}
216221

217222
{{% warning %}}

docs/libraries.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff 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
4545

4646
Before you can actually publish your library, you will need to package it.
4747

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+
4858
```bash
4959
poetry build
5060
```
@@ -63,6 +73,21 @@ a `wheel`, the following files are included in the `.dist-info` directory:
6373
When building an `sdist`, the following files will be included in the root folder:
6474
- `LICENSE*`
6575

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+
6691
Once building is done you are ready to publish your library.
6792

6893
## Publishing to PyPI

0 commit comments

Comments
 (0)