Fix conda-build compatibility error in meta.yaml test commands #378
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.
Problem
The
build_conda
pipeline was failing with aTypeError: write() argument must be str, not dict
error during the conda build process. This error occurred in conda-build'screate_shell_files
function when processing the test commands inmeta.yaml
.Root Cause
The issue was caused by complex shell command chains in the test section that newer versions of conda-build cannot parse correctly:
- autoreconf -i && cd build/ && ../configure --prefix=$PREFIX && make check RUN_EXPENSIVE_TESTS=no || echo "fail guard"
Conda-build was interpreting these compound commands as dictionaries instead of strings, leading to the TypeError when attempting to write test files.
Solution
Split the complex shell command chains into individual YAML list items, making them explicit and properly parseable by conda-build:
Before:
After:
Impact
The fix is minimal and surgical, addressing only the specific parsing issue while preserving the complete test suite behavior.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.