Skip to content

Modernize Poetry build setup #582

@jherland

Description

@jherland

The current pyproject.toml uses instructions from an outdated version of Poetry. This complicates building and including this project in projects and ecosystems that use more current versions of Poetry.

Trying to add this project to nixpkgs (in NixOS/nixpkgs#418462) fails with

* Getting build dependencies for wheel...

Traceback (most recent call last):
  File "/nix/store/hv8xyk68b48ybj912m3a3kz904s0djas-python3.13-pyproject-hooks-1.2.0/lib/python3.13/site-packages/pyproject_hooks/_impl.py", line 402, in _call_hook
    raise BackendUnavailable(
    ...<4 lines>...
    )
pyproject_hooks._impl.BackendUnavailable: Cannot import 'poetry.masonry.api'

ERROR Backend 'poetry.masonry.api' is not available.

unless we patch pyproject.toml as follows:

diff --git a/pyproject.toml b/pyproject.toml
index 09d4f15..6b5037a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -32,5 +32,5 @@ recommonmark = "0.6.0"
 pytest = "6.2.5"
 
 [build-system]
-requires = ["poetry>=0.12"]
-build-backend = "poetry.masonry.api"
+requires = ["poetry-core>=1.0.0"]
+build-backend = "poetry.core.masonry.api"

This is the same update that Poetry itself recommends, since v1.1 (commit python-poetry/poetry@3b30d2a from five and a half years ago).

Expected behavior

Using tabnet in downstream projects or on systems that use current versions of Poetry should not fail, nor should it require patching tabnet.

Screenshots

N/A

Other relevant information:
poetry version: 2.1.3
python version: 3.13.4
Operating System: NixOS Unstable on Linux kernel 6.12.35
Additional tools:

Additional context

N/A

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions