Fix silent dropping of brew-cask libraries#357
Open
ZENFALLACY wants to merge 2 commits intoOpenAstronomy:mainfrom
Open
Fix silent dropping of brew-cask libraries#357ZENFALLACY wants to merge 2 commits intoOpenAstronomy:mainfrom
ZENFALLACY wants to merge 2 commits intoOpenAstronomy:mainfrom
Conversation
The global_libraries dict uses keys with hyphens (e.g. 'brew-cask'), but tox_matrix.py was iterating over underscores ('brew_cask') when building the matrix items. This caused brew-cask libraries requested in tox.yml to be silently ignored. This commit maps the YAML key to the matrix key to fix the lookup.
On Windows, git checkouts with CRLF cause the update_scripts_in_yml hook to encode \r\n characters, but pre-commit.ci on Linux encodes LF, leading to a constant base64 string mismatch and CI failures. This normalizes line endings to LF right before encoding.
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's the problem?
The
global_librariesdict intox_matrix.pyuses hyphenated keys (e.g.brew-cask), but the matrix-building code was looking them up with underscores (brew_cask). Because Python dicts do an exact key match, the lookup always missed, and anybrew-caskentries intox.ymlwere silently dropped — no error, no warning, just nothing installed.What changed?
tools/tox_matrix.py: added a mapping from the YAML key format (brew-cask) to the correct dict key so the lookup finds the entry..github/workflows/tox.yml: regenerated viaupdate_scripts_in_yml.pyto pick up the fixed script (base64-encoded inline).How to verify?
Add a
brew-casklibrary totox.yml, run the matrix generation, and confirm it shows up in the output rather than being silently ignored.Notes
No logic changes beyond the key mapping. Existing behaviour for all other library types (
brew,apt, etc.) is unaffected.