Skip to content

Parse weak dependency tags - #130

Open
Ort0x36 wants to merge 1 commit into
bkircher:mainfrom
Ort0x36:add-weak-dependency-tags
Open

Ort0x36 wants to merge 1 commit into
bkircher:mainfrom
Ort0x36:add-weak-dependency-tags

Conversation

@Ort0x36

@Ort0x36 Ort0x36 commented Sep 25, 2026

Copy link
Copy Markdown

What

Adds parsing for RPM's four weak dependency tags, which the library did not recognise before: Recommends, Suggests, Supplements and Enhances.

How

They share the same syntax as Requires (a name with an optional version constraint), so they go through the same parsing path and are exposed as list[Requirement] on both Spec and its subpackages, mirroring requires / build_requires.

Tests and checks

New tests cover:

  • parsing with and without a version constraint,
  • per-subpackage scope,
  • end-of-line comments (added to the existing parametrised comment test).

Ran everything listed in AGENTS.md:

  • pytest: 51 passed
  • mypy . (strict): clean
  • pylint --rcfile=.pylintrc pyrpm: 10.00/10
  • black --line-length 130: clean

Note

I typed the new attributes as list["Requirement"], since that is what the shared code path stores. The existing conflicts / obsoletes / provides are annotated list[str] but store Requirement objects too; I left that pre-existing inconsistency alone to keep this PR focused.

RPM has four weak dependency tags that this library did not recognise:
Recommends, Suggests, Supplements and Enhances. They share the same
syntax as Requires (a name with an optional version constraint), so they
are parsed the same way and exposed as lists of Requirement on both the
Spec and its subpackages.

Tests cover parsing with and without a version, per-subpackage scope, and
end-of-line comments (added to the existing parametrised comment test).

This branch has not been deployed

No deployments
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.

1 participant