Repository navigation
RTECO-2728 - Audit Poetry projects that declare dependencies in PEP 621 [project] - #938
reshmifrog wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
…21 [project] Since Poetry 2.0, dependencies are declared by default in the PEP 621 [project] table. 'jf audit --poetry' found no dependencies for such projects and failed with 'no dependencies were found'. Bumps build-info-go to the fix (jfrog/build-info-go#438) and adds a 'poetry-pep621-project' fixture, with the same dependencies as 'poetry-project', covered by a unit test and by TestXrayAuditPoetry. Fixes jfrog#560
5768b51 to
b6fb318
Compare
devbranch.Problem
Since Poetry 2.0 the default layout declares dependencies in
[project].dependenciesinstead of[tool.poetry.dependencies]. For such projectsjf audit --poetryfails with:Nothing gets scanned. Reproduced on the latest release, JFrog CLI 2.131.0, with Poetry 2.5.1:
poetry new mre && poetry add aiostream && poetry lock && jf audit --poetry.Tests
tests/testdata/projects/package-managers/python/poetry/poetry-pep621-project: the same dependencies aspoetry-project(urllib3 <1.24,django <1.11.16,Werkzeug <0.10), declared in[project].poetry.lockwas generated with Poetry 2.5.1 and passespoetry check --lock.TestBuildPoetryDependencyListPep621(nopoetry install, no Xray). Fails without the fix ([]) and passes with it.TestXrayAuditPoetrynow also runsPEP 621variants of the JSON and Simple JSON cases, with the same expectations aspoetry-project(≥3 vulnerabilities, ≥1 license).jf audit --poetry --licensesagainst a SaaS instance, withjfbuilt from jfrog-climaster+ this fix. The fixtures were installed through an Artifactory PyPI remote, because direct pypi.org access isn't available in my environment, so I couldn't run theTestXrayAuditPoetryharness itself as-is.