Poetry metadata version handling errors and pkginfo constraints
22-02-2025
Error:
poetry lock --no-update
Resolving dependencies...
/opt/poetry/lib/python3.11/site-packages/pkginfo/distribution.py:175: NewMetadataVersion: New metadata version (2.4) higher than latest supported version: parsing as 2.3
warnings.warn(NewMetadataVersion(self.metadata_version))
Unable to determine package info for path: /tmp/tmpb6fi65ak/virtualenv-20.28.1-py3-none-any.whl
Dependencies affected:
virtualenv
,urllib3
,wrapt
,attrs
Solution:
- upgrade poetry to version
1.8.5
or; - upgrade poetry installation to include latest version of
pkginfo
(>1.12) - also, the ci/cd runners maintained by research team have the required version of poetry in their latest run-python version 3.0.1 (ie python 3.12.8 and poetry 1.8.5)
- finally,
deptry
can check which deps are affected:
[tool.deptry.per_rule_ignores]
DEP002 = ["virtualenv", "urllib3"]
References:
- https://github.com/pypa/setuptools-scm/ - this generates metadata dynamically
- https://github.com/astral-sh/ruff/issues/14681
- https://github.com/python-poetry/poetry/issues/9670
- https://peps.python.org/pep-0639/
- https://smhk.net/note/2024/04/upgrade-version-of-pkginfo-used-by-poetry/
- https://python-poetry.org/docs/cli/#self