Skip to content

Commit 20645fe

Browse files
committed
docs: update docs about the new behavior of the build command
1 parent 6925c54 commit 20645fe

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

docs/cli.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,16 @@ Note that, at the moment, only pure python wheels are supported.
206206

207207
* `--format (-f)`: Limit the format to either `wheel` or `sdist`.
208208
* `--clean`: Clean output directory before building.
209-
* `--local-version (-l)`: Add or replace a local version label to the build.
209+
* `--local-version (-l)`: Add or replace a local version label to the build (deprecated).
210210
* `--output (-o)`: Set output directory for build artifacts. Default is `dist`.
211+
* `--config-settings=CONFIG-SETTINGS`: Provide config settings that should be passed to backend in `<key>=<value>` format. (multiple values allowed)
211212

212213
{{% note %}}
213214
When using `--local-version`, the identifier must be [PEP 440](https://peps.python.org/pep-0440/#local-version-identifiers)
214215
compliant. This is useful for adding build numbers, platform specificities etc. for private packages.
216+
217+
`--local-version` is deprecated and will be removed in a future version of Poetry.
218+
Use `--config-settings local-version=<version>` instead.
215219
{{% /note %}}
216220

217221
{{% 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)