rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

proposal: use matrix style variants config to avoid using `zip_keys`?

Open trim21 opened this issue 8 months ago • 2 comments

like github actions, would is better to use variants config like this to replace zip_keys?

pairs:
  - { python: '3.8', numpy: '1.12' }
  - { python: '3.9', numpy: '1.14' }
zip_keys: ["python", "numpy"]
python: ["3.8", "3.9"]
numpy: ["1.12", "1.14"]

trim21 avatar May 01 '25 19:05 trim21

Yes, I definitely think zip keys are not the greatest invention and I would like a better alternative for sure.

We need to come up with a great name. pairs is not going to work since it can be more than 2 ...

wolfv avatar May 02 '25 16:05 wolfv

Yes, I definitely think zip keys are not the greatest invention and I would like a better alternative for sure.

We need to come up with a great name. pairs is not going to work since it can be more than 2 ...

I didn't suggest to add a special key paris, but to allow using list of dict (Vec<HashMap<String, String>> in rust) as value, currently it only support Vec<scale value>

If we do not want to extend any keys, I may prefer matrix but also not paris.

for a more detail example, in varants.yaml we have this:


some_other_config:
  - a
  - b
  - c

matrix:
  - { python: '3.8', numpy: '1.12' }
  - { python: '3.9', numpy: '1.14' }

then we got $2 \times 3 = 6$ builds.

and in recipe.yaml, we can do this:


requirements:
  host: 
    - some_other_lib ${{ some_other_config }}
    - python ${{ matrix.python }}.* 
    - numpy ${{ matrix.numpy }}.* 

trim21 avatar May 02 '25 16:05 trim21