Skip to content

define script entry points under a [project.scripts] table per PEP 621 #293

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

Closed
zappuf opened this issue Apr 22, 2025 · 1 comment
Closed

Comments

@zappuf
Copy link

zappuf commented Apr 22, 2025

The current behavior of the pyproject-fmt package does not align with PEP 621 regarding the definition of script entry points. According to PEP 621, script entry points should be defined under a [project.scripts] table. However, pyproject-fmt removes the [project.scripts] table if it exists and instead adds an entry to the pyproject.toml file as scripts.PACKAGE_NAME.

This behavior is problematic for projects that follow PEP 621 standards and expect script entry points to be defined under the [project.scripts] table. It would be beneficial for pyproject-fmt to support the [project.scripts] table and define script entry points accordingly.

@gaborbernat
Copy link
Member

gaborbernat commented Apr 22, 2025

PEP 621 does not mandate the layout of the file. If you believe it does, you're reading it incorrectly. PEP-621 defines the structure, but the layout can be any valid TOML. Just because the examples use one format, that's a personal preference of the PEP author, not a mandate. From a TOML POV:

[project.scripts]
a = "b"

is equivalent with:

[project]
scripts.a = "b"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants