Skip to content

Support environment markers (PEP 508) in requirements#446

Open
Krishnabhuvan wants to merge 7 commits into
PyAr:masterfrom
Krishnabhuvan:copilot/worktree-2026-05-11T13-58-30
Open

Support environment markers (PEP 508) in requirements#446
Krishnabhuvan wants to merge 7 commits into
PyAr:masterfrom
Krishnabhuvan:copilot/worktree-2026-05-11T13-58-30

Conversation

@Krishnabhuvan
Copy link
Copy Markdown

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

  • Added marker evaluation to skip non-matching packages
  • Modified _parse_requirement() and _parse_content()
  • Added 5 comprehensive tests

Testing

  • All 292 existing tests pass
  • 5 new marker tests pass
  • No breaking changes

Krishnabhuvan and others added 7 commits May 10, 2026 18:34
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>
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.

Support environment markers

1 participant