Skip to content

Strip extras marker from 'No matching distribution found' error#13810

Closed
gcomneno wants to merge 1 commit intopypa:mainfrom
gcomneno:bugfix/strip-extra-from-error
Closed

Strip extras marker from 'No matching distribution found' error#13810
gcomneno wants to merge 1 commit intopypa:mainfrom
gcomneno:bugfix/strip-extra-from-error

Conversation

@gcomneno
Copy link
Contributor

Fixes #13618.

When a requirement includes an environment marker like ; extra == "...", the final DistributionNotFound message currently shows the marker (e.g. torch; extra == "optimizer"). This change keeps the error focused on the project name only.

Changes (minimal):

  • package_finder: use name instead of req in DistributionNotFound
  • resolvelib factory: use req.project_name instead of req in DistributionNotFound

Tests:

  • python -m pytest -q tests/unit/test_finder.py tests/unit/resolution_resolvelib/

@gcomneno
Copy link
Contributor Author

Note: running the full test suite locally stops at collection due to missing optional test dependencies (tomli_w/proxy/freezegun). The targeted unit tests covering the touched paths pass: �[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m.�[0m�[32m [ 98%]
�[0m�[32m.�[0m�[32m [100%]�[0m
�[32m�[32m�[1m73 passed�[0m�[32m in 4.79s�[0m�[0m.

@sepehr-rs
Copy link
Member

Hi, this is already covered by an existing PR: #13659

@sepehr-rs sepehr-rs closed this Feb 18, 2026
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.

extra incorrectly shown on installation error

2 participants

Comments