File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed
Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 4848 # add conda env's executables to github's PATH equiv.
4949 echo $CONDA/envs/fre-workflows/bin >> $GITHUB_PATH
5050
51+ - name : Check pre-configure plugin registered correctly
52+ run : |
53+ cylc long --version
54+ exit 1
55+
5156 - name : cylc lint workflow files
5257 run : |
5358 cylc lint -v
Original file line number Diff line number Diff line change 1+ from cylc .flow import LOG
2+ from pathlib import Path
3+ import yaml
4+
5+ def pre_configure (srcdir = None , opts = None , rundir = "/home/Dana.Singh/cylc-run" ):
6+ LOG .info ("PLUGIN OUTPUT" )
7+ LOG .info ("Hello world. How the heck are you?" )
8+
9+ yml_info = {}
10+ yaml_file = Path (f"{ srcdir } /resolved.yaml" )
11+ if yaml_file :
12+ yf = yaml_file #[0]
13+ with open (yf , 'r' ) as f :
14+ yml_info = yaml .safe_load (f )
15+
16+ LOG .info (yml_info )
17+ return {'template_variables' : yml_info ,
18+ 'templating_detected' : 'jinja2' }
19+
20+ ## want this script to accept resolved yaml and create everything needed to run workflow
21+ # - in dictionary format
22+ # - gets rid of rose-suite.conf
23+ # - removes dependency on cylc-rose...I think
24+
25+ ## questions/notes:
26+ # - can function in this script be anything? or does it need to be post_install to be recognized? (as a plugin type)
27+ # - I think it can be anything as long as its registered under one of the plugin types in setup.py
Original file line number Diff line number Diff line change 1+ # plugins must be properly installed, in-place PYTHONPATH meddling will not work.
2+
3+ from setuptools import setup
4+
5+ ## Register plugin
6+ setup (
7+ name = 'hello-world' ,
8+ version = '1.0' ,
9+ py_modules = ['hello_world' ], #name of file
10+ entry_points = {
11+ # group name: ["plugin_name = module:function"]
12+ 'cylc.pre_configure' : [
13+ 'hw = hello_world:pre_configure'
14+ ],
15+ }
16+ )
17+
You can’t perform that action at this time.
0 commit comments