Skip to content

Fix python_version operators in PyPI dependency marker parsing - #5318

Open
Pradeepbeleri wants to merge 1 commit into
aboutcode-org:developfrom
Pradeepbeleri:fix/pypi-python-version-operators
Open

Pradeepbeleri wants to merge 1 commit into
aboutcode-org:developfrom
Pradeepbeleri:fix/pypi-python-version-operators

Conversation

@Pradeepbeleri

@Pradeepbeleri Pradeepbeleri commented Sep 14, 2026

Copy link
Copy Markdown

Fixes #5309

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 CHANGELOG.rst (if applicable)

Description

Fixes issue #5309 in get_python_version_os() inside src/packagedcode/pypi.py where python_version_operators contained a duplicate '<' entry and was missing comparison operators '>', '!=', and '~='.

Because those operators were missing, dependency markers like python_version > "3.8" or python_version != "3.6" were silently dropping their python_version extra data during PyPI package scanning.

Changes Made

  • Updated python_version_operators in src/packagedcode/pypi.py to ['<', '>', '>=', '==', '<=', '!=', '~='].
  • Added author entry in AUTHORS.rst.
  • Added entry in CHANGELOG.rst.

Verification

  • Executed full PyPI test suite (python -m pytest tests/packagedcode/test_pypi.py): 184 passed.

@Pradeepbeleri
Pradeepbeleri force-pushed the fix/pypi-python-version-operators branch from 782faa4 to 3de1348 Compare September 14, 2026 05:48
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.

python_version markers using >, != or ~= are silently dropped from dependency extra_data

1 participant