Skip to content

build (build.script) is not executed anymore with poetry-core 1.5.0 #7474

@mgorny

Description

@mgorny
  • Poetry version: poetry-core 1.5.0

  • Python version: 3.11.1

  • OS version and name: Gentoo Linux amd64

  • pyproject.toml: https://github.com/matrix-org/synapse/blob/develop/pyproject.toml

  • I am on the latest stable Poetry version, installed using a recommended method.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • I have consulted the FAQ and blog for any relevant entries or release notes.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

The linked pyproject.toml uses the following key in its pyproject.toml:

[tool.poetry]
build = "build_rust.py"

If it is restricted to poetry-core < 1.5, the build script seems to be executed correctly:

$ python -m build -w
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (poetry-core>=1.0.0,<1.5, setuptools_rust>=1.3,<=1.5.2)
* Getting build dependencies for wheel...
* Building wheel...
A setup.py file already exists. Using it.
running build
running build_py
running build_ext
running build_rust
cargo rustc --lib --message-format=json-render-diagnostics --manifest-path rust/Cargo.toml --release -v --features pyo3/extension-module -- --crate-type cdylib
    Updating crates.io index
[...]

However, with 1.5.0 it seems to be no longer executed:

$ python -m build -w
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (poetry-core>=1.0.0, setuptools_rust>=1.3,<=1.5.2)
* Getting build dependencies for wheel...
* Building wheel...
Successfully built matrix_synapse-1.76.0-cp311-cp311-manylinux_2_36_x86_64.whl

I thought that perhaps it's because the project is using the legacy key but I get the same result after changing it to:

[tool.poetry.build]
script = "build_rust.py"

I couldn't find anything in 1.5.0 changelog, nor anything stands out in git diff.

That said, this is not my project, and I don't see this documented on https://python-poetry.org/docs/pyproject/, so I'm not even sure if this was supposed to work with poetry-core in the first place.

The problem has also been reported to matrix-org/synapse#14966. I've hit a very similar problem in cdgriffith/Box#244.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions