Skip to content

Commit

Permalink
No longer use Poetry as a build backend but poetry-core instead
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed Mar 20, 2020
1 parent 39d0151 commit 61504bf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
16 changes: 11 additions & 5 deletions docs/docs/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions poetry/layouts/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 61504bf

Please sign in to comment.