fix python fetching when environment markers present#14559
Merged
jakecoffman merged 3 commits intomainfrom Mar 27, 2026
Merged
Conversation
5 tasks
Member
Author
|
The failing test is unrelated and fixed by #14562 |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Python requirements file fetching when path-based dependencies include PEP-508 environment markers (semicolon syntax), preventing Dependabot from mis-parsing the path and incorrectly erroring on missing local wheel/sdist artifacts.
Changes:
- Update requirements path-dependency regexes to stop path capture at
;(environment marker delimiter). - Add a GitHub API fixture for a
requirements.txtcontaining a local.whldependency with an environment marker. - Add an RSpec case ensuring environment markers don’t cause path-dependency fetch failures.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/lib/dependabot/python/shared_file_fetcher.rb | Adjusts path-dependency scanning regexes to exclude ; so env markers aren’t treated as part of the path. |
| python/spec/dependabot/python/file_fetcher_spec.rb | Adds coverage for a local wheel path with env markers to ensure fetching doesn’t raise. |
| python/spec/fixtures/github/requirements_with_whl_env_marker.json | Adds a fixture requirements content including a wheel path plus a PEP-508 marker. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
Fixes an error in Python projects when there is a semicolon present near a path-based dependency.
Semicolons unsed in this way are environment markers defined in PEP-508 so we just needed to add them to the regex to strip them out.
Anything you want to highlight for special attention from reviewers?
How will you know you've accomplished your goal?
I tested this against a repo that was failing and it's working now. Unit test also passes.
Checklist