Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,332
    • Merge requests 1,332
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #32774
Closed
Open
Issue created Sep 25, 2019 by Nicole Schwartz@NicoleSchwartzContributor0 of 3 checklist items completed0/3 checklist items

Poetry's pyproject.toml support for Dependency scanning

Problem to solve

Add Python Poetry support to Dependency Scanning, handle Poetry projects having a pyproject.toml but no poetry.lock lock file.

See #7006 (closed) for supporting poetry.lock.

Further details

Some Poetry Python don't have a lock file and thus can't be scanned by Dependency Scanning.

Proposal

Update analyzers/gemnasium-python so that it detects pyproject.toml, generates a poetry.lock using Poetry, and parses it using the dedicated dependency file parser. See #7006 (closed)

Warning! pyproject.toml must be ignored when poetry.lock is parsed! The lock file dynamically generated from pyproject.toml may differ from the poetry.lock checked in the repo, but the latter is more accurate for it reflects what the application will ultimately install and execute. Also, parsing both pyproject.toml and poetry.lock (respectively in gemnasium-python and gemnasium) would result in redundant, conflicting information.

It would be easier to coordinate pyproject.toml support with poetry.lock support if both were implemented in analyzers/gemnasium, but the gemnasium image may not be suited for Python projects. To be investigated. See also #13477 (closed)

Implementation Plan

Please note that this assumes the following tasks were accomplished in the poetry.lock support issue:

  • add poetry.lock parser in gemnasium
  • add test project

Backend

  • add poetry to gemnasium-python docker image
  • add new package manager type to gemnasium-python so that it can issue install command correctly
  • output list of dependencies via poetry show command

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

Dependency Scanning CI jobs successfully scans Poetry projects having no lock file instead of failing with "unsupported language or manager" error.

Links / references

  • Poetry
  • pyproject.toml specification
Edited May 10, 2022 by Oscar Tovar
Assignee
Assign to
Time tracking