|
| 1 | +--- |
| 2 | +layout: single |
| 3 | +title: "Announcing Poetry 2.1.0" |
| 4 | +date: 2025-02-xx |
| 5 | +categories: [ releases ] |
| 6 | +tags: [ "2.x", "2.1" ] |
| 7 | +--- |
| 8 | + |
| 9 | +The Poetry team is pleased to announce the immediate availability of Poetry **2.1.0**. |
| 10 | + |
| 11 | +<!--more--> |
| 12 | + |
| 13 | +If you have a previous version of Poetry installed via `pipx`, |
| 14 | +getting Poetry **2.1.0** is as easy as: |
| 15 | + |
| 16 | +```bash |
| 17 | +$ pipx upgrade poetry |
| 18 | +``` |
| 19 | + |
| 20 | +If you used the [official installer](/docs/#installation), you can run: |
| 21 | + |
| 22 | +```bash |
| 23 | +$ poetry self update |
| 24 | +``` |
| 25 | + |
| 26 | +## Highlights |
| 27 | + |
| 28 | +### Support for Alternative Build Backends in Poetry |
| 29 | + |
| 30 | +Poetry now supports customizable build backends, allowing greater flexibility based on your project's needs. Previously, |
| 31 | +Poetry exclusively used its own build backend, `poetry-core`, when creating packages via the `poetry build` command. |
| 32 | +Thanks to [PEP 621](https://peps.python.org/pep-0621/), this limitation is being lifted. |
| 33 | + |
| 34 | +With this change, the `poetry build` command will fully respect the `[build-system]` section defined in your |
| 35 | +`pyproject.toml` file. If the specified build backend differs from the version of `poetry-core` bundled with Poetry, the |
| 36 | +build will take place in an isolated environment. |
| 37 | + |
| 38 | +#### Defining Custom Build Backends |
| 39 | + |
| 40 | +You can define the build backend in your `pyproject.toml`. For example, to use `maturin` as your build system, specify |
| 41 | +it like this: |
| 42 | + |
| 43 | +```toml |
| 44 | +[build-system] |
| 45 | +requires = ["maturin>=0.8.1,<0.9"] |
| 46 | +build-backend = "maturin" |
| 47 | +``` |
| 48 | + |
| 49 | +When running `poetry build`, Poetry will create an isolated environment with the specified requirements. |
| 50 | + |
| 51 | +#### Passing Configuration to Build Systems |
| 52 | + |
| 53 | +If your chosen build system supports custom configuration settings, these can be passed via the new `--config-settings` |
| 54 | +parameter. Use the format `--config-settings <key>=<value>`. You can pass multiple settings by using the parameter |
| 55 | +repeatedly. |
| 56 | + |
| 57 | +For example, `poetry-core` allows you to specify a local version identifier during the build: |
| 58 | + |
| 59 | +```bash |
| 60 | +poetry build --config-settings local-version=some-local |
| 61 | +``` |
| 62 | + |
| 63 | +This parameter ensures compatibility with advanced use cases and third-party build backends. |
| 64 | + |
| 65 | +#### Default Behavior When No Build System Is Defined |
| 66 | + |
| 67 | +Per [PEP 517](https://peps.python.org/pep-0517/), a build tool should fall back to `setuptools` if no build system is |
| 68 | +defined in the `[build-system]` section of `pyproject.toml`. However, to avoid immediate disruption, Poetry will |
| 69 | +currently issue a **warning** in such cases and continue using the built-in `poetry-core` backend by default. |
| 70 | + |
| 71 | +**Note:** This behavior will change in the next minor release of Poetry. When a `[build-system]` section is not defined, |
| 72 | +Poetry will then default to using `setuptools`. |
| 73 | + |
| 74 | +## Changelog |
| 75 | + |
| 76 | +TODO |
0 commit comments