File tree 4 files changed +31
-13
lines changed
4 files changed +31
-13
lines changed Original file line number Diff line number Diff line change 18
18
- uses : actions/checkout@v2
19
19
- run : pip install black flake8 isort
20
20
- run : black --version
21
- - run : isort --check --profile=black .
21
+ - run : isort --check .
22
22
- run : black --check .
23
23
- run : flake8 .
24
24
@@ -64,11 +64,13 @@ jobs:
64
64
name : Install ecmwflibs
65
65
run : pip install ecmwflibs
66
66
67
- - name : Tests
68
- run : |
69
- python setup.py develop
70
- pip install -r tests/requirements.txt
71
- pytest
67
+ - run : python setup.py develop
68
+ - run : pip install -r tests/requirements.txt
69
+ - run : pip freeze
70
+ - run : env | sort
71
+ - run : python -m Magics selfcheck
72
+
73
+ - run : pytest
72
74
env :
73
75
MAGICS_PYTHON_TESTS : magics-test/test/gallery
74
76
Original file line number Diff line number Diff line change @@ -34,6 +34,14 @@ class FILE(ctypes.Structure):
34
34
35
35
FILE_p = ctypes .POINTER (FILE )
36
36
37
+
38
+ ####################################################################
39
+
40
+
41
+ def get_library_path ():
42
+ return lib
43
+
44
+
37
45
####################################################################
38
46
39
47
Original file line number Diff line number Diff line change 17
17
import argparse
18
18
19
19
20
+ def selfcheck ():
21
+ from . import Magics
22
+
23
+ print ("Found: Magics %r." % Magics .version ().decode ())
24
+ print ("Library:" , Magics .get_library_path ())
25
+ print ("Magics home:" , Magics .home ().decode ())
26
+ print ("Your system is ready." )
27
+
28
+
20
29
def main (argv = None ):
21
30
parser = argparse .ArgumentParser ()
22
31
parser .add_argument ("command" , help = "Supported commands: selfcheck." )
23
32
args = parser .parse_args (args = argv )
24
33
if args .command == "selfcheck" :
25
- from . import macro
26
-
27
- print ("Found: Magics %r." % macro .version ())
28
- print ("Your system is ready." )
34
+ selfcheck ()
29
35
else :
30
36
raise RuntimeError (
31
37
"Command not recognised %r. See usage with --help." % args .command
Original file line number Diff line number Diff line change @@ -557,12 +557,10 @@ def examine(*args):
557
557
558
558
559
559
def _execute (o ):
560
- if isinstance (o , list ) or isinstance ( o , tuple ):
560
+ if isinstance (o , ( list , tuple ) ):
561
561
for x in o :
562
562
_execute (x )
563
-
564
563
else :
565
-
566
564
o .execute ()
567
565
568
566
@@ -772,3 +770,7 @@ def wmscrs():
772
770
"n_lat" : 90.0 ,
773
771
},
774
772
}
773
+
774
+
775
+ def get_library_path ():
776
+ return Magics .get_library_path ()
You can’t perform that action at this time.
0 commit comments