seawolf2357 commited on
Commit
cd61108
·
verified ·
1 Parent(s): 0c779f6

Upload Makefile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Makefile +145 -0
Makefile ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ define ALL
2
+ update-requirements
3
+ install-jython
4
+ endef
5
+ ALL:=$(shell echo $(ALL)) # to remove line-feeds
6
+
7
+ define REQUIREMENTS_FILES
8
+ requirements/dev.txt
9
+ requirements/docs.txt
10
+ requirements/lint.txt
11
+ requirements/test.txt
12
+ requirements.txt
13
+ endef
14
+ REQUIREMENTS_FILES:=$(shell echo $(REQUIREMENTS_FILES))
15
+
16
+ define REQUIREMENTS_IN
17
+ requirements.in
18
+ endef
19
+ REQUIREMENTS_IN:=$(shell echo $(REQUIREMENTS_IN))
20
+
21
+ define REQUIREMENTS_IN_TEST
22
+ requirements/test.in
23
+ requirements.in
24
+ endef
25
+ REQUIREMENTS_IN_TEST:=$(shell echo $(REQUIREMENTS_IN_TEST))
26
+
27
+ define REQUIREMENTS_IN_LINT
28
+ requirements/lint.in
29
+ endef
30
+ REQUIREMENTS_IN_LINT:=$(shell echo $(REQUIREMENTS_IN_LINT))
31
+
32
+ define REQUIREMENTS_IN_DOCS
33
+ requirements/docs.in
34
+ endef
35
+ REQUIREMENTS_IN_DOCS:=$(shell echo $(REQUIREMENTS_IN_DOCS))
36
+
37
+ define REQUIREMENTS_IN_DEV
38
+ requirements/dev.in
39
+ requirements/docs.in
40
+ requirements/lint.in
41
+ requirements/test.in
42
+ requirements.in
43
+ endef
44
+ REQUIREMENTS_IN_DEV:=$(shell echo $(REQUIREMENTS_IN_DEV))
45
+
46
+ offline?=0
47
+
48
+ ifeq (1,$(offline))
49
+ PIP_NO_INDEX:=--no-index
50
+ endif
51
+
52
+ FIND_LINKS?=
53
+ VENV := . .venv/bin/activate &&
54
+
55
+
56
+ .PHONY: all
57
+ all: $(ALL)
58
+
59
+ .PHONY: bootstrap
60
+ bootstrap:
61
+ [ -e bin/activate ] || virtualenv -p python2.7 .
62
+ $(VENV) pip install -U setuptools pip wheel pip-tools
63
+ make update-requirements
64
+ $(VENV) buildout
65
+
66
+ .PHONY: update-requirements
67
+ update-requirements: $(REQUIREMENTS_FILES)
68
+ $(VENV) pip-sync $(FIND_LINKS) $(PIP_NO_INDEX) requirements/dev.txt
69
+
70
+ requirements.txt: $(REQUIREMENTS_IN)
71
+ $(VENV) pip-compile $(FIND_LINKS) $(PIP_NO_INDEX) $(pip-compile-options) -o $@ $^
72
+
73
+ requirements/test.txt: $(REQUIREMENTS_IN_TEST)
74
+ $(VENV) pip-compile $(FIND_LINKS) $(PIP_NO_INDEX) $(pip-compile-options) -o $@ $^
75
+
76
+ requirements/lint.txt: $(REQUIREMENTS_IN_LINT)
77
+ $(VENV) pip-compile $(FIND_LINKS) $(PIP_NO_INDEX) $(pip-compile-options) -o $@ $^
78
+
79
+ requirements/docs.txt: $(REQUIREMENTS_IN_DOCS)
80
+ $(VENV) pip-compile $(FIND_LINKS) $(PIP_NO_INDEX) $(pip-compile-options) -o $@ $^
81
+
82
+ requirements/dev.txt: $(REQUIREMENTS_IN_DEV)
83
+ $(VENV) pip-compile $(FIND_LINKS) $(PIP_NO_INDEX) $(pip-compile-options) -o $@ $^
84
+
85
+
86
+ .PHONY: extract-messages
87
+ extract-messages:
88
+ $(VENV) python setup.py extract_messages --input-paths=pyhwp/hwp5/proc --output-file=pyhwp/hwp5/locale/hwp5proc.pot
89
+ $(VENV) python setup.py extract_messages --input-paths=pyhwp/hwp5/hwp5html.py --output-file=pyhwp/hwp5/locale/hwp5html.pot
90
+ $(VENV) python setup.py extract_messages --input-paths=pyhwp/hwp5/hwp5odt.py --output-file=pyhwp/hwp5/locale/hwp5odt.pot
91
+ $(VENV) python setup.py extract_messages --input-paths=pyhwp/hwp5/hwp5txt.py --output-file=pyhwp/hwp5/locale/hwp5txt.pot
92
+ $(VENV) python setup.py extract_messages --input-paths=pyhwp/hwp5/hwp5view.py --output-file=pyhwp/hwp5/locale/hwp5view.pot
93
+
94
+ .PHONY: init-catalog
95
+ init-catalog:
96
+ $(VENV) python setup.py init_catalog --domain=hwp5proc --input-file=pyhwp/hwp5/locale/hwp5proc.pot --locale=ko
97
+ $(VENV) python setup.py init_catalog --domain=hwp5html --input-file=pyhwp/hwp5/locale/hwp5html.pot --locale=ko
98
+ $(VENV) python setup.py init_catalog --domain=hwp5odt --input-file=pyhwp/hwp5/locale/hwp5odt.pot --locale=ko
99
+ $(VENV) python setup.py init_catalog --domain=hwp5txt --input-file=pyhwp/hwp5/locale/hwp5txt.pot --locale=ko
100
+ $(VENV) python setup.py init_catalog --domain=hwp5view --input-file=pyhwp/hwp5/locale/hwp5view.pot --locale=ko
101
+
102
+ .PHONY: update-catalog
103
+ update-catalog:
104
+ $(VENV) python setup.py update_catalog --domain=hwp5proc --input-file=pyhwp/hwp5/locale/hwp5proc.pot
105
+ $(VENV) python setup.py update_catalog --domain=hwp5html --input-file=pyhwp/hwp5/locale/hwp5html.pot
106
+ $(VENV) python setup.py update_catalog --domain=hwp5odt --input-file=pyhwp/hwp5/locale/hwp5odt.pot
107
+ $(VENV) python setup.py update_catalog --domain=hwp5txt --input-file=pyhwp/hwp5/locale/hwp5txt.pot
108
+ $(VENV) python setup.py update_catalog --domain=hwp5view --input-file=pyhwp/hwp5/locale/hwp5view.pot
109
+
110
+ .PHONY: compile-catalog
111
+ compile-catalog:
112
+ $(VENV) python setup.py compile_catalog --domain=hwp5proc
113
+ $(VENV) python setup.py compile_catalog --domain=hwp5html
114
+ $(VENV) python setup.py compile_catalog --domain=hwp5odt
115
+ $(VENV) python setup.py compile_catalog --domain=hwp5txt
116
+ $(VENV) python setup.py compile_catalog --domain=hwp5view
117
+
118
+ .PHONY: notebook
119
+ notebook:
120
+ $(VENV) jupyter notebook --notebook-dir=notebooks
121
+
122
+
123
+ .PHONY: test
124
+ test:
125
+ $(VENV) tox --parallel 2 -e py27,py38
126
+
127
+ .PHONY: test-report
128
+ test-report:
129
+ $(VENV) coverage combine .tox/*/tmp
130
+ $(VENV) coverage report
131
+ $(VENV) coverage html
132
+ $(VENV) coverage xml
133
+
134
+ .PHONY: clitest
135
+ clitest:
136
+ $(VENV) env LANG=C clitest -1 --prefix 3 tests/cli_tests/hwp5proc.txt tests/cli_tests/hwp5odt.txt tests/cli_tests/hwp5html.txt tests/cli_tests/hwp5txt.txt
137
+
138
+
139
+ .PHONY: install-jython
140
+ install-jython: parts/jython2.7/bin/jython
141
+ parts/jython2.7/bin/jython:
142
+ rm -rf parts/jython2.7
143
+ mkdir -p parts
144
+ $(VIRTUAL_ENV)/bin/jip install org.python:jython-installer:2.7.1
145
+ java -jar $(VIRTUAL_ENV)/javalib/jython-installer-2.7.1.jar -s -d $(PWD)/parts/jython2.7