Skip to content

Commit ea60ad9

Browse files
committed
Convert rose into a package
* Get rid of ROSE_HOME * Lots of syntax help from Oliver Sanders * Made refs to isodatetime work with metomi.isodatetime
1 parent 5e9034a commit ea60ad9

File tree

361 files changed

+2665
-8899
lines changed

Some content is hidden

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

361 files changed

+2665
-8899
lines changed

.bandit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
skips: ['B101']
1+
skips: ['B101', 'B322']

.eslintignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
doc/*
2-
lib/html/static/js/bootstrap*
3-
lib/html/static/js/dataTables.bootstrap*
4-
lib/html/static/js/jquery*
5-
lib/html/static/js/livestamp.min.js
6-
lib/html/static/js/moment.min.js
2+
metomi/rosie/lib/html/static/js/bootstrap*
3+
metomi/rosie/lib/html/static/js/dataTables.bootstrap*
4+
metomi/rosie/lib/html/static/js/jquery*
5+
metomi/rosie/lib/html/static/js/livestamp.min.js
6+
metomi/rosie/lib/html/static/js/moment.min.js

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ etc/opt
55
lib/bash/rose_init_site
66
doc
77
venv
8+
metomi_rose.egg-info
9+
dist
810

911
# coverage
1012
.coverage

.travis.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@ jobs:
2020
include:
2121
- name: "Unit Tests"
2222
install:
23-
- now install coverage cylc linters pytest rose
23+
- now install coverage linters pytest cylc rose
2424
script:
2525
- now test style
2626
- now test units
2727

2828
- name: "Test Battery"
2929
before_install:
3030
- export PATH="$PWD/.travis:$PATH"
31-
- now install coverage cylc fcm rose rosie tut_suite
31+
- now install coverage fcm tut_suite
32+
install:
33+
- now install isodatetime cylc rose
3234
script:
3335
- now test battery
36+
3437
- name: "Documentation"
3538
install:
36-
- now install coverage rose sphinx tut_suite
39+
- now install coverage isodatetime rose sphinx tut_suite
3740
script:
3841
- now test docs
39-
- now build docs

.travis/cover.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
def main():
27-
command = ['rose', 'test-battery', '-j', '5']
27+
command = ['etc/bin/rose-test-battery', '-j', '5']
2828
if call(command + ['--state=save']):
2929
# Non-zero return code
3030
sys.stderr.write('\n\nRerunning Failed Tests...\n\n')

.travis/now

+15-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ WANDISCO=false
4949

5050

5151
_build_docs () {
52-
rose make-docs --strict clean html slides latexpdf
52+
etc/bin/rose-make-docs --strict clean html slides latexpdf
5353
}
5454

5555
_gh_extract () { # extract project from GitHub to $HOME
@@ -79,12 +79,24 @@ _install_coverage () {
7979
PY_PATH+=("${TRAVIS_BUILD_DIR}/.travis")
8080
}
8181

82+
_install_rose () {
83+
pip install -e .
84+
PY_PATH+=("${TRAVIS_BUILD_DIR}/metomi")
85+
RC_PATH+=("${TRAVIS_BUILD_DIR}/bin")
86+
}
87+
8288
_install_cylc () {
8389
APT+=(at heirloom-mailx)
8490
GIT+=('cylc|cylc-flow|master')
8591
RC_PATH+=("${HOME}/cylc-master/bin")
8692
}
8793

94+
_install_isodatetime () {
95+
wget 'https://github.com/metomi/isodatetime/archive/master.tar.gz' \
96+
-O - | tar -xz -C "${HOME}"
97+
pip install -e "${HOME}/isodatetime-master"
98+
}
99+
88100
_install_fcm () {
89101
APT+=(subversion build-essential gfortran libxml-parser-perl \
90102
libconfig-inifiles-perl libdbi-perl libdbd-sqlite3-perl)
@@ -98,12 +110,6 @@ _install_pytest () {
98110
PIP+=(pytest)
99111
}
100112

101-
_install_rose () {
102-
PIP+=(aiofiles)
103-
PY_PATH+=("${TRAVIS_BUILD_DIR}/lib/python/")
104-
RC_PATH+=("${TRAVIS_BUILD_DIR}/bin")
105-
}
106-
107113
_install_rosie () {
108114
PIP+=(requests tornado sqlalchemy)
109115
RI_PATH+=("$(_path_for python)" "$(_path_for rose)")
@@ -140,7 +146,7 @@ _path_for () {
140146
}
141147

142148
_test_units () {
143-
pytest --cov-append lib/python/rose/tests/*
149+
pytest --cov-append metomi/rose/tests/*
144150
}
145151

146152
_test_style () {
@@ -152,11 +158,10 @@ _test_style () {
152158
_test_battery () {
153159
cp "${TRAVIS_BUILD_DIR}/.travis/sitecustomize.py" ./lib/python
154160
coverage run .travis/cover.py
155-
rm ./lib/python/sitecustomize.py
156161
}
157162

158163
_test_docs () {
159-
rose make-docs --strict clean linkcheck doctest
164+
etc/bin/rose-make-docs --strict clean linkcheck doctest
160165
}
161166

162167
_wandisco_configure () { # extract Wandisco stuff

.travis/shellchecker

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ default () {
7979
main . \
8080
--exclude etc/rose-bash-completion \
8181
--exclude t \
82-
-- -e SC1090
82+
-- -e SC1090 -e SC2119
8383

8484
# run a lenient check on all test scripts
8585
main t -- -S error -e SC1090

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ release for production use.
1919

2020
[Installation](http://metomi.github.io/rose/doc/html/installation.html) |
2121
[User Guide](http://metomi.github.io/rose/) |
22-
[How to Contribute](CONTRIBUTING.md)
22+
[How to Contribute](https://github.com/metomi/rose/blob/master/CONTRIBUTING.md)
2323

2424
## Copyright and Terms of Use
2525

@@ -46,4 +46,4 @@ See <http://metomi.github.io/rose/doc/html/terms.html>.
4646

4747
## Acknowledgement for non-Rose Work
4848

49-
See [Acknowledgement for Non-Rose Work](ACKNOWLEDGEMENT.md).
49+
See [Acknowledgement for Non-Rose Work](https://github.com/metomi/rose/blob/master/ACKNOWLEDGEMENT.md).

bin/rose

+7-8
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
if ${ROSE_DEBUG:-false}; then
3838
set -x
3939
fi
40-
. "$(dirname "$0")/../lib/bash/rose_init"
40+
# shellcheck source=lib/bash/rose_init
41+
# shellcheck source=lib/bash/rose_usage
42+
. rose_init
4143
rose_init
4244

4345
# Print actual command of a command alias
@@ -100,10 +102,11 @@ path_lead() {
100102

101103
# Print Rose version
102104
function print_version() {
103-
echo "Rose $ROSE_VERSION ($ROSE_HOME)"
105+
echo "Rose $ROSE_VERSION ($ROSE_HOME_BIN)"
104106
}
105107

106108
#-------------------------------------------------------------------------------
109+
# if "rose x" input then set UTIL=x
107110
UTIL="help"
108111
if (($# > 0)); then
109112
UTIL=$1
@@ -147,10 +150,8 @@ version|--version|-V)
147150
exit
148151
:;;
149152
doc)
150-
PATH=$(path_lead "${PATH:-}" "$ROSE_HOME_BIN")
151-
PYTHONPATH=$(path_lead "${PYTHONPATH:-}" "$ROSE_HOME/lib/python")
152153
ROSE_UTIL=$UTIL
153-
export PATH PYTHONPATH ROSE_UTIL
154+
export ROSE_UTIL
154155
ns_len=$(( ${#ROSE_NS}+2 ))
155156
for U in $(cd "$ROSE_HOME_BIN" && ls "$ROSE_NS-"*); do
156157
NAME="$(sed "s/^$ROSE_NS-\\(.*\\)\$/\1/" <<<"$U")"
@@ -185,8 +186,6 @@ if (($# > 0)) && [[ $1 == '--help' || $1 == '-h' ]]; then
185186
help_util "$UTIL"
186187
exit
187188
fi
188-
PATH=$(path_lead "${PATH:-}" "$ROSE_HOME_BIN")
189-
PYTHONPATH=$(path_lead "${PYTHONPATH:-}" "$ROSE_HOME/lib/python")
190189
ROSE_UTIL=$UTIL
191-
export PATH PYTHONPATH ROSE_UTIL
190+
export ROSE_UTIL
192191
exec "$COMMAND" "$@"

bin/rose-app-run

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@
8686
# optional ROSE_FILE_INSTALL_ROOT
8787
# If specified, change to the specified directory to install files.
8888
#-------------------------------------------------------------------------------
89-
exec python3 -m rose.app_run "$@"
89+
exec python3 -m metomi.rose.app_run "$@"

bin/rose-app-upgrade

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
# optional ROSE_META_PATH
4949
# Prepend `$ROSE_META_PATH` to the metadata search path.
5050
#-------------------------------------------------------------------------------
51-
exec python3 -m rose.upgrade "$@"
51+
exec python3 -m metomi.rose.upgrade "$@"

bin/rose-config

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@
9999
# optional ROSE_META_PATH
100100
# Prepend `$ROSE_META_PATH` to the metadata search path.
101101
#-------------------------------------------------------------------------------
102-
exec python3 -m rose.config_cli "$@"
102+
exec python3 -m metomi.rose.config_cli "$@"

bin/rose-config-diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@
114114
# rose config-diff --ignore=namelist:bar --ignore=namelist:baz ...
115115
#
116116
#-------------------------------------------------------------------------------
117-
exec python3 -m rose.config_diff "$@"
117+
exec python3 -m metomi.rose.config_diff "$@"

bin/rose-config-dump

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@
4747
# --quiet, -q
4848
# Decrement verbosity. Do not report modified files.
4949
#-------------------------------------------------------------------------------
50-
exec python3 -m rose.config_dump "$@"
50+
exec python3 -m metomi.rose.config_dump "$@"

bin/rose-config-edit

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@
7070
# optional ROSE_META_PATH
7171
# Prepend `$ROSE_META_PATH` to the metadata search path.
7272
#-------------------------------------------------------------------------------
73-
exec python3 -m rose.config_editor.main "$@"
73+
exec python3 -m metomi.rose.config_editor.main "$@"

bin/rose-date

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ PRINT FORMAT
177177
import sys
178178
import os
179179

180-
from isodatetime.main import main as iso_main
180+
from metomi.isodatetime.main import main as iso_main
181181

182182

183183
def main():

bin/rose-env-cat

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
# variable with the value of `STRING`, (which can be an empty string),
4949
# instead of failing.
5050
#-------------------------------------------------------------------------------
51-
exec python3 -m rose.env_cat "$@"
51+
exec python3 -m metomi.rose.env_cat "$@"

bin/rose-host-select

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@
9191
# Set the timeout in seconds of SSH commands to hosts.
9292
# (default=10.0)
9393
#-------------------------------------------------------------------------------
94-
exec python3 -m rose.host_select "$@"
94+
exec python3 -m metomi.rose.host_select "$@"

bin/rose-macro

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@
7676
# optional ROSE_META_PATH
7777
# Prepend `$ROSE_META_PATH` to the metadata search path.
7878
#-------------------------------------------------------------------------------
79-
exec python3 -m rose.macro "$@"
79+
exec python3 -m metomi.rose.macro "$@"

bin/rose-metadata-check

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
# metadata e.g.`env=FOO` or `namelist:bar`. If specified, only
4141
# this section will be checked.
4242
#-------------------------------------------------------------------------------
43-
exec python3 -m rose.metadata_check "$@"
43+
exec python3 -m metomi.rose.metadata_check "$@"

bin/rose-metadata-gen

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@
4646
# every setting e.g. `compulsory=true`. If `=VALUE` is missing,
4747
# the property will be set to a null string in each setting.
4848
#-------------------------------------------------------------------------------
49-
exec python3 -m rose.metadata_gen "$@"
49+
exec python3 -m metomi.rose.metadata_gen "$@"

bin/rose-metadata-graph

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@
5050
# optional ROSE_META_PATH
5151
# Prepend `$ROSE_META_PATH` to the metadata search path.
5252
#-------------------------------------------------------------------------------
53-
exec python3 -m rose.metadata_graph "$@"
53+
exec python3 -m metomi.rose.metadata_graph "$@"

bin/rose-mpi-launch

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@
111111
# DIAGNOSTICS
112112
# Return 0 on success, 1 or exit code of the launcher program on failure.
113113
#-------------------------------------------------------------------------------
114-
. "$(dirname "$0")/../lib/bash/rose_init"
114+
# shellcheck source=lib/bash/rose_init
115+
. rose_init
115116
rose_init rose_log
116117

117118
# ------------------------------------------------------------------------------

bin/rose-namelist-dump

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@
4545
# -u, --upper
4646
# Shorthand for `--case=upper`.
4747
#-------------------------------------------------------------------------------
48-
exec python3 -m rose.namelist_dump "$@"
48+
exec python3 -m metomi.rose.namelist_dump "$@"

bin/rose-stem

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@
8282
# is intended to specify the revision of `fcm-make` config files.
8383
#
8484
#-------------------------------------------------------------------------------
85-
exec python3 -m rose.stem "$@"
85+
exec python3 -m metomi.rose.stem "$@"

bin/rose-suite-clean

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@
5050
# Return the difference between the number of arguments and number of
5151
# successfully cleaned suites, i.e. 0 if all successful.
5252
#-------------------------------------------------------------------------------
53-
exec python3 -m rose.suite_clean "$@"
53+
exec python3 -m metomi.rose.suite_clean "$@"

bin/rose-suite-cmp-vc

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@
5050
# --verbose, -v
5151
# Increment verbosity.
5252
#-------------------------------------------------------------------------------
53-
exec python3 -m rose.cmp_source_vc "$@"
53+
exec python3 -m metomi.rose.cmp_source_vc "$@"

bin/rose-suite-hook

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@
5151
# --verbose, -v
5252
# Increment verbosity.
5353
#-------------------------------------------------------------------------------
54-
exec python3 -m rose.suite_hook "$@"
54+
exec python3 -m metomi.rose.suite_hook "$@"

bin/rose-suite-log

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@
6464
# --view
6565
# Launch web browser to view suite log.
6666
#-------------------------------------------------------------------------------
67-
exec python3 -m rose.suite_log "$@"
67+
exec python3 -m metomi.rose.suite_log "$@"

bin/rose-suite-restart

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@
5555
# --verbose, -v
5656
# Increment verbosity.
5757
#-------------------------------------------------------------------------------
58-
exec python3 -m rose.suite_restart "$@"
58+
exec python3 -m metomi.rose.suite_restart "$@"

bin/rose-suite-run

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@
129129
# * `cylc help register`
130130
# * `cylc help run`
131131
#-------------------------------------------------------------------------------
132-
exec python3 -m rose.suite_run "$@"
132+
exec python3 -m metomi.rose.suite_run "$@"

bin/rose-suite-shutdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@
5454
# See the cylc documentation, cylc shutdown for options and details on
5555
# `EXTRA-ARGS`.
5656
#-------------------------------------------------------------------------------
57-
exec python3 -m rose.suite_control shutdown "$@"
57+
exec python3 -m metomi.rose.suite_control shutdown "$@"

bin/rose-task-env

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@
140140
# `env-script = eval $(rose task-env)`.
141141
#
142142
#-------------------------------------------------------------------------------
143-
exec python3 -m rose.task_env "$@"
143+
exec python3 -m metomi.rose.task_env "$@"

bin/rose-task-run

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@
5454
# * `rose app-run`
5555
# * `rose task-env`
5656
#-------------------------------------------------------------------------------
57-
exec python3 -m rose.task_run "$@"
57+
exec python3 -m metomi.rose.task_run "$@"

bin/rose-tutorial

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
# Make a copy of one of the tutorial SUITE in the cylc-run directory.
3131
#
3232
#-------------------------------------------------------------------------------
33-
. "$(dirname "$0")/../lib/bash/rose_init"
33+
# shellcheck source=lib/bash/rose_init
34+
. rose_init
3435
mkdir -p "$HOME/cylc-run"
3536

3637
usage () {

bin/rosie-checkout

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
# --verbose, -v
3939
# Increment verbosity.
4040
#-------------------------------------------------------------------------------
41-
exec python3 -m rosie.vc checkout "$@"
41+
exec python3 -m metomi.rosie.vc checkout "$@"

bin/rosie-create

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@
7070
# --verbose, -v
7171
# Increment verbosity.
7272
#-------------------------------------------------------------------------------
73-
exec python3 -m rosie.vc create "$@"
73+
exec python3 -m metomi.rosie.vc create "$@"

bin/rosie-delete

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
# --verbose, -v
5050
# Increment verbosity.
5151
#-------------------------------------------------------------------------------
52-
exec python3 -m rosie.vc delete "$@"
52+
exec python3 -m metomi.rosie.vc delete "$@"

bin/rosie-disco

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
# --service-root, -R
3939
# (For start only.) Include web service name under root of URL.
4040
#-------------------------------------------------------------------------------
41-
exec python3 -m rosie.ws "$@"
41+
exec python3 -m metomi.rosie.ws "$@"

bin/rosie-go

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@
6767
# * `rosie lookup`
6868
# * `rosie ls`
6969
#-------------------------------------------------------------------------------
70-
exec python3 -m rosie.browser.main "$@"
70+
exec python3 -m metomi.rosie.browser.main "$@"
7171

0 commit comments

Comments
 (0)