Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build function is ignored #7553

Closed
4 tasks done
ngoettin opened this issue Feb 24, 2023 · 5 comments
Closed
4 tasks done

build function is ignored #7553

ngoettin opened this issue Feb 24, 2023 · 5 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@ngoettin
Copy link

  • Poetry version: 1.3.2
  • Python version: 3.10.6
  • OS version and name: Arch Linux (24.02.2023)
  • pyproject.toml:
[tool.poetry]
name = "test"
authors = ["me"]
version = "0.1.0"
description = "test"

[tool.poetry.dependencies]
python = "^3.10"

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

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
  • 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

I tried to use Cython with poetry and failed, because the build-function did not seem to be executed. To test this, I created a new package with the following structure:

.
├── build.py
├── pyproject.toml
└── test
    └── __init__.py

where the pyproject.toml is shown above and the build.py contains only the following:

print("Hi! (1)")

def build(setup_kwargs):
    print("Hi! (2)")

Upon building the project, however, the only output I get is

~/Documents/test ❯ poetry build
Preparing build environment with build-system requirements poetry-core
Building test (0.1.0)
Hi! (1)

but I expected to also see Hi! (2) in the output.

What am I doing wrong? I've looked e.g. in the pendulum sources and I don't see how the concept of what I did differs from the build files there.

@ngoettin ngoettin added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 24, 2023
@dimbleby
Copy link
Contributor

generate-setup-file = true

probably

@ngoettin
Copy link
Author

Thank you so much, this solved the issue for me!

@ywu
Copy link

ywu commented Mar 9, 2023

I encountered the same problem. Where to put that generate-setup-file=true setting?

@ywu
Copy link

ywu commented Mar 9, 2023

Never mind. I just figured out.

[tool.poetry.build]
script = "build.py"
generate-setup-file=true

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants