Fix: Handle override_keys and ignore_keys in requirements#67
Merged
Conversation
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
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.
Summary
Fixes
process_line()to correctly handleoverride_keysandignore_keysfor both requirements and constraints files.Problem
Previously,
override_keysandignore_keysonly 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_keysandignore_keysshould be commented out regardless of file type.Solution
variety == "c"condition from override_keys and ignore_keys checks"-> mxdev disabled (version override)""-> mxdev disabled (override)""-> mxdev disabled (ignore)"Changes
src/mxdev/processing.py:process_line()functiontest_process_line_package_in_override_keys- tests requirements with override_keystest_process_line_package_in_ignore_keys- tests requirements with ignore_keysCHANGES.mdTesting
✅ All 176 tests pass (174 previously + 2 new)
Related
This fix is needed to unblock PR #66 which was failing these tests.