Skip to content

Conversation

@jensens
Copy link
Member

@jensens jensens commented Oct 23, 2025

Summary

Fixes process_line() to correctly handle override_keys and ignore_keys for both requirements and constraints files.

Problem

Previously, override_keys and ignore_keys only worked for constraints files (variety="c"). When processing requirements files (variety="r"), these settings were ignored.

This broke the expected behavior where packages in override_keys and ignore_keys should be commented out regardless of file type.

Solution

  • Remove the variety == "c" condition from override_keys and ignore_keys checks
  • Apply these settings to both requirements and constraints
  • Use different messages for requirements vs constraints:
    • Requirements with override_keys: "-> mxdev disabled (version override)"
    • Constraints with override_keys: "-> mxdev disabled (override)"
    • Both with ignore_keys: "-> mxdev disabled (ignore)"

Changes

  • Modified src/mxdev/processing.py: process_line() function
  • Added 2 new tests:
    • test_process_line_package_in_override_keys - tests requirements with override_keys
    • test_process_line_package_in_ignore_keys - tests requirements with ignore_keys
  • Updated CHANGES.md

Testing

✅ All 176 tests pass (174 previously + 2 new)

Related

This fix is needed to unblock PR #66 which was failing these tests.

process_line() now correctly comments out packages in override_keys
and ignore_keys for both requirements and constraints files.

Previously, these settings only applied to constraints files
(variety="c"). Now they work for requirements files (variety="r")
as well.

Changes:
- Remove variety=="c" condition from override_keys and ignore_keys checks
- Add different message for override_keys in requirements:
  "-> mxdev disabled (version override)" vs "-> mxdev disabled (override)"
- Add tests for requirements with override_keys and ignore_keys

Tests:
- Added test_process_line_package_in_override_keys
- Added test_process_line_package_in_ignore_keys
- All 176 tests pass
@jensens jensens merged commit 6653ec8 into main Oct 23, 2025
34 checks passed
@jensens jensens deleted the fix/process-line-override-ignore-requirements branch October 23, 2025 15:02
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.

2 participants