Skip to content

is_pure_version_bump: PEP-621 pyproject dependency arrays are not recognized #44

Description

@hailcpy

Problem

pyproject.toml is in DEP_FILES (analyze.py:47-50), but _VERSION_LINE_PATTERNS / _VERSION_KEY_PATTERNS only match name = "1.2.3"-style TOML lines (Poetry-style tables). PEP-621 projects declare deps as array elements:

dependencies = [
  "requests>=2.31",
  "pydantic>=2.6",
]

A pure version bump inside such an array (- "requests>=2.31", / + "requests>=2.32",) matches no pattern ⇒ is_pure_version_bump returns False ⇒ the bump commit is kept as a candidate. Fails in the safe direction, but it makes the version-bump exclusion a no-op for the now-dominant Python packaging style, and the noise lands on Python repos specifically.

Fix

Add patterns for quoted PEP-508 array entries:

  • line pattern: ^[+-]\s*"[A-Za-z0-9_.\[\]-]+\s*[=<>!~]+\s*[\d][^"]*"\s*,?\s*$
  • key pattern: capture the distribution name (and extras) before the comparator.

Watch the existing requirements.txt pattern for overlap — array entries are quoted, requirements lines are not, so anchoring on the leading quote keeps them disjoint.

Acceptance

  • Fixture: pyproject with PEP-621 array, bump-only diff ⇒ excluded.
  • Same array, package added/renamed ⇒ kept (key-set check still fires).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions