-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
116 lines (85 loc) · 3.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
VERSION := $(shell cat omas/version)
all:
@echo 'OMAS $(VERSION) makefile help'
@echo ''
@echo ' - make test : run all regression tests'
@echo ' - make requirements : build requirements.txt'
@echo ' - make json : generate IMAS json structure files'
@echo ' - make docs : generate sphinx documentation and pushes it online'
@echo ' - make tag : tag git repository with omas/version and push'
@echo ' - make cocos : generate list of COCOS transformations'
@echo ' - make machines : format machine mappings files'
@echo ' - make release : all of the above, in order'
@echo ' - make pypi : upload to pypi'
@echo ' - make html : generate sphinx documentation'
@echo ' - make examples : generate sphinx documentation with examples'
@echo ' - make samples : generate sample files'
@echo ' - make omfit : scan OMFIT to_omas and from_omas for documentation'
@echo ' - make format : format source using black'
@echo ' - make site-packages : pip install requirements in site-packages folder'
@echo ''
TEST_FLAGS=-s omas/tests -v -f
test:
python3 -m unittest discover --pattern="*.py" ${TEST_FLAGS}
test_core:
python3 -m unittest discover --pattern="*_core.py" ${TEST_FLAGS}
test_plot:
python3 -m unittest discover --pattern="*_plot.py" ${TEST_FLAGS}
test_physics:
python3 -m unittest discover --pattern="*_physics.py" ${TEST_FLAGS}
test_machine:
python3 -m unittest discover --pattern="*_machine.py" ${TEST_FLAGS}
test_utils:
python3 -m unittest discover --pattern="*_utils.py" ${TEST_FLAGS}
test_examples:
python3 -m unittest discover --pattern="*_examples.py" ${TEST_FLAGS}
test_suite:
python3 -m unittest discover --pattern="*_suite.py" ${TEST_FLAGS}
test_no_munittest:
omas/tests/run_tests.sh
requirements:
rm -f requirements.txt
python3 setup.py --name
omfit:
cd omas/utilities && python3 generate_to_from_omas.py
html:
cd sphinx && make html
examples:
cd sphinx && make examples
samples:
cd omas/utilities && python3 generate_ods_samples.py
docs: html
cd sphinx && make commit && make push
json:
cd omas/utilities && python3 build_json_structures.py
make cocos
cocos: symbols
cd omas/utilities && python3 generate_cocos_signals.py
machines:
cd omas/utilities && python3 format_machine_mappings.py
symbols:
cd omas/utilities && python3 sort_symbols.py
tag:
git tag -a v$(VERSION) $$(git log --pretty=format:"%h" --grep="^version $(VERSION)") -m "version $(VERSION)"
git push --tags
sdist:
rm -rf dist
python3 setup.py sdist
pypi: sdist
python3 -m twine upload --repository pypi dist/omas-$(VERSION).tar.gz
testpypi:
python3 -m twine upload --repository testpypi dist/omas-$(VERSION).tar.gz
@echo install with:
@echo pip install --index-url https://test.pypi.org/simple/ omas
hash:
pip hash dist/omas-$(VERSION).tar.gz
release: test requirements json cocos docs tag
@echo 'Make release done'
fmt:
black -S -l 140 .
format:fmt cocos machines
.PHONY: site-packages
site-packages:
pip install --upgrade --target ./site-packages -r requirements.txt
@echo "for TCSH: setenv PYTHONPATH $$PWD/site-packages:\$$PYTHONPATH"
@echo "for BASH: export PYTHONPATH=$$PWD/site-packages:\$$PYTHONPATH"