jrl-umi3218 / jrl-cmakemodules

CMake utility toolbox
https://jrl-cmakemodules.readthedocs.io/en/master/
Other
57 stars 45 forks source link

pyproject.py: check project / version exist #558

Closed nim65s closed 1 year ago

nim65s commented 1 year ago

Hi,

On projects with a pyproject.toml file without a project key with a version inside, make release is currently failing with:

╰─>$ make -sj3 release VERSION=4.0.10
Updating package.xml to 4.0.10
[devel 3f41a9f] release: Update package.xml version to 4.0.10
 1 file changed, 1 insertion(+), 1 deletion(-)
Updated package.xml and committed
Updating pyproject.toml to 4.0.10
Traceback (most recent call last):
  File "…/cmake/pyproject.py", line 24, in <module>
    update_pyproject_version(sys.argv[1])
  File "…/cmake/pyproject.py", line 17, in update_pyproject_version
    doc["project"]["version"] = version
  File "/usr/lib/python3.10/site-packages/tomlkit/container.py", line 650, in __getitem__
    raise NonExistentKey(key)
tomlkit.exceptions.NonExistentKey: 'Key "project" does not exist.'
Please fix distcheck first.
error: étiquette 'v4.0.10' non trouvée.

This can easily happen for projects using pyproject.toml only to configure some python tooling, but not to ship project metadata or packaging info.