Skip to content

Commit dc6a4ba

Browse files
committed
debug
1 parent 0dbbd94 commit dc6a4ba

File tree

4 files changed

+31
-13
lines changed

4 files changed

+31
-13
lines changed

.github/workflows/check-and-publish.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/checkout@v2
1919
- run: pip install black flake8 isort
2020
- run: black --version
21-
- run: isort --check --profile=black .
21+
- run: isort --check .
2222
- run: black --check .
2323
- run: flake8 .
2424

@@ -64,11 +64,13 @@ jobs:
6464
name: Install ecmwflibs
6565
run: pip install ecmwflibs
6666

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
7274
env:
7375
MAGICS_PYTHON_TESTS: magics-test/test/gallery
7476

Magics/Magics.py

+8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ class FILE(ctypes.Structure):
3434

3535
FILE_p = ctypes.POINTER(FILE)
3636

37+
38+
####################################################################
39+
40+
41+
def get_library_path():
42+
return lib
43+
44+
3745
####################################################################
3846

3947

Magics/__main__.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@
1717
import argparse
1818

1919

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+
2029
def main(argv=None):
2130
parser = argparse.ArgumentParser()
2231
parser.add_argument("command", help="Supported commands: selfcheck.")
2332
args = parser.parse_args(args=argv)
2433
if args.command == "selfcheck":
25-
from . import macro
26-
27-
print("Found: Magics %r." % macro.version())
28-
print("Your system is ready.")
34+
selfcheck()
2935
else:
3036
raise RuntimeError(
3137
"Command not recognised %r. See usage with --help." % args.command

Magics/macro.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,10 @@ def examine(*args):
557557

558558

559559
def _execute(o):
560-
if isinstance(o, list) or isinstance(o, tuple):
560+
if isinstance(o, (list, tuple)):
561561
for x in o:
562562
_execute(x)
563-
564563
else:
565-
566564
o.execute()
567565

568566

@@ -772,3 +770,7 @@ def wmscrs():
772770
"n_lat": 90.0,
773771
},
774772
}
773+
774+
775+
def get_library_path():
776+
return Magics.get_library_path()

0 commit comments

Comments
 (0)