poetry-core 2.5.0 generates invalid metadata for Poetry OR constraints
Description
poetry-core 2.5.0 generates invalid PEP 508 metadata for this valid Poetry dependency declaration:
lxml = "^4.5.0 || ^5.0.0"The affected source is inkex at the EXTENSIONS_AT_INKSCAPE_1.4.1 tag.
The generated metadata is:
Requires-Dist: lxml (>=4.5.0,<5.0.0 || >=5.0.0,<6.0.0)Both pip 26.2.1 and uv reject it with:
Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS,
after version specifierThe same source builds successfully with poetry-core 1.9.1 and generates valid metadata:
Requires-Dist: lxml (>=4.5.0,<6.0.0)It appears that poetry-core 2.5.0 should either convert the Poetry constraint into valid PEP 508 metadata or reject it during the build instead of generating an invalid wheel.
The issue is reproducible with both pip and uv.
Workarounds
There is currently no workaround in Poetry itself. The generated wheel metadata
is invalid and should be rejected or corrected by poetry-core during the build.
The dependency declaration should not need to be manually changed by downstream projects.
Poetry Installation Method
other
Operating System
Ubuntu 26.04 (amd64), running in the registry.gitlab.com/inkscape/inkscape-ci-docker/extensions:latest Docker image.
Poetry Version
poetry-core 2.5.0
Poetry Configuration
N/A — Poetry CLI was not used. The issue was reproduced through pip/uv
PEP 517 build isolation, which automatically installed poetry-core 2.5.0.Python Sysconfig
sysconfig.logThe issue was reproduced with Python 3.12.13 in a Linux x86_64
virtual environment. `python -m sysconfig` was not collected in the
original CI run.
Example pyproject.toml
[tool.poetry.dependencies]
lxml = "^4.5.0 || ^5.0.0"
[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"Poetry Runtime Logs
poetry-runtime.logN/A — Poetry CLI was not used.
Source: python-poetry/poetry