Skip to content

Commit 523f5b4

Browse files
Update documentation
1 parent 4c2a293 commit 523f5b4

16 files changed

Lines changed: 213 additions & 68 deletions

master/.doctrees/cime.doctree

32 Bytes
Binary file not shown.
1.49 KB
Binary file not shown.
526 Bytes
Binary file not shown.

master/.doctrees/releasing.doctree

2.73 KB
Binary file not shown.
7.48 KB
Binary file not shown.

master/_sources/cime.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sync with `CIME <https://github.com/ESMCI/cime>`_, which provides infrastructure
88
and utilities for Earth System Models such at E3SM. Currently, we sync only
99
those constants given numerical values in CIME, not those that are derivied
1010
from other constants. Constants are checked against their values on CIME's
11-
master branch during tests of the conda build.
11+
master branch during tests of the rattler-build package build.
1212

1313
Some of the constants most likely to be useful in MPAS-Tools, COMPASS and other
1414
related projects are:

master/_sources/making_changes.rst.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Entry Points
6060

6161
The best way to add new "scripts" to the package is to add a function without
6262
any arguments somewhere in the package, and then to add it as an "entry point"
63-
both in ``conda_package/pyproject.toml`` and ``conda_package/recipe/meta.yaml``.
63+
both in ``conda_package/pyproject.toml`` and ``conda_package/recipe/recipe.yaml``.
6464

6565
As an example, the entry point ``planar_hex`` is defined in ``pyproject.toml`` as:
6666

@@ -71,7 +71,7 @@ As an example, the entry point ``planar_hex`` is defined in ``pyproject.toml`` a
7171
planar_hex = "mpas_tools.planar_hex:main"
7272
...
7373
74-
and in ``meta.yaml`` as:
74+
and in ``recipe.yaml`` as:
7575

7676
.. code-block::
7777
@@ -108,11 +108,11 @@ Dependencies
108108
============
109109

110110
If you changes introduce new dependencies, these need to be added to both
111-
the recipe for the conda package in ``conda_package/recipe/meta.yaml`` and
111+
the recipe for the conda package in ``conda_package/recipe/recipe.yaml`` and
112112
to the text file describing the development environment,
113-
``conda_package/dev-spec.txt``.
113+
``conda_package/dev-spec.txt`` and to ``conda_package/pixi.toml``.
114114

115-
In ``meta.yaml``, add these changes in alphabetical order to the ``run``
115+
In ``recipe.yaml``, add these changes in alphabetical order to the ``run``
116116
section of ``requirements``:
117117

118118
.. code-block:: yaml
@@ -127,8 +127,9 @@ section of ``requirements``:
127127
These requirements *must* be on the ``conda-forge`` anaconda channel. If you
128128
need help with this, please contact the developers.
129129

130-
Add the new dependencies in alphabetical order to ``dev-speck.txt``
131-
under the ``# Base`` comment:
130+
Add the new dependencies in alphabetical order to ``dev-spec.txt``
131+
under the ``# Base`` comment and keep ``conda_package/pixi.toml`` in sync
132+
with the same constraints:
132133

133134
.. code-block:: none
134135
@@ -155,7 +156,7 @@ updated in 3 places. First, in ``conda_package/mpas_tools/__init__.py``:
155156
Increment ``__version_info__`` (major, minor or micro version, depending on
156157
what makes sense).
157158

158-
Second, the version in the conda recipe (``conda_package/recipe/meta.yaml``)
159+
Second, the version in the conda recipe (``conda_package/recipe/recipe.yaml``)
159160
needs to match:
160161

161162
.. code-block::

master/_sources/releasing.rst.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Version Bump and Dependency Updates
1515
- Open a pull request (PR) to update the version number in the following
1616
two files:
1717
- ``conda_package/mpas_tools/__init__.py``
18-
- ``conda_package/recipe/meta.yaml``
18+
- ``conda_package/recipe/recipe.yaml``
1919

2020
- Make sure the version follows semantic versioning (see
2121
https://semver.org/).
@@ -26,18 +26,21 @@ Version Bump and Dependency Updates
2626
- Ensure that dependencies and their constraints are up-to-date and
2727
consistent in:
2828

29-
- ``conda_package/recipe/meta.yaml`` (dependencies for the conda-forge
29+
- ``conda_package/recipe/recipe.yaml`` (dependencies for the conda-forge
3030
release)
3131
- ``conda_package/pyproject.toml`` (dependencies for PyPI; used as a
3232
sanity check)
3333
- ``conda_package/dev-spec.txt`` (development dependencies; should be a
3434
superset of those for the conda-forge release)
35+
- ``conda_package/pixi.toml`` (pixi development dependencies; should
36+
match ``dev-spec.txt``)
3537

36-
- The dependencies in ``meta.yaml`` are the ones that will be used for the
38+
- The dependencies in ``recipe.yaml`` are the ones that will be used for the
3739
released package on conda-forge. The dependencies in ``pyproject.toml``
3840
are for PyPI and should be kept in sync as much as possible but are only
3941
there as a sanity check when we run ```pip check``. The ``dev-spec.txt``
40-
file should include all dependencies needed for development and testing.
42+
file should include all dependencies needed for development and testing,
43+
and ``pixi.toml`` should remain equivalent for pixi users.
4144

4245
- Review and update dependency versions and constraints as needed.
4346

@@ -91,7 +94,7 @@ Tagging and Publishing a Release Candidate
9194

9295
shasum -a 256 <version>.tar.gz
9396

94-
- In the ``meta.yaml`` of the feedstock recipe:
97+
- In the ``recipe.yaml`` of the feedstock recipe:
9598
- Set ``{% set version = "<version>" %}``
9699
- Set the new ``sha256`` value
97100
- Update dependencies if needed

master/_sources/testing_changes.rst.txt

Lines changed: 82 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,94 @@ Testing Changes to mpas_tools
66

77
Here, we describe the workflow for creating a development conda environment
88
that points to ``mpas_tools`` in a branch from a local clone of the repo.
9-
This approach works both for calling functions from the package within a python
10-
script or another python package and for calling the "entry points"
11-
(command-line tools; see :ref:`dev_making_changes`).
9+
The preferred workflow is to build and install the package locally with
10+
``rattler-build`` from within a pixi environment.
1211

13-
Basic instructions on how to install `Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_
14-
are beyond the scope of this documentation. Make sure the conda-forge channel
15-
is added and that channel priority is "strict", meaning packages will
16-
definitely come from conda-forge if they are available there.
12+
.. _dev_local_rattler_build:
13+
14+
Building and Installing Locally with rattler-build
15+
***************************************************
16+
17+
This is the recommended method, and it is required if you are modifying
18+
compiled C++ or Fortran tools.
19+
20+
Use the pixi environment in ``conda_package/pixi.toml`` to run the build
21+
command:
22+
23+
.. code-block:: bash
24+
25+
cd conda_package
26+
pixi install
27+
pixi shell
28+
rattler-build build -m ci/linux_64_python3.14.____cpython.yaml -r recipe/ --output-dir ../output
29+
30+
This writes package artifacts to ``output/`` in the repository root.
31+
32+
To install the locally built package into the pixi environment, add the local
33+
build output as a channel and then add ``mpas_tools`` from that channel:
34+
35+
.. code-block:: bash
36+
37+
cd conda_package
38+
pixi workspace channel add "file://$PWD/../output"
39+
pixi add --platform linux-64 "mpas_tools [channel='file://$PWD/../output']"
40+
41+
.. warning::
42+
43+
The commands above modify ``pixi.toml`` (and possibly ``pixi.lock``).
44+
These are local development changes only and should **not** be committed.
45+
Before opening a PR, reset those files to the repository state.
46+
47+
On macOS, use ``--platform osx-64`` instead. If your workspace includes both
48+
``linux-64`` and ``osx-64`` in ``pixi.toml``, pixi may try to solve both
49+
platforms during dependency updates. In that case, build local artifacts for
50+
both platforms (with corresponding CI recipe files) or add the local package
51+
for only the platform you built.
52+
53+
If you want to return to using only published channels afterward, you can
54+
remove the local channel from ``pixi.toml``.
55+
56+
Quick-and-Dirty Alternative: Pixi Editable Install
57+
**************************************************
58+
59+
If you are only making Python-level changes and do not need to rebuild the
60+
compiled C++/Fortran tools, you can use editable installation in pixi:
61+
62+
.. code-block:: bash
63+
64+
cd conda_package
65+
pixi install
66+
pixi shell
67+
pixi run install-editable
68+
69+
Then run tools within the pixi shell (for example ``pytest``).
70+
71+
.. important::
72+
73+
Editable installation updates Python code but does **not** rebuild compiled
74+
C++ and Fortran command-line tools.
75+
76+
A useful hybrid workflow is to install the latest release conda package
77+
first (to get compiled tools), then install your branch in editable mode on
78+
top for Python development.
79+
80+
Legacy Method: Conda Editable Install
81+
*************************************
82+
83+
This workflow is kept for compatibility but is no longer the preferred method.
84+
85+
Basic instructions on how to install
86+
`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ are beyond the
87+
scope of this documentation. Make sure the conda-forge channel is added and
88+
that channel priority is "strict":
1789

1890
.. code-block:: bash
1991
2092
conda config --add channels conda-forge
2193
conda config --set channel_priority strict
2294
23-
To make a conda environment and install the current `mpas_tools` in a way that
24-
it will be used out of the repo directly (i.e. it will notice changes as you
25-
make them in your branch), run:
95+
Then create and activate a development environment from ``dev-spec.txt`` and
96+
install in editable mode:
2697

2798
.. code-block:: bash
2899
@@ -31,14 +102,8 @@ make them in your branch), run:
31102
conda activate mpas_tools_dev
32103
python -m pip install --no-deps --no-build-isolation -e .
33104
34-
You should now find that ``mpas_tools`` can be imported in python codes and the
35-
various scripts and entry points are available in the path.
36-
37-
If you have already created the ``mpas_tools_dev`` environment, it may be best
38-
to remove it (see below) and create it again.
39-
40105
Removing the test environment
41-
*****************************
106+
-----------------------------
42107

43108
If you're done with testing, you can remove the test environment
44109

master/cime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
and utilities for Earth System Models such at E3SM. Currently, we sync only
132132
those constants given numerical values in CIME, not those that are derivied
133133
from other constants. Constants are checked against their values on CIME’s
134-
master branch during tests of the conda build.</p>
134+
master branch during tests of the rattler-build package build.</p>
135135
<p>Some of the constants most likely to be useful in MPAS-Tools, COMPASS and other
136136
related projects are:</p>
137137
<ul class="simple">

0 commit comments

Comments
 (0)