Skip to content

poetry.lock support for Dependency Scanning

Problem to solve

Add Python Poetry support to Dependency Scanning, parse and process Poetry lock files.

See #32774 for supporting Poetry projects having no lock file.

Right now gemnasium-python fails because it detects the Poetry project, but then tries to install its dependencies instead of parsing poetry.lock, and it can't find a compatible builder.

[INFO] [gemnasium-python] [2022-04-14T13:19:01Z] ▶ GitLab gemnasium-python analyzer v2.23.0
[INFO] [gemnasium-python] [2022-04-14T13:19:01Z] ▶ Detected supported dependency files in '.'. Dependency files detected in this directory will be processed. Dependency files in other directories will be skipped.
[ERRO] [gemnasium-python] [2022-04-14T13:19:01Z] ▶ No builder for package manager poetry
[FATA] [gemnasium-python] [2022-04-14T13:19:01Z] ▶ no builder for requirements file

Further details

Poetry is a package manager and builder for Python, which is arguably better than pure pip. It generates poetry.lock, a lock file that gives the full, accurate list of the package versions a Python project depends on. Dependency Scanning should leverage this lock file to detect and report vulnerable dependencies.

Proposal

Implementation plan

Availability & testing

python-poetry test project should be updated to test poetry.lock, test should pass.

What does success look like, and how can we measure that?

Dependency Scanning CI job successfully process Poetry projects having a lock file instead of failing with "unsupported language or manager" error.

Links / references

Edited by Oscar Tovar