Running git-pkgs list --format json on python-poetry/poetry parses parenthesized PEP 508 requirements with ( included in the package name and ) included in the requirement.
Poetry's pyproject.toml at commit 92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54 includes entries such as:
With git-pkgs 0.18.2, this can be reproduced with:
git clone https://github.com/python-poetry/poetry.git
cd poetry
GIT_PKGS_DB=/tmp/git-pkgs-pep508.sqlite git-pkgs list --format json \
| jq -c '.[] | select(.manifest_path == "pyproject.toml") | select(.name == "requests (")'
The result contains:
{"name":"requests (","requirement":">=2.26,<3.0)","purl":"pkg:pypi/requests%20(","dependency_type":"runtime","manifest_path":"pyproject.toml"}
I expected the name to be requests, the requirement to be >=2.26,<3.0, and the purl to be pkg:pypi/requests.
The same problem affects the other parenthesized entries in that file, including packaging (>=24.2) and platformdirs (>=3.0.0,<5). It appears to come from parsePEP508, which starts the version at an operator but does not account for optional parentheses around the version specifier.
Running
git-pkgs list --format jsononpython-poetry/poetryparses parenthesized PEP 508 requirements with(included in the package name and)included in the requirement.Poetry's
pyproject.tomlat commit92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54includes entries such as:"requests (>=2.26,<3.0)"With
git-pkgs0.18.2, this can be reproduced with:The result contains:
{"name":"requests (","requirement":">=2.26,<3.0)","purl":"pkg:pypi/requests%20(","dependency_type":"runtime","manifest_path":"pyproject.toml"}I expected the name to be
requests, the requirement to be>=2.26,<3.0, and the purl to bepkg:pypi/requests.The same problem affects the other parenthesized entries in that file, including
packaging (>=24.2)andplatformdirs (>=3.0.0,<5). It appears to come fromparsePEP508, which starts the version at an operator but does not account for optional parentheses around the version specifier.