Skip to content

Fix Poetry lock optional dependency parsing - #5295

Open
Mars-60 wants to merge 1 commit into
aboutcode-org:developfrom
Mars-60:fix-poetry-optional-dependency
Open

Fix Poetry lock optional dependency parsing#5295
Mars-60 wants to merge 1 commit into
aboutcode-org:developfrom
Mars-60:fix-poetry-optional-dependency

Conversation

@Mars-60

@Mars-60 Mars-60 commented Aug 30, 2026

Copy link
Copy Markdown

Fixes #5294

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Description

PoetryLockHandler incorrectly reported resolved Poetry lockfile packages as optional even when the package had optional = false in poetry.lock.

The fix maps Poetry's optional field to ScanCode's is_optional field:

is_optional = package.get("optional", False)

Signed-off-by: Adnan Raza <imadnanraza4@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PoetryLockHandler incorrectly marks non-optional packages as optional

1 participant