Skip to content

merge project and poetry tables - #1149

Draft
kmlyz wants to merge 2 commits into
CycloneDX:mainfrom
kmlyz:feat/pyproject-poetry-v2
Draft

kmlyz wants to merge 2 commits into
CycloneDX:mainfrom
kmlyz:feat/pyproject-poetry-v2

Conversation

@kmlyz

@kmlyz kmlyz commented Nov 22, 2026

Copy link
Copy Markdown

Description

Part of #839 (Poetry CLI builder support will follow in a separate PR).

Read [project] (PEP 621/639) and [tool.poetry] simultaneously in pyproject2component and pyproject2dependencies instead of returning early when [tool.poetry] is present:

  • Build metadata from [project] when present and fall back to [tool.poetry] for omitted or dynamic fields (version, description, license, classifiers) while deduplicating external references and keeping PEP 639 license precedence.
  • Yield dependencies from both [project] and [tool.poetry] in pyproject2dependencies and handle list-valued multi-constraint extras in poetry2dependencies.
  • Fixes the KeyError('name') failure when passing a hybrid Poetry v2 pyproject.toml to --pyproject (for example in requirements, pipenv, and environment).

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: Google Antigravity
    • LLMs and versions: Gemini
    • Prompts: Merge [project] (PEP 621/639) and [tool.poetry] simultaneously in pyproject2component and pyproject2dependencies with unit and CLI integration tests.

Affirmation

Disclosure: Assisted by AI tooling (Google Antigravity / Gemini). Code and tests verified by contributor.

Read PEP 621/639 [project] and [tool.poetry] simultaneously in
pyproject2component and pyproject2dependencies so hybrid Poetry v2
manifests work with --pyproject without KeyError on name.

Part of CycloneDX#839

Signed-off-by: Kemal Yilmaz <kemalylmz@gmail.com>
@kmlyz
kmlyz requested a review from a team as a code owner November 22, 2026 17:45
@codacy-production

codacy-production Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 13 complexity · 0 duplication

Metric Results
Complexity ✅ 13 (≤ 20 complexity)
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Reduce branching in pyproject2component and poetry2dependencies to
keep cyclomatic complexity delta well within repository thresholds.

Signed-off-by: Kemal Yilmaz <kemalylmz@gmail.com>
@jkowalleck

Copy link
Copy Markdown
Member

does this implement a new feature, or is it pure refactoring?

@jkowalleck jkowalleck changed the title feat(pyproject): merge project and poetry tables merge project and poetry tables Nov 23, 2026
from packaging.requirements import Requirement


def _merge_poetry_into_component(component: 'Component',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong scope.
tis is poetry-specific, so it belongs into the poetry implementation.

@jkowalleck

Copy link
Copy Markdown
Member

thanks for working on this topic.

This looks a bit like AI snap/slop - it changes things without proper understanding of design and architecture. Changes should be kept to a scoped minim and follow a understandable and maintainable path.

To save me some time, I did not review it entirely, and I will not, unless a human clarifies what is the intent here is, and what the scope might be.
WE then can discuss non-scope and goals.

Putting this in DRAFT mode for now.
Lets discuss :-)

@jkowalleck
jkowalleck marked this pull request as draft November 23, 2026 11:09
@kmlyz

kmlyz commented Nov 23, 2026

Copy link
Copy Markdown
Author

Thanks for keeping this open, @jkowalleck. Honestly, I let AI tooling get ahead of the architecture and mixed in a refactor commit, so I see why it looked that way.

The intent is a feature step for #839, not refactoring: reading Poetry v2 [project] (PEP 621/639) and [tool.poetry] together. Since PoetryBB calls utils/poetry.py directly, this belongs in utils/poetry.py, not utils/pyproject.py.

Should this PR cover only the shared utils/poetry.py reader (fixing --pyproject KeyError('name'), dropping the refactor) with PoetryBB dependencies and lock21 fixtures next, or both together?

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.

2 participants