From 61504bf78adfa60fe679e201069e5ffa36e1ad18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Eustace?= Date: Fri, 20 Mar 2020 23:37:43 +0100 Subject: [PATCH] No longer use Poetry as a build backend but poetry-core instead --- docs/docs/pyproject.md | 16 +++++++++++----- poetry/layouts/layout.py | 4 ++-- pyproject.toml | 7 ++----- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/docs/pyproject.md b/docs/docs/pyproject.md index b6bcbe318f1..1bec5940345 100644 --- a/docs/docs/pyproject.md +++ b/docs/docs/pyproject.md @@ -274,16 +274,22 @@ If you publish you package on PyPI, they will appear in the `Project Links` sect [PEP-517](https://www.python.org/dev/peps/pep-0517/) introduces a standard way to define alternative build systems to build a Python project. -Poetry is compliant with PEP-517 so if you use Poetry to manage your Python -project you should reference it in the `build-system` section of the `pyproject.toml` -file like so: +Poetry is compliant with PEP-517, by providing a lightweight core library, +so if you use Poetry to manage your Python project you should reference +it in the `build-system` section of the `pyproject.toml` file like so: ```toml [build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" +requires = ["poetry_core>=1.0.0"] +build-backend = "poetry_core.masonry.api" ``` !!!note When using the `new` or `init` command this section will be automatically added. + + +!!!note + + If your `pyproject.toml` file still references `poetry` directly as a build backend, + you should update it to reference `poetry_core` instead. diff --git a/poetry/layouts/layout.py b/poetry/layouts/layout.py index f47157d7d25..d4bf2c77331 100644 --- a/poetry/layouts/layout.py +++ b/poetry/layouts/layout.py @@ -38,7 +38,7 @@ def test_version(): [tool.poetry.dev-dependencies] """ -BUILD_SYSTEM_MIN_VERSION = "0.12" +BUILD_SYSTEM_MIN_VERSION = "1.0.0" BUILD_SYSTEM_MAX_VERSION = None @@ -109,7 +109,7 @@ def generate_poetry_content(self): if BUILD_SYSTEM_MAX_VERSION is not None: build_system_version += ",<" + BUILD_SYSTEM_MAX_VERSION - build_system.add("requires", ["poetry" + build_system_version]) + build_system.add("requires", ["poetry_core" + build_system_version]) build_system.add("build-backend", "poetry.masonry.api") content.add("build-system", build_system) diff --git a/pyproject.toml b/pyproject.toml index ae81289c29c..be6ebf8d1b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,11 +75,8 @@ poetry = "poetry.console:main" [build-system] -requires = ["intreehooks"] -build-backend = "intreehooks:loader" - -[tool.intreehooks] -build-backend = "poetry.masonry.api" +requires = ["poetry_core>=1.0.0a3"] +build-backend = "poetry_core.masonry.api" [tool.isort]