Skip to content

Fix optional dependency marker parsing#109

Open
EmilStenstrom wants to merge 1 commit into
psf:mainfrom
EmilStenstrom:codex/fix-optional-dependency-markers
Open

Fix optional dependency marker parsing#109
EmilStenstrom wants to merge 1 commit into
psf:mainfrom
EmilStenstrom:codex/fix-optional-dependency-markers

Conversation

@EmilStenstrom

@EmilStenstrom EmilStenstrom commented Jun 13, 2026

Copy link
Copy Markdown

Summary

Fix dependency classification on package pages by parsing each Requires-Dist entry with packaging.requirements.Requirement instead of looking for the literal substring ; extra ==.

The old check missed valid markers such as:

mypy>=1.0; platform_python_implementation != "PyPy" and extra == "dev"

That caused optional dependencies to appear under Required dependencies, as seen on the justhtml package page and in the same class of issue as #79.

Validation

  • PYENV_VERSION=3.13.13 python -m py_compile pypistats/*.py pypistats/**/*.py
  • /tmp/pypistats-venv/bin/black --check .
  • /tmp/pypistats-venv/bin/isort --check-only .
  • Manual split check confirming mypy is optional for the justhtml-style marker while non-extra requirements remain required

@EmilStenstrom EmilStenstrom changed the title [codex] Fix optional dependency marker parsing Fix optional dependency marker parsing Jun 13, 2026
@EmilStenstrom EmilStenstrom marked this pull request as ready for review June 13, 2026 07:33
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