forked from napalm-automation/napalm-yang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (63 loc) · 1.92 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
PYBINDPLUGIN=$(shell /usr/bin/env python -c 'import pyangbind; import os; print("{}/plugin".format(os.path.dirname(pyangbind.__file__)))')
MODELS_PATH=napalm_yang/models
YANG_OC=yang_oc/release/models
YANG_IETF=yang_ietf/standard/ietf
YANG_NAPALM=yang_napalm
PYANGBIND=pyang --plugindir $(PYBINDPLUGIN) -f pybind --lax-quote-checks
clean:
find $(MODELS_PATH)/* -d -type d -exec rm -rf '{}' \;
.PHONY: openconfig_tree
openconfig_tree:
pyang -f tree \
--path $(YANG_OC) \
-f tree \
$(YANG_OC)/network-instance/openconfig-network-instance.yang
.PHONY: models_openconfig
models_openconfig:
rm -rf $(MODELS_PATH)/openconfig/
$(PYANGBIND) \
--path $(YANG_OC) \
--split-class-dir=$(MODELS_PATH)/openconfig/ \
$(YANG_OC)/network-instance/openconfig-network-instance.yang \
$(YANG_OC)/interfaces/*.yang \
$(YANG_OC)/platform/*.yang \
$(YANG_OC)/vlan/*.yang \
$(YANG_OC)/system/*.yang \
$(YANG_NAPALM)/interfaces/*.yang
# .PHONY: models_ietf
# models_ietf:
# rm -rf $(MODELS_PATH)/ietf/
# $(PYANGBIND) \
# --path $(YANG_IETF)/RFC \
# --path $(YANG_IETF)/DRAFT \
# --split-class-dir=$(MODELS_PATH)/ietf/ \
# $(YANG_IETF)/RFC/ietf-yang-types.yang \
# $(YANG_IETF)/RFC/ietf-interfaces@2014-05-08.yang \
# $(YANG_IETF)/RFC/ietf-routing@2016-11-04.yang \
# $(YANG_IETF)/DRAFT/ietf-pim*
.PHONY: submodule
submodule:
git submodule update --init --recursive
.PHONY: templates
templates:
rm -rf napalm_yang/mappings/dummy/
python generate_templates.py
.PHONY: tests
tests:
pytest
.PHONY: test_black
test_black:
find . \
-not -path "./.tox*" \
-not -path "./napalm_yang/models*" \
-not -path "./napalm_yang/mappings*" \
-not -path "./yang_ietf*" \
-not -path "./yang_oc*" \
-name "*.py" \
-exec black --check {} \+
.PHONY: test_sphinx
test_sphinx:
sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
.PHONY: test_pylama
test_pylama:
pylama .