Skip to content

Make invalid version info in pyproject.toml less fatal#2417

Merged
messense merged 1 commit intoPyO3:mainfrom
mhils:dynamic-version
Dec 30, 2024
Merged

Make invalid version info in pyproject.toml less fatal#2417
messense merged 1 commit intoPyO3:mainfrom
mhils:dynamic-version

Conversation

@mhils
Copy link
Contributor

@mhils mhils commented Dec 29, 2024

This PR is a simple fix #2416 by making invalid version information in pyproject.toml less fatal.

Thank you for your great work on Maturin! 🍰

@messense
Copy link
Member

According the spec: https://packaging.python.org/en/latest/specifications/pyproject-toml/#dynamic

If the metadata does not list a key in dynamic, then a build back-end CANNOT fill in the requisite metadata on behalf of the user (i.e. dynamic is the only way to allow a tool to fill in metadata and the user must opt into the filling in).

the current behavior is spec compliant, change it to warn only may seem to resolve the error, it can resurface when user try to install a package from sdist (because wheel isn't avaiable for some reason), for eample when using uv: #2390

@messense messense merged commit 0e143c1 into PyO3:main Dec 30, 2024
messense added a commit that referenced this pull request Dec 30, 2024
…toml` (#2418)

This PR implements the changes discussed in
#2416 (comment) on
top of #2417. Got this done faster than expected this morning, but won't
have any time to incorporate feedback for the next ~ two days. Feel free
to pull this in and butcher it any way you like. :)

Thanks again for your fantastic work on maturin! 🍰

---------

Co-authored-by: messense <messense@icloud.com>
@mhils mhils deleted the dynamic-version branch December 30, 2024 14:01
amorenoz added a commit to amorenoz/retis that referenced this pull request Jul 2, 2025
According to the schema of `pyproject.toml` [1] `project.version` must
be specified or marked as dynamic.

Maturin has started to nag (making "develop" fail) [2][3][4] if it's not
the case.

Since maturin gets the version from Cargo.toml anyway, mark it as
dynamic.

[1] https://json.schemastore.org/pyproject.json
[2] PyO3/maturin#2417
[3] PyO3/maturin#2416
[4] PyO3/maturin#2418

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
amorenoz added a commit to amorenoz/retis that referenced this pull request Jul 11, 2025
According to the schema of `pyproject.toml` [1] `project.version` must
be specified or marked as dynamic.

Maturin has started to nag [2][3][4] if it's not the case, making
"maturin develop" executions fail.

Since maturin gets the version from Cargo.toml anyway, mark it as
dynamic.

[1] https://json.schemastore.org/pyproject.json
[2] PyO3/maturin#2417
[3] PyO3/maturin#2416
[4] PyO3/maturin#2418

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
amorenoz added a commit to amorenoz/retis that referenced this pull request Jul 11, 2025
According to the schema of `pyproject.toml` [1] `project.version` must
be specified or marked as dynamic.

Maturin has started to nag [2][3][4] if it's not the case, making
"maturin develop" executions fail.

Since maturin gets the version from Cargo.toml anyway, mark it as
dynamic.

[1] https://json.schemastore.org/pyproject.json
[2] PyO3/maturin#2417
[3] PyO3/maturin#2416
[4] PyO3/maturin#2418

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
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

Successfully merging this pull request may close these issues.

project.version field is required

2 participants