Skip to content

Commit 315f7c5

Browse files
Merge pull request #222 from oliver-sanders/dev-docs++
Added clarifications to env setup. Added new dependencies to conda create command. Altered recommended install order. Added a recommended single install command for all components.
2 parents c2fca4e + c45bbf6 commit 315f7c5

1 file changed

Lines changed: 103 additions & 46 deletions

File tree

docs/howto/dev-setup.md

Lines changed: 103 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,90 +9,142 @@
99

1010
## Development Setup
1111

12-
1. Say Hi On The [Cylc Developers Chat](https://matrix.to/#/#cylc-general:matrix.org).
12+
#. **Say Hi On The [Cylc Developers Chat](https://matrix.to/#/#cylc-general:matrix.org)!**
1313

14-
2. Install System Dependencies:
1514

16-
> **Note**: We recommend developing in a Conda environment, although it
17-
is possible, though less flexible, to install the required system
18-
dependencies and work in Python virtual environments.
15+
#. **Install System Dependencies**
1916

20-
Use whatever Conda client you prefer, `micromamba` is the most performant.
17+
> [!NOTE]
18+
> We recommend developing in a Conda environment, although it
19+
> is possible, though less flexible, to install the required system
20+
> dependencies and work in Python virtual environments.
21+
>
22+
> Use whatever Conda client you prefer, `micromamba` is the most performant.
2123
2224
This command will give you a Conda environment containing all the things you
23-
might need for Cylc development:
25+
might need for Cylc/Rose development:
2426

2527
```bash
26-
conda create -n cylc-dev python pip configurable-http-proxy graphviz nodejs yarn shellcheck
28+
conda create -y -n cylc-dev \
29+
python \
30+
pip \
31+
configurable-http-proxy \
32+
graphviz \
33+
nodejs \
34+
yarn \
35+
shellcheck \
36+
pygraphviz \
37+
pygobject \
38+
gtk3
2739
```
2840

29-
To ensure your Conda environment is automatically activated across a
30-
distributed network, create a pair of activate/deactivate files:
41+
42+
#. **Configure For Distributed Development**
43+
44+
Follow these steps if you're running on a network with a shared filesystem.
45+
46+
[Install the Cylc wrapper script](https://cylc.github.io/cylc-doc/stable/html/installation.html#managing-environments).
47+
48+
> [!NOTE]
49+
> Your site may have already done this for you.
50+
51+
Then configure the path to your Conda environment directory in your shell
52+
profile file (e.g, `.bash_profile`), e.g:
53+
54+
```bash
55+
# ~/.bash_profile
56+
export CYLC_HOME_ROOT_ALT="/path/to/conda/environment/directory"
57+
```
58+
59+
To locate your environment directory, run:
60+
61+
```bash
62+
conda activate cylc-dev
63+
dirname $CONDA_PREFIX
64+
```
65+
66+
Then get Conda to set the `CYLC_ENV_NAME` environment variable automatically
67+
when you active the environment (this tells the wrapper script which Conda
68+
environment to use for remote command invocations):
3169

3270
```console
3371
$ conda activate cylc-dev
3472
$ echo "export CYLC_ENV_NAME=$CONDA_DEFAULT_ENV" > $CONDA_PREFIX/etc/conda/activate.d/cylc.sh
3573
$ echo 'unset CYLC_ENV_NAME' > $CONDA_PREFIX/etc/conda/deactivate.d/cylc.sh
3674
```
3775

38-
3. Fork & Clone
76+
77+
#. **Fork & Clone**
3978

4079
On GitHub, create a fork of any of the Cylc repositories you want to work
4180
on and create a local clone of them
4281
(i.e, `git clone git@github.com/<yourname>/<repo>.git`).
4382

44-
Please star https://github.com/cylc/cylc-flow and
45-
https://github.com/metomi/rose/ :)
83+
Please star [cylc-flow](https://github.com/cylc/cylc-flow) and
84+
[metomi-rose](https://github.com/metomi/rose/) :)
4685

4786

48-
4. Install Python Projects
87+
#. **Install Python Projects**
4988

5089
Install any Python projects you have just cloned into your Conda
5190
environment.
52-
> Note: `cylc-ui` is installed separately below via a different process.
5391

5492
Install [cylc/cylc-flow](https://github.com/cylc/cylc-flow/) and optionally:
5593

56-
* [cylc/cylc-uiserver](https://github.com/cylc/cylc-uiserver/) (for UIS work)
94+
* [cylc/cylc-uiserver](https://github.com/cylc/cylc-uiserver/) (for web server work)
5795
* [metomi/rose](https://github.com/metomi/rose/) (for Rose work)
58-
* [cylc/cylc-rose](https://github.com/cylc/cylc-rose/) (for Rose work)
59-
* [cylc/cylc-doc](https://github.com/cylc/cylc-doc/) (for docs changes)
60-
> Note: This requires all above repo sorties to be installed via:
96+
* [cylc/cylc-rose](https://github.com/cylc/cylc-rose/) (for Cylc / Rose integration)
97+
* [cylc/cylc-doc](https://github.com/cylc/cylc-doc/) (for Cylc docs changes)
98+
99+
Install the `[all]` optional dependency to pick up test, developer and
100+
documentation extras, i.e:
61101

62102
```bash
63103
pip install -e "path/to/repo[all]"
64104
```
65-
Dependencies are best installed in this order to avoid conflicts:
66-
* cylc-rose
67-
* cylc-uiserver
68-
* cylc-flow
69-
* rose
70-
* cylc-doc
71-
72-
> Note: For a fuller description see [project dependencies](#project-dependencies)
73-
74-
You only need to repeat this `pip install` command when certain project
75-
files are modified:
76-
* `setup.py`
77-
* `setup.cfg`
78-
* `pyproject.toml`
79-
* `MANIFEST.in`
80-
> Note: You can use `uv pip` as a stand-in for `pip`.
81-
82-
5. Install and configure [cylc/cylc-ui](https://github.com/cylc/cylc-ui/) (optional)
105+
106+
When doing this for the first time it's better to install them all in one
107+
go, e.g:
108+
109+
```bash
110+
pip install -e ./cylc-flow[all] \
111+
-e ./cylc-uiserver[all] \
112+
-e ./rose[all] \
113+
-e ./cylc-rose[all] \
114+
-e ./cylc-doc[all]
115+
```
116+
117+
> [!NOTE]
118+
> There are dependencies between projects, so they may need to be installed
119+
> in order, see [project dependencies](#project-dependencies)
120+
121+
> [!NOTE]
122+
> Installing in "editable" mode (the `-e` above) means you only need to
123+
> repeat this `pip install` command when certain project files are modified:
124+
> * `setup.py`
125+
> * `setup.cfg`
126+
> * `pyproject.toml`
127+
> * `MANIFEST.in`
128+
129+
> [!NOTE]
130+
> You can use `uv pip` as a stand-in for `pip`.
131+
132+
133+
#. **Install and configure [cylc/cylc-ui](https://github.com/cylc/cylc-ui/) (optional)**
83134

84135
```bash
85136
cd path/to/cylc-ui
86137
conda activate cylc-dev
87138
yarn install
88-
yarn run build # create your first build
139+
yarn run build # create your first production build
89140
```
90141

91142
The Cylc UI Server comes with a bundled version of Cylc UI. To use your
92143
personal build add the following to your Jupyter configuration:
93144

94145
```python
95146
# ~/.cylc/hub/jupyter_config.py
147+
# NOTE: some of us use an environment variable to toggle this on/off
96148
c.CylcUIServer.ui_build_dir = '~/cylc-ui/dist' # path to build
97149
```
98150

@@ -115,7 +167,8 @@
115167
# done so before.
116168
```
117169

118-
6. Contributor License Agreement
170+
171+
#. **Contributor License Agreement**
119172

120173
Read the `CONTRIBUTING.md` file and add your name to it with your first
121174
commit.
@@ -127,6 +180,8 @@
127180
## Running Your First Workflow
128181

129182
```bash
183+
conda acitvate cylc-dev
184+
130185
# clone the workflow into ~/cylc-src
131186
cylc get-resources tutorial/cylc-forecasting-workflow
132187

@@ -183,16 +238,18 @@ The currently supported (i.e. actively developed) versions are documented
183238

184239
### Project Dependencies
185240

241+
There are dependencies between our projects, here's a summary:
242+
186243
<pre class="mermaid">
187244
---
188245
config:
189246
look: handDrawn
190247
---
191-
flowchart RL
192-
rose -->|requires| isodatetime["metomi/isodatetime"]
193-
CR[cylc-rose] -->|requires| CF[cylc-flow]
194-
CR -->|requires| rose["metomi/rose"]
195-
uis[cylc uiserver] -->|requires| CF
196-
uis .->|bundles| ui["cylc ui (JavaScript)"]
197-
248+
flowchart LR
249+
isodatetime --> rose
250+
isodatetime --> cylc-flow
251+
rose --> cylc-rose
252+
cylc-flow --> cylc-rose
253+
cylc-flow --> cylc-uiserver
254+
cylc-ui -->|bundled| cylc-uiserver
198255
</pre>

0 commit comments

Comments
 (0)