1515RELEASE_MPI_VERSIONS = ["nompi" , "mpich" , "openmpi" , "hpc" ]
1616
1717
18- def generate_matrix_files (dev ):
18+ def generate_matrix_files (dev , python_versions , mpi_versions ):
1919 with open ("configs/template.yaml" ) as f :
2020 template_text = f .read ()
2121 template = Template (template_text )
22- if dev :
23- python_versions = DEV_PYTHON_VERSIONS
24- mpi_versions = DEV_MPI_VERSIONS
25- else :
26- python_versions = RELEASE_PYTHON_VERSIONS
27- mpi_versions = RELEASE_MPI_VERSIONS
22+ if python_versions is None :
23+ if dev :
24+ python_versions = DEV_PYTHON_VERSIONS
25+ else :
26+ python_versions = RELEASE_PYTHON_VERSIONS
27+ if mpi_versions is None :
28+ if dev :
29+ mpi_versions = DEV_MPI_VERSIONS
30+ else :
31+ mpi_versions = RELEASE_MPI_VERSIONS
2832 matrix_files = []
2933 for python in python_versions :
3034 for mpi in mpi_versions :
@@ -46,6 +50,16 @@ def main():
4650 default = os .path .expanduser ("~/miniforge3" ),
4751 help = "Path to the conda base directory (default: ~/miniforge3)."
4852 )
53+ parser .add_argument (
54+ "--python" ,
55+ nargs = "+" ,
56+ help = "Python version(s) to build for (overrides default matrix)."
57+ )
58+ parser .add_argument (
59+ "--mpi" ,
60+ nargs = "+" ,
61+ help = "MPI variant(s) to build for (overrides default matrix)."
62+ )
4963 args = parser .parse_args ()
5064
5165 conda_dir = os .path .expanduser (args .conda )
@@ -59,7 +73,11 @@ def main():
5973 shutil .rmtree (bld_dir )
6074
6175 # Generate matrix files on the fly
62- matrix_files = generate_matrix_files (dev )
76+ matrix_files = generate_matrix_files (
77+ dev ,
78+ python_versions = args .python ,
79+ mpi_versions = args .mpi ,
80+ )
6381
6482 dev_labels = []
6583 if dev :
0 commit comments