Issue
Metadata-Version
errors occur when attempting to build Python source packages from a Git repository in Posit Package Manager prior to version 2025.04.
error: unable to parse <PATH>, path may not point to a valid Python package: metadata is missing required fields
Background
The error is caused by the Python package being built with a Metadata-Version
that is currently not supported by Posit Package Manager. Specifically, a package is built using Metadata-Version
2.3 or 2.4, while PPM only currently supports up to Metadata-Version
2.2.
Resolution Steps
Identify the Build Backend: Confirm if the Python package build is using setuptools
, poetry-core
or hatchling
, which is responsible for setting the Metadata-Version
.
Pin the Build Backend Version(s): You can temporarily work around this by pinning the build backend of your package to the latest version that uses core Metadata-Version
2.2 or earlier. These versions include setuptools==76.1.0, poetry-core==1.9.1, and hatchling==1.21.1.
For example, with poetry-core
the pyproject.toml
would use the following:
[build-system]
requires = ["poetry-core==1.9.1"]
build-backend = "poetry.core.masonry.api"
Rebuild the Package: Ensure the package builds successfully without Metadata-Version
errors after committing the changes to pyproject.toml
. If there are errors, the pyproject.toml
format may also need to be updated to use the syntax requirements for the pinned build backend version.
If you cannot modify the package or upgrade Package Manager, please contact Posit customer support (support@posit.co) for assistance.
Additional Information
Posit Package Manager versions 2025.04 and added core Metadata-Version
2.3 and 2.4 support for Python packages (See https://docs.posit.co/rspm/news/package-manager/index.html#posit-package-manager).
Comments