From af5ce99a850c535ab0328cb8e72cd03bacb1e5e8 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 1 Mar 2026 20:50:09 +0100 Subject: [PATCH 1/8] Switch to v1 recipe form --- .../ci/linux_64_python3.10.____cpython.yaml | 2 +- .../ci/linux_64_python3.11.____cpython.yaml | 2 +- .../ci/linux_64_python3.12.____cpython.yaml | 2 +- .../ci/linux_64_python3.13.____cpython.yaml | 2 +- .../ci/linux_64_python3.14.____cpython.yaml | 2 +- .../ci/osx_64_python3.10.____cpython.yaml | 2 +- .../ci/osx_64_python3.11.____cpython.yaml | 2 +- .../ci/osx_64_python3.12.____cpython.yaml | 2 +- .../ci/osx_64_python3.13.____cpython.yaml | 2 +- .../ci/osx_64_python3.14.____cpython.yaml | 2 +- conda_package/recipe/meta.yaml | 143 ---------------- conda_package/recipe/recipe.yaml | 162 ++++++++++++++++++ 12 files changed, 172 insertions(+), 153 deletions(-) delete mode 100644 conda_package/recipe/meta.yaml create mode 100644 conda_package/recipe/recipe.yaml diff --git a/conda_package/ci/linux_64_python3.10.____cpython.yaml b/conda_package/ci/linux_64_python3.10.____cpython.yaml index 895781497..5db6359be 100644 --- a/conda_package/ci/linux_64_python3.10.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.10.____cpython.yaml @@ -19,7 +19,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 netcdf_fortran: - '4.6' pin_run_as_build: diff --git a/conda_package/ci/linux_64_python3.11.____cpython.yaml b/conda_package/ci/linux_64_python3.11.____cpython.yaml index 20259457b..da7935efd 100644 --- a/conda_package/ci/linux_64_python3.11.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.11.____cpython.yaml @@ -19,7 +19,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 netcdf_fortran: - '4.6' pin_run_as_build: diff --git a/conda_package/ci/linux_64_python3.12.____cpython.yaml b/conda_package/ci/linux_64_python3.12.____cpython.yaml index 59414c4e1..2318a5ff6 100644 --- a/conda_package/ci/linux_64_python3.12.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.12.____cpython.yaml @@ -19,7 +19,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 netcdf_fortran: - '4.6' pin_run_as_build: diff --git a/conda_package/ci/linux_64_python3.13.____cpython.yaml b/conda_package/ci/linux_64_python3.13.____cpython.yaml index 4489de008..7be44023f 100644 --- a/conda_package/ci/linux_64_python3.13.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.13.____cpython.yaml @@ -19,7 +19,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 netcdf_fortran: - '4.6' pin_run_as_build: diff --git a/conda_package/ci/linux_64_python3.14.____cpython.yaml b/conda_package/ci/linux_64_python3.14.____cpython.yaml index 920dadcf6..6c5195cd4 100644 --- a/conda_package/ci/linux_64_python3.14.____cpython.yaml +++ b/conda_package/ci/linux_64_python3.14.____cpython.yaml @@ -19,7 +19,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 netcdf_fortran: - '4.6' pin_run_as_build: diff --git a/conda_package/ci/osx_64_python3.10.____cpython.yaml b/conda_package/ci/osx_64_python3.10.____cpython.yaml index b2d86a3bd..b375d56f0 100644 --- a/conda_package/ci/osx_64_python3.10.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.10.____cpython.yaml @@ -21,7 +21,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 llvm_openmp: - '19' macos_machine: diff --git a/conda_package/ci/osx_64_python3.11.____cpython.yaml b/conda_package/ci/osx_64_python3.11.____cpython.yaml index b1d2e320b..cbdab1ae4 100644 --- a/conda_package/ci/osx_64_python3.11.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.11.____cpython.yaml @@ -21,7 +21,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 llvm_openmp: - '19' macos_machine: diff --git a/conda_package/ci/osx_64_python3.12.____cpython.yaml b/conda_package/ci/osx_64_python3.12.____cpython.yaml index 7f9af2205..e4772b9a2 100644 --- a/conda_package/ci/osx_64_python3.12.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.12.____cpython.yaml @@ -21,7 +21,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 llvm_openmp: - '19' macos_machine: diff --git a/conda_package/ci/osx_64_python3.13.____cpython.yaml b/conda_package/ci/osx_64_python3.13.____cpython.yaml index 6e4aa3029..4731ab423 100644 --- a/conda_package/ci/osx_64_python3.13.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.13.____cpython.yaml @@ -21,7 +21,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 llvm_openmp: - '19' macos_machine: diff --git a/conda_package/ci/osx_64_python3.14.____cpython.yaml b/conda_package/ci/osx_64_python3.14.____cpython.yaml index 5b17a6611..69d4ade74 100644 --- a/conda_package/ci/osx_64_python3.14.____cpython.yaml +++ b/conda_package/ci/osx_64_python3.14.____cpython.yaml @@ -21,7 +21,7 @@ fortran_compiler_version: hdf5: - 1.14.6 libnetcdf: -- 4.9.3 +- 4.10.0 llvm_openmp: - '19' macos_machine: diff --git a/conda_package/recipe/meta.yaml b/conda_package/recipe/meta.yaml deleted file mode 100644 index d62b863bc..000000000 --- a/conda_package/recipe/meta.yaml +++ /dev/null @@ -1,143 +0,0 @@ -{% set name = "mpas_tools" %} -{% set version = "1.4.0" %} - -package: - name: {{ name|lower }} - version: {{ version }} - -source: - path: ../.. - -build: - number: 0 - -requirements: - build: - - {{ compiler('cxx') }} - - {{ compiler('fortran') }} - - cmake - - pkgconfig - host: - - python - - hdf5 - - hdf5 * nompi_* - - libnetcdf - - libnetcdf * nompi_* - - netcdf-fortran - - netcdf-fortran * nompi_* - - setuptools - - netcdf4 - - openmp # [osx] - - run: - - python - - cartopy - - cmocean - - dask - - geometric_features >=1.0.1,<2.0.0 - - h5py - - hdf5 - - inpoly - - libnetcdf - - networkx - - netcdf-fortran - - matplotlib-base >=3.9.0 - - nco - - netcdf4 - - numpy >=2.0,<3.0 - - progressbar2 - - pyamg - - pyevtk - - pyproj - - python-igraph - - scikit-image !=0.20.0 - - scipy - - shapely >=2.0,<3.0 - - tqdm - - xarray - -test: - requires: - - git - - pytest - - requests - - pip - source_files: - - mesh_tools/mesh_conversion_tools/test/Arctic_Ocean.geojson - - mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc - - mesh_tools/mesh_conversion_tools/test/land_mask_final.nc - - conda_package/tests/* - imports: - - mpas_tools - - mpas_tools.mesh.conversion - - mpas_tools.mesh.creation - - mpas_tools.viz - - mpas_tools.conversion - commands: - - test -f "${PREFIX}/bin/ocean_smooth_topo_skip_land_ice" - - test -f "${PREFIX}/bin/ocean_smooth_topo_before_init" - - test -f "${PREFIX}/bin/ocean_smooth_topo_before_init_skip_land_ice" - - planar_hex --nx=10 --ny=20 --dc=1000. --outFileName='periodic_mesh_10x20_1km.nc' - - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -x 1000. -y 2000. - - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -c - - planar_hex --nx=20 --ny=40 --dc=1000. --outFileName='periodic_mesh_20x40_1km.nc' - - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -d 'periodic_mesh_20x40_1km.nc' - - MpasMeshConverter.x mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc mesh.nc - - sort_mesh --mesh-file mesh.nc --sort-file sorted_mesh.nc - - MpasCellCuller.x mesh.nc culled_mesh.nc -m mesh_tools/mesh_conversion_tools/test/land_mask_final.nc - - MpasMaskCreator.x mesh.nc arctic_mask.nc -f mesh_tools/mesh_conversion_tools/test/Arctic_Ocean.geojson - - planar_hex --nx=30 --ny=20 --dc=1000. --npx --npy --outFileName='nonperiodic_mesh_30x20_1km.nc' - - MpasCellCuller.x nonperiodic_mesh_30x20_1km.nc culled_nonperiodic_mesh_30x20_1km.nc - - python -m pytest conda_package/tests - - mark_horns_for_culling --help - - set_lat_lon_fields_in_planar_grid --help - - create_scrip_file_from_mpas_mesh --help - - create_scrip_file_from_planar_rectangular_grid --help - - prepare_seaice_partitions --help - - create_seaice_partitions --help - - fix_regrid_output.exe - - create_landice_grid_from_generic_mpas_grid --help - - define_landice_cull_mask --help - - interpolate_to_mpasli_grid --help - - mark_domain_boundaries_dirichlet --help - - add_critical_land_blockages_to_mask --help - - add_land_locked_cells_to_mask --help - - widen_transect_edge_masks --help - - moc_southern_boundary_extractor --help - - ocean_add_depth --help - - ocean_add_zmid --help - - ocean_write_time_varying_zmid --help - - paraview_vtk_field_extractor -f mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc -v latCell,lonCell --ignore_time -o vtk_test - - mpas_to_xdmf -m mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc -v latCell lonCell -o xdmf_test - - split_grids --help - - merge_grids --help - - inject_bathymetry mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc - - inject_preserve_floodplain --help - - mpas_to_triangle --help - - triangle_to_netcdf --help - - jigsaw_to_netcdf --help - - build_jigsaw --clone - - scrip_from_mpas --help - - compute_mpas_region_masks --help - - compute_mpas_transect_masks --help - - compute_mpas_flood_fill_mask --help - - compute_lon_lat_region_masks --help - - compute_projection_region_masks --help - - pip check - -about: - home: https://github.com/MPAS-Dev/MPAS-Tools/ - license: BSD-3-Clause - license_family: BSD - license_file: LICENSE - summary: Mesh tools for Model for Prediction Across Scales (MPAS) - description: | - A set of tools for creating and manipulating meshes for the climate - components based on the Model for Prediction Across Scales (MPAS) framework - doc_url: https://github.com/MPAS-Dev/MPAS-Tools/README.md - dev_url: https://github.com/MPAS-Dev/MPAS-Tools/ - -extra: - recipe-maintainers: - - xylar - - jhkennedy diff --git a/conda_package/recipe/recipe.yaml b/conda_package/recipe/recipe.yaml new file mode 100644 index 000000000..2a3437935 --- /dev/null +++ b/conda_package/recipe/recipe.yaml @@ -0,0 +1,162 @@ +schema_version: 1 + +context: + name: mpas_tools + version: 1.4.0 + +package: + name: ${{ name | lower }} + version: ${{ version }} + +source: + path: ../.. + +build: + number: 0 + skip: + - win + +requirements: + build: + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - ${{ compiler('cxx') }} + - ${{ compiler('fortran') }} + - ${{ stdlib('c') }} + - cmake + - make + - pkgconfig + host: + - python + - hdf5 + - hdf5 * nompi_* + - libnetcdf + - libnetcdf * nompi_* + - netcdf-fortran + - netcdf-fortran * nompi_* + - setuptools + - pip + - netcdf4 + - if: osx + then: llvm-openmp + run: + - python + - cartopy + - cmocean + - dask + - geometric_features >=1.0.1,<2.0.0 + - h5py + - inpoly + - matplotlib-base >=3.9.0 + - nco + - netcdf4 + - networkx + - numpy >=2.0,<3.0 + - progressbar2 + - pyamg + - pyevtk + - pyproj + # older python-igraph is giving me build troubles + - python-igraph >=0.10.0 + - scikit-image !=0.20.0 + - scipy + - shapely >=2.0,<3.0 + - tqdm + - xarray + +tests: + - python: + imports: + - mpas_tools + - mpas_tools.mesh.conversion + - mpas_tools.mesh.creation + - mpas_tools.viz + - mpas_tools.conversion + pip_check: true + + - script: + - test -f "${PREFIX}/bin/ocean_smooth_topo_skip_land_ice" + - test -f "${PREFIX}/bin/ocean_smooth_topo_before_init" + - test -f "${PREFIX}/bin/ocean_smooth_topo_before_init_skip_land_ice" + - if: build_platform == target_platform + then: + - planar_hex --nx=10 --ny=20 --dc=1000. --outFileName='periodic_mesh_10x20_1km.nc' + - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -x 1000. -y 2000. + - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -c + - planar_hex --nx=20 --ny=40 --dc=1000. --outFileName='periodic_mesh_20x40_1km.nc' + - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -d 'periodic_mesh_20x40_1km.nc' + - MpasMeshConverter.x mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc mesh.nc + - sort_mesh --mesh-file mesh.nc --sort-file sorted_mesh.nc + - MpasCellCuller.x mesh.nc culled_mesh.nc -m mesh_tools/mesh_conversion_tools/test/land_mask_final.nc + - MpasMaskCreator.x mesh.nc arctic_mask.nc -f mesh_tools/mesh_conversion_tools/test/Arctic_Ocean.geojson + - planar_hex --nx=30 --ny=20 --dc=1000. --npx --npy --outFileName='nonperiodic_mesh_30x20_1km.nc' + - MpasCellCuller.x nonperiodic_mesh_30x20_1km.nc culled_nonperiodic_mesh_30x20_1km.nc + - python -m pytest conda_package/tests + - mark_horns_for_culling --help + - set_lat_lon_fields_in_planar_grid --help + - create_scrip_file_from_mpas_mesh --help + - create_scrip_file_from_planar_rectangular_grid --help + - prepare_seaice_partitions --help + - create_seaice_partitions --help + - fix_regrid_output.exe + - create_landice_grid_from_generic_mpas_grid --help + - define_landice_cull_mask --help + - interpolate_to_mpasli_grid --help + - mark_domain_boundaries_dirichlet --help + - add_critical_land_blockages_to_mask --help + - add_land_locked_cells_to_mask --help + - widen_transect_edge_masks --help + - moc_southern_boundary_extractor --help + - ocean_add_depth --help + - ocean_add_zmid --help + - ocean_write_time_varying_zmid --help + - paraview_vtk_field_extractor -f mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc -v latCell,lonCell --ignore_time -o vtk_test + - mpas_to_xdmf -m mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc -v latCell lonCell -o xdmf_test + - split_grids --help + - merge_grids --help + - inject_bathymetry mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc + - inject_preserve_floodplain --help + - mpas_to_triangle --help + - triangle_to_netcdf --help + - jigsaw_to_netcdf --help + - conda config --set channel_priority strict + - conda config --add channels conda-forge + - build_jigsaw --clone + - scrip_from_mpas --help + - compute_mpas_region_masks --help + - compute_mpas_transect_masks --help + - compute_mpas_flood_fill_mask --help + - compute_lon_lat_region_masks --help + - compute_projection_region_masks --help + requirements: + run: + - conda + - git + - pip + - pytest + - requests + files: + source: + - mesh_tools/mesh_conversion_tools/test/Arctic_Ocean.geojson + - mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc + - mesh_tools/mesh_conversion_tools/test/land_mask_final.nc + - conda_package/tests/* + +about: + homepage: https://github.com/MPAS-Dev/MPAS-Tools/ + license: BSD-3-Clause + license_file: LICENSE + summary: Mesh tools for Model for Prediction Across Scales (MPAS) + description: | + A set of tools for creating and manipulating meshes for the climate + components based on the Model for Prediction Across Scales (MPAS) framework + documentation: https://github.com/MPAS-Dev/MPAS-Tools/README.md + repository: https://github.com/MPAS-Dev/MPAS-Tools/ + +extra: + recipe-maintainers: + - andrewdnolan + - xylar + - jhkennedy From bee11000ffc28bca3ae0d856a76635aca65755b9 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 1 Mar 2026 20:57:22 +0100 Subject: [PATCH 2/8] Update CI for v1 recipe --- .github/workflows/build_workflow.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index fe2405b7c..f7981ef8b 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -81,14 +81,17 @@ jobs: - name: Build mpas_tools package run: | - conda install conda conda-build - conda build -m "conda_package/ci/linux_64_python${{ matrix.python-version }}.____cpython.yaml" "conda_package/recipe" + micromamba install -y -n mpas_tools_build -c conda-forge rattler-build + rattler-build build \ + -m "conda_package/ci/linux_64_python${{ matrix.python-version }}.____cpython.yaml" \ + --output-dir "${GITHUB_WORKSPACE}/output" \ + -r "conda_package/recipe" # Add local build channel first for subsequent micromamba usage - name: Create Test Environment run: | micromamba create -y -n mpas_tools_test \ - -c ${CONDA_PREFIX}/conda-bld \ + -c ${GITHUB_WORKSPACE}/output \ -c conda-forge \ python=${{ matrix.python-version }} \ mpas_tools \ From 42b6f02bc686789d6a8d8296b2b832a688fb838a Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 1 Mar 2026 21:14:28 +0100 Subject: [PATCH 3/8] Don't ignore a few NetCDF files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a625fc68a..ef30c466c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # Ignore all netcdf files and graph files *.nc +!mesh_tools/mesh_conversion_tools/test/land_mask_final.nc +!mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc *.info *.info.part.* *.o From 0c4bcb5f6cb9ae60b07b1fa7e17b08090faa5ec1 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 1 Mar 2026 22:04:34 +0100 Subject: [PATCH 4/8] Update recipe to fix building jigsaw --- conda_package/recipe/recipe.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/conda_package/recipe/recipe.yaml b/conda_package/recipe/recipe.yaml index 2a3437935..81efdd96b 100644 --- a/conda_package/recipe/recipe.yaml +++ b/conda_package/recipe/recipe.yaml @@ -82,6 +82,7 @@ tests: - test -f "${PREFIX}/bin/ocean_smooth_topo_before_init_skip_land_ice" - if: build_platform == target_platform then: + - build_jigsaw --clone - planar_hex --nx=10 --ny=20 --dc=1000. --outFileName='periodic_mesh_10x20_1km.nc' - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -x 1000. -y 2000. - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -c @@ -121,9 +122,6 @@ tests: - mpas_to_triangle --help - triangle_to_netcdf --help - jigsaw_to_netcdf --help - - conda config --set channel_priority strict - - conda config --add channels conda-forge - - build_jigsaw --clone - scrip_from_mpas --help - compute_mpas_region_masks --help - compute_mpas_transect_masks --help @@ -132,9 +130,9 @@ tests: - compute_projection_region_masks --help requirements: run: - - conda - git - pip + - pixi - pytest - requests files: From 31cb3974519759f2a183e4f27df5581be5f122e3 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 1 Mar 2026 22:28:59 +0100 Subject: [PATCH 5/8] Update docs for preferring pixi and rattler-build workflows --- conda_package/docs/cime.rst | 2 +- conda_package/docs/making_changes.rst | 17 ++--- conda_package/docs/releasing.rst | 13 ++-- conda_package/docs/testing_changes.rst | 86 +++++++++++++++++++++----- 4 files changed, 87 insertions(+), 31 deletions(-) diff --git a/conda_package/docs/cime.rst b/conda_package/docs/cime.rst index f40e39cfe..1db0c024c 100644 --- a/conda_package/docs/cime.rst +++ b/conda_package/docs/cime.rst @@ -8,7 +8,7 @@ sync with `CIME `_, which provides infrastructure and utilities for Earth System Models such at E3SM. Currently, we sync only those constants given numerical values in CIME, not those that are derivied from other constants. Constants are checked against their values on CIME's -master branch during tests of the conda build. +master branch during tests of the rattler-build package build. Some of the constants most likely to be useful in MPAS-Tools, COMPASS and other related projects are: diff --git a/conda_package/docs/making_changes.rst b/conda_package/docs/making_changes.rst index 4cf69e13d..6b7c26e6e 100644 --- a/conda_package/docs/making_changes.rst +++ b/conda_package/docs/making_changes.rst @@ -60,7 +60,7 @@ Entry Points The best way to add new "scripts" to the package is to add a function without any arguments somewhere in the package, and then to add it as an "entry point" -both in ``conda_package/pyproject.toml`` and ``conda_package/recipe/meta.yaml``. +both in ``conda_package/pyproject.toml`` and ``conda_package/recipe/recipe.yaml``. As an example, the entry point ``planar_hex`` is defined in ``pyproject.toml`` as: @@ -71,7 +71,7 @@ As an example, the entry point ``planar_hex`` is defined in ``pyproject.toml`` a planar_hex = "mpas_tools.planar_hex:main" ... -and in ``meta.yaml`` as: +and in ``recipe.yaml`` as: .. code-block:: @@ -108,11 +108,11 @@ Dependencies ============ If you changes introduce new dependencies, these need to be added to both -the recipe for the conda package in ``conda_package/recipe/meta.yaml`` and +the recipe for the conda package in ``conda_package/recipe/recipe.yaml`` and to the text file describing the development environment, -``conda_package/dev-spec.txt``. +``conda_package/dev-spec.txt`` and to ``conda_package/pixi.toml``. -In ``meta.yaml``, add these changes in alphabetical order to the ``run`` +In ``recipe.yaml``, add these changes in alphabetical order to the ``run`` section of ``requirements``: .. code-block:: yaml @@ -127,8 +127,9 @@ section of ``requirements``: These requirements *must* be on the ``conda-forge`` anaconda channel. If you need help with this, please contact the developers. -Add the new dependencies in alphabetical order to ``dev-speck.txt`` -under the ``# Base`` comment: +Add the new dependencies in alphabetical order to ``dev-spec.txt`` +under the ``# Base`` comment and keep ``conda_package/pixi.toml`` in sync +with the same constraints: .. code-block:: none @@ -155,7 +156,7 @@ updated in 3 places. First, in ``conda_package/mpas_tools/__init__.py``: Increment ``__version_info__`` (major, minor or micro version, depending on what makes sense). -Second, the version in the conda recipe (``conda_package/recipe/meta.yaml``) +Second, the version in the conda recipe (``conda_package/recipe/recipe.yaml``) needs to match: .. code-block:: diff --git a/conda_package/docs/releasing.rst b/conda_package/docs/releasing.rst index 300482c79..4366187cc 100644 --- a/conda_package/docs/releasing.rst +++ b/conda_package/docs/releasing.rst @@ -15,7 +15,7 @@ Version Bump and Dependency Updates - Open a pull request (PR) to update the version number in the following two files: - ``conda_package/mpas_tools/__init__.py`` - - ``conda_package/recipe/meta.yaml`` + - ``conda_package/recipe/recipe.yaml`` - Make sure the version follows semantic versioning (see https://semver.org/). @@ -26,18 +26,21 @@ Version Bump and Dependency Updates - Ensure that dependencies and their constraints are up-to-date and consistent in: - - ``conda_package/recipe/meta.yaml`` (dependencies for the conda-forge + - ``conda_package/recipe/recipe.yaml`` (dependencies for the conda-forge release) - ``conda_package/pyproject.toml`` (dependencies for PyPI; used as a sanity check) - ``conda_package/dev-spec.txt`` (development dependencies; should be a superset of those for the conda-forge release) + - ``conda_package/pixi.toml`` (pixi development dependencies; should + match ``dev-spec.txt``) - - The dependencies in ``meta.yaml`` are the ones that will be used for the + - The dependencies in ``recipe.yaml`` are the ones that will be used for the released package on conda-forge. The dependencies in ``pyproject.toml`` are for PyPI and should be kept in sync as much as possible but are only there as a sanity check when we run ```pip check``. The ``dev-spec.txt`` - file should include all dependencies needed for development and testing. + file should include all dependencies needed for development and testing, + and ``pixi.toml`` should remain equivalent for pixi users. - Review and update dependency versions and constraints as needed. @@ -91,7 +94,7 @@ Tagging and Publishing a Release Candidate shasum -a 256 .tar.gz - - In the ``meta.yaml`` of the feedstock recipe: + - In the ``recipe.yaml`` of the feedstock recipe: - Set ``{% set version = "" %}`` - Set the new ``sha256`` value - Update dependencies if needed diff --git a/conda_package/docs/testing_changes.rst b/conda_package/docs/testing_changes.rst index 7f0bdd54d..69aed3b0b 100644 --- a/conda_package/docs/testing_changes.rst +++ b/conda_package/docs/testing_changes.rst @@ -6,23 +6,81 @@ Testing Changes to mpas_tools Here, we describe the workflow for creating a development conda environment that points to ``mpas_tools`` in a branch from a local clone of the repo. -This approach works both for calling functions from the package within a python -script or another python package and for calling the "entry points" -(command-line tools; see :ref:`dev_making_changes`). +The preferred workflow is to build and install the package locally with +``rattler-build`` from within a pixi environment. -Basic instructions on how to install `Miniconda `_ -are beyond the scope of this documentation. Make sure the conda-forge channel -is added and that channel priority is "strict", meaning packages will -definitely come from conda-forge if they are available there. +.. _dev_local_rattler_build: + +Building and Installing Locally with rattler-build +*************************************************** + +This is the recommended method, and it is required if you are modifying +compiled C++ or Fortran tools. + +Use the pixi environment in ``conda_package/pixi.toml`` to run the build +command: + +.. code-block:: bash + + cd conda_package + pixi install + pixi shell + rattler-build build -m ci/linux_64_python3.14.____cpython.yaml -r recipe/ --output-dir ../output + +This writes package artifacts to ``output/`` in the repository root. + +To install the locally built package into an existing conda environment, +install the generated artifact file directly (replace the filename pattern with +the one produced on your platform): + +.. code-block:: bash + + conda install -n mpas_tools_dev -y ../output/linux-64/mpas_tools-*.conda + +If you use ``mamba`` or ``micromamba``, the same install command works with +those tools as well. + +Quick-and-Dirty Alternative: Pixi Editable Install +************************************************** + +If you are only making Python-level changes and do not need to rebuild the +compiled C++/Fortran tools, you can use editable installation in pixi: + +.. code-block:: bash + + cd conda_package + pixi install + pixi shell + pixi run install-editable + +Then run tools within the pixi shell (for example ``pytest``). + +.. important:: + + Editable installation updates Python code but does **not** rebuild compiled + C++ and Fortran command-line tools. + + A useful hybrid workflow is to install the latest release conda package + first (to get compiled tools), then install your branch in editable mode on + top for Python development. + +Legacy Method: Conda Editable Install +************************************* + +This workflow is kept for compatibility but is no longer the preferred method. + +Basic instructions on how to install +`Miniconda `_ are beyond the +scope of this documentation. Make sure the conda-forge channel is added and +that channel priority is "strict": .. code-block:: bash conda config --add channels conda-forge conda config --set channel_priority strict -To make a conda environment and install the current `mpas_tools` in a way that -it will be used out of the repo directly (i.e. it will notice changes as you -make them in your branch), run: +Then create and activate a development environment from ``dev-spec.txt`` and +install in editable mode: .. code-block:: bash @@ -31,14 +89,8 @@ make them in your branch), run: conda activate mpas_tools_dev python -m pip install --no-deps --no-build-isolation -e . -You should now find that ``mpas_tools`` can be imported in python codes and the -various scripts and entry points are available in the path. - -If you have already created the ``mpas_tools_dev`` environment, it may be best -to remove it (see below) and create it again. - Removing the test environment -***************************** +----------------------------- If you're done with testing, you can remove the test environment From bae8f3fbe44579d8fb9c1eacaa6ead095c22b1ac Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 1 Mar 2026 22:29:37 +0100 Subject: [PATCH 6/8] Add pixi development environment --- conda_package/docs/testing_changes.rst | 25 +++++++++++---- conda_package/pixi.toml | 43 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 conda_package/pixi.toml diff --git a/conda_package/docs/testing_changes.rst b/conda_package/docs/testing_changes.rst index 69aed3b0b..f4d706a34 100644 --- a/conda_package/docs/testing_changes.rst +++ b/conda_package/docs/testing_changes.rst @@ -29,16 +29,29 @@ command: This writes package artifacts to ``output/`` in the repository root. -To install the locally built package into an existing conda environment, -install the generated artifact file directly (replace the filename pattern with -the one produced on your platform): +To install the locally built package into the pixi environment, add the local +build output as a channel and then add ``mpas_tools`` from that channel: .. code-block:: bash - conda install -n mpas_tools_dev -y ../output/linux-64/mpas_tools-*.conda + cd conda_package + pixi workspace channel add "file://$PWD/../output" + pixi add --platform linux-64 "mpas_tools [channel='file://$PWD/../output']" + +.. warning:: + + The commands above modify ``pixi.toml`` (and possibly ``pixi.lock``). + These are local development changes only and should **not** be committed. + Before opening a PR, reset those files to the repository state. + +On macOS, use ``--platform osx-64`` instead. If your workspace includes both +``linux-64`` and ``osx-64`` in ``pixi.toml``, pixi may try to solve both +platforms during dependency updates. In that case, build local artifacts for +both platforms (with corresponding CI recipe files) or add the local package +for only the platform you built. -If you use ``mamba`` or ``micromamba``, the same install command works with -those tools as well. +If you want to return to using only published channels afterward, you can +remove the local channel from ``pixi.toml``. Quick-and-Dirty Alternative: Pixi Editable Install ************************************************** diff --git a/conda_package/pixi.toml b/conda_package/pixi.toml new file mode 100644 index 000000000..4f5e7e218 --- /dev/null +++ b/conda_package/pixi.toml @@ -0,0 +1,43 @@ +[workspace] +name = "mpas-tools-dev" +channels = ["conda-forge"] +platforms = ["linux-64", "osx-64"] + +[dependencies] +python = ">=3.10" +cartopy = "*" +cmocean = "*" +dask = "*" +geometric_features = ">=1.0.1,<2.0.0" +h5py = "*" +hdf5 = "*" +inpoly = "*" +libnetcdf = "*" +matplotlib-base = ">=3.9.0" +nco = "*" +netcdf4 = "*" +networkx = "*" +numpy = ">=2.0,<3.0" +progressbar2 = "*" +pyamg = "*" +pyevtk = "*" +pyproj = "*" +python-igraph = "*" +scikit-image = "!=0.20.0" +scipy = "*" +shapely = ">=2.0,<3.0" +tqdm = "*" +xarray = "*" +flynt = "*" +pip = "*" +pre-commit = "*" +pytest = "*" +ruff = "*" +setuptools = "*" +rattler-build = "*" +sphinx = "*" +mock = "*" +sphinx_rtd_theme = "*" + +[tasks] +install-editable = "python -m pip install --no-deps --no-build-isolation -e ." From 61ca8d2b1201c9483af852be84246e32f86d7104 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 1 Mar 2026 22:29:48 +0100 Subject: [PATCH 7/8] Ignore pixi lock file and rattler-build output dir --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index ef30c466c..03f16f855 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,9 @@ ENV/ # pycharm .idea + +# pixi +conda_package/pixi.lock + +# test builds +output From f0f77086bfbc0bc748841a12d2d2762915ea327f Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 2 Mar 2026 15:13:32 +0100 Subject: [PATCH 8/8] Don't test build_jigsaw It doesn't work within rattler-build --- conda_package/recipe/recipe.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/conda_package/recipe/recipe.yaml b/conda_package/recipe/recipe.yaml index 81efdd96b..2035b8341 100644 --- a/conda_package/recipe/recipe.yaml +++ b/conda_package/recipe/recipe.yaml @@ -82,7 +82,6 @@ tests: - test -f "${PREFIX}/bin/ocean_smooth_topo_before_init_skip_land_ice" - if: build_platform == target_platform then: - - build_jigsaw --clone - planar_hex --nx=10 --ny=20 --dc=1000. --outFileName='periodic_mesh_10x20_1km.nc' - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -x 1000. -y 2000. - translate_planar_grid -f 'periodic_mesh_10x20_1km.nc' -c @@ -121,6 +120,7 @@ tests: - inject_preserve_floodplain --help - mpas_to_triangle --help - triangle_to_netcdf --help + - build_jigsaw --help - jigsaw_to_netcdf --help - scrip_from_mpas --help - compute_mpas_region_masks --help @@ -130,9 +130,6 @@ tests: - compute_projection_region_masks --help requirements: run: - - git - - pip - - pixi - pytest - requests files: