Support environment markers (PEP 508) in requirements#446
Open
Krishnabhuvan wants to merge 7 commits into
Open
Support environment markers (PEP 508) in requirements#446Krishnabhuvan wants to merge 7 commits into
Krishnabhuvan wants to merge 7 commits into
Conversation
Implement evaluation of environment markers in requirement specifications, allowing fades to correctly filter dependencies based on the current environment. This resolves issue PyAr#259 where requirements with environment markers like 'pysha3==1.0b1; python_version < "3.6"' would fail to parse. Changes: - Updated _parse_requirement() to evaluate markers and exclude non-matching deps - Updated _parse_content() with same marker evaluation logic - Added 5 comprehensive tests for marker support: - test_marker_true: Requirements with matching markers are included - test_marker_false: Requirements with non-matching markers are excluded - test_marker_with_other_requirements: Markers don't affect other packages - test_marker_complex: Complex marker expressions work correctly - test_marker_no_marker: Packages without markers are always included All 292 existing tests pass plus 5 new marker tests (297 total). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Fixes #259
Description
Implements support for environment markers (PEP 508) in requirement specifications.
Problem
Fades was failing with requirements like:
pysha3==1.0b1; python_version < '3.6'
Solution
Testing