Skip to content

Commit 2fdaa91

Browse files
authored
Merge branch 'master' into db-diagram
2 parents 50cc9b2 + 384e5db commit 2fdaa91

File tree

84 files changed

+1262
-2942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1262
-2942
lines changed

.github/workflows/test_tutorial_workflow.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,33 @@ clean:
2222
rm -rf src/plugins/install/built-in
2323
rm -rf src/user-guide/task-implementation/job-runner-handlers
2424

25+
watch: clean
26+
# rebuild incrementally whenever documentation files are changed
27+
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" \
28+
--ignore='**plugins/main-loop/built-in/*.rst' \
29+
--ignore='**plugins/install/built-in/*.rst' \
30+
--ignore='**/job-runner-handlers/*.rst' \
31+
--open-browser
32+
33+
watch-cylc:
34+
# rebuild non-incrementally (SLOW) whenever docs files OR Cylc source
35+
# code files are changed
36+
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" \
37+
-a \
38+
--pre-build='make clean' \
39+
--ignore='**plugins/main-loop/built-in/*.rst' \
40+
--ignore='**plugins/install/built-in/*.rst' \
41+
--ignore='**/job-runner-handlers/*.rst' \
42+
--watch="$(shell bin/c-locate cylc.flow)" \
43+
--watch="$(shell bin/c-locate cylc.uiserver)" \
44+
--watch="$(shell bin/c-locate cylc.rose)" \
45+
--open-browser
46+
2547
cleanall:
2648
(cd doc; echo [0-9]*.*)
2749
rm -rI doc/[0-9]*.*
2850

29-
.PHONY: help clean Makefile .EXPORT_ALL_VARIABLES
51+
.PHONY: help clean watch Makefile .EXPORT_ALL_VARIABLES
3052

3153
# Catch-all target: route all unknown targets to Sphinx using the new
3254
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,56 @@ Note: you may need to install `graphviz` first (e.g. `conda install graphviz`).
9090
$ git clone [email protected]:cylc/cylc-doc.git cylc-doc
9191
$ cd cylc-doc
9292
$ pip install -e .
93+
```
94+
95+
### Simple Build
96+
97+
Build the docs using `make`:
98+
99+
```console
93100
$ make html
94101
```
95102

103+
The documentation builds incrementally, if you make changes to the Cylc source
104+
files run `make clean`:
105+
106+
```console
107+
$ make clean html
108+
```
109+
110+
### Automatic Build
111+
112+
You can also get Sphinx to rebuild automatically when documentation files are
113+
modified. Fist install the optional dependency `watch`:
114+
115+
```console
116+
$ pip install -e .[watch]
117+
118+
```
119+
120+
Then build the `watch` target:
121+
122+
```console
123+
$ make watch # you do not need to `make clean` with the `watch` target
124+
```
125+
126+
This will monitor for changes in the `cylc-doc` repository and rebuild the
127+
documentation incrementally.
128+
129+
To also monitor for changes in the `cylc-flow`, `cylc-uiserver` and `cylc-rose`
130+
repositories use the `watch-cylc` target:
131+
132+
```console
133+
$ make watch-cylc # you do not need to `make clean` with the `watch` target
134+
```
135+
136+
This forces a complete rebuild every time a file is changed which is slow, but
137+
allows it to pick up changes to autodocumented items in the source code.
138+
139+
> **Note:** Your Cylc repositories must be installed in editible mode
140+
> i.e. `pip install -e <repo>` for this to work.
141+
> **Note:** This might not work for all filesystems.
142+
96143
### Testing
97144

98145
```console
@@ -149,7 +196,7 @@ preserved and does not require housekeeping.
149196

150197
[![License](https://img.shields.io/github/license/cylc/cylc-doc.svg?color=lightgrey)](https://github.com/cylc/cylc-doc/blob/master/LICENSE)
151198

152-
Copyright (C) 2008-<span actions:bind='current-year'>2021</span> NIWA & British Crown (Met Office) & Contributors.
199+
Copyright (C) 2008-<span actions:bind='current-year'>2022</span> NIWA & British Crown (Met Office) & Contributors.
153200

154201
Cylc is free software: you can redistribute it and/or modify it under the terms
155202
of the GNU General Public License as published by the Free Software Foundation,
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env python
22
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
33
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
44
#
@@ -15,15 +15,25 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18+
"""Locate Python repository installations."""
1819

19-
set -eu
20-
cd "$(dirname "$0")"
20+
from pathlib import Path
21+
import sys
2122

22-
for FILE in $(echo ../cylc/doc/etc/tutorial/*/.validate) ; do
23-
echo "running $FILE"
24-
(
25-
cd "$(dirname "$FILE")"
26-
./.validate
27-
)
28-
done
2923

24+
def main(arg):
25+
if arg == 'cylc.flow':
26+
import cylc.flow
27+
print(Path(cylc.flow.__file__).parent)
28+
elif arg == 'cylc.uiserver':
29+
import cylc.uiserver
30+
print(Path(cylc.uiserver.__file__).parent)
31+
elif arg == 'cylc.rose':
32+
import cylc.rose
33+
print(Path(cylc.rose.__file__).parent)
34+
else:
35+
raise ValueError(f'Unsupported arg: {arg}')
36+
37+
38+
if __name__ == '__main__':
39+
main(sys.argv[1])

bin/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ DUMMY_FORMATS = [
3434

3535
def get_versions(builddir):
3636
"""Yield paths to each documented version."""
37-
yield from pathlib.Path(builddir).glob('[0-9]*.*')
37+
yield from pathlib.Path(builddir).glob('[0-9]*.[0-9]*')
3838
yield from pathlib.Path(builddir).glob('stable')
3939
yield from pathlib.Path(builddir).glob('latest')
4040
yield from pathlib.Path(builddir).glob('nightly')

cylc/doc/etc/tutorial/api-keys

Lines changed: 0 additions & 3 deletions
This file was deleted.

cylc/doc/etc/tutorial/consolidation-tutorial/.validate

Lines changed: 0 additions & 21 deletions
This file was deleted.

cylc/doc/etc/tutorial/consolidation-tutorial/bin

Lines changed: 0 additions & 1 deletion
This file was deleted.

cylc/doc/etc/tutorial/consolidation-tutorial/flow.cylc

Lines changed: 0 additions & 102 deletions
This file was deleted.

cylc/doc/etc/tutorial/consolidation-tutorial/lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)