Repository: conda-forge/conda-smithy

Issue:
WIP: Select 1 `cdt_name` as is done with `docker_image`
Make sure we include one `cdt_name` just as we have done with `docker_image`. This way if there are several options zipped together, we can select the corresponding one. Builds off the work in PR ( https://github.com/conda-forge/conda-smithy/pull/1176 ).

cc @beckermr @isuruf

<!--
Thank you for pull request.
Below are a few things we ask you kindly to self-check before getting a review. Remove checks that are not relevant.
-->
Checklist
* [ ] Added a ``news`` entry

<!--
Please note any issues this fixes using [closing keywords]( https://help.github.com/articles/closing-issues-using-keywords/ ):
-->

<!--
Please add any other relevant info below:
-->



Discussion:

Resolving patch:
diff --git a/conda_smithy/configure_feedstock.py b/conda_smithy/configure_feedstock.py
--- a/conda_smithy/configure_feedstock.py
+++ b/conda_smithy/configure_feedstock.py
@@ -398,6 +398,14 @@ def finalize_config(config, platform, arch, forge_config):
             config["docker_image"] = [config["docker_image"][0]]
         else:
             config["docker_image"] = [forge_config["docker"]["fallback_image"]]
+
+        if "zip_keys" in config:
+            for ziplist in config["zip_keys"]:
+                if "docker_image" in ziplist:
+                    for key in ziplist:
+                        if key != "docker_image":
+                            config[key] = [config[key][0]]
+
     return config
 
 


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -1,7 +1,9 @@
 name: tests
 
 on:
-  push: null
+  push:
+    branches:
+      - master
   pull_request: null
 
 jobs:
@@ -37,5 +39,5 @@ jobs:
         run: |
           coverage combine || echo "no coverage data to combine maybe"
           coveralls
-        env: 
+        env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/tests/recipes/cuda_docker_images/conda_build_config.yaml b/tests/recipes/cuda_docker_images/conda_build_config.yaml
--- a/tests/recipes/cuda_docker_images/conda_build_config.yaml
+++ b/tests/recipes/cuda_docker_images/conda_build_config.yaml
@@ -1,3 +1,11 @@
+cdt_name:                               # [linux64]
+  - cos6                                # [linux64]
+  - cos6                                # [linux64]
+  - cos6                                # [linux64]
+  - cos6                                # [linux64]
+  - cos6                                # [linux64]
+  - cos7                                # [linux64]
+
 cuda_compiler:                          # [linux64]
   - nvcc                                # [linux64]
 cuda_compiler_version:                  # [linux64]
@@ -5,14 +13,19 @@ cuda_compiler_version:                  # [linux64]
   - 9.2                                 # [linux64]
   - 10.0                                # [linux64]
   - 10.1                                # [linux64]
+  - 10.2                                # [linux64]
+  - 11.0                                # [linux64]
 
 docker_image:                           # [linux64]
   - condaforge/linux-anvil-comp7        # [linux64]
   - condaforge/linux-anvil-cuda:9.2     # [linux64]
   - condaforge/linux-anvil-cuda:10.0    # [linux64]
   - condaforge/linux-anvil-cuda:10.1    # [linux64]
+  - condaforge/linux-anvil-cuda:10.2    # [linux64]
+  - condaforge/linux-anvil-cuda:11.0    # [linux64]
 
 zip_keys:                               # [linux64]
   -                                     # [linux64]
+    - cdt_name                          # [linux64]
     - cuda_compiler_version             # [linux64]
     - docker_image                      # [linux64]
diff --git a/tests/recipes/multiple_docker_images/conda_build_config.yaml b/tests/recipes/multiple_docker_images/conda_build_config.yaml
--- a/tests/recipes/multiple_docker_images/conda_build_config.yaml
+++ b/tests/recipes/multiple_docker_images/conda_build_config.yaml
@@ -2,3 +2,11 @@ docker_image:                           # [linux64]
   - pickme_a                            # [linux64]
   - pickme_b                            # [linux64]
   - pickme_c                            # [linux64]
+cdt_name:                               # [linux64]
+  - pickme_1                            # [linux64]
+  - pickme_2                            # [linux64]
+  - pickme_3                            # [linux64]
+zip_keys:                               # [linux64]
+  -                                     # [linux64]
+    - docker_image                      # [linux64]
+    - cdt_name                          # [linux64]
diff --git a/tests/test_cli.py b/tests/test_cli.py
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -1,7 +1,6 @@
 import argparse
 import collections
 import os
-import pytest
 import subprocess
 import yaml
 import shutil
@@ -131,8 +130,8 @@ def test_init_cuda_docker_images(testing_workdir):
     # files, though - loops within outputs are contained in those top-level
     # configs.
     matrix_dir_len = len(os.listdir(matrix_dir))
-    assert matrix_dir_len == 5
-    for v in [None, "9.2", "10.0", "10.1"]:
+    assert matrix_dir_len == 7  # 6 docker images plus the README
+    for v in [None, "9.2", "10.0", "10.1", "10.2", "11.0"]:
         fn = os.path.join(
             matrix_dir, f"linux_64_cuda_compiler_version{v}.yaml"
         )
@@ -146,6 +145,10 @@ def test_init_cuda_docker_images(testing_workdir):
         else:
             docker_image = f"condaforge/linux-anvil-cuda:{v}"
         assert config["docker_image"] == [docker_image]
+        if v == "11.0":
+            assert config["cdt_name"] == ["cos7"]
+        else:
+            assert config["cdt_name"] == ["cos6"]
 
 
 def test_init_multiple_docker_images(testing_workdir):
@@ -186,6 +189,7 @@ def test_init_multiple_docker_images(testing_workdir):
     with open(fn) as fh:
         config = yaml.load(fh)
     assert config["docker_image"] == ["pickme_a"]
+    assert config["cdt_name"] == ["pickme_1"]
 
 
 def test_regenerate(py_recipe, testing_workdir):