-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
40 lines (33 loc) · 963 Bytes
/
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
define exportdoc
import sys
from importlib import import_module
import pydoc
pydoc.isdata = lambda _: False
class MarkdownDoc(pydoc._PlainTextDoc):
def getdocloc(self, _):
return None
def docmodule(self, m):
m.__name__ += '\n\n'
return '\n'.join(super().docmodule(m).split('\n')[:-4])
renderer = MarkdownDoc()
for m in sys.argv[1:]:
print(renderer.docmodule(import_module(m)),
file=open(m + '.txt', 'w'))
endef
export exportdoc
doc:
@-mkdir docs
@path=$$(pwd); \
cd docs; \
PYTHONPATH=$$path:$$PYTHONPATH python3 -c "$$exportdoc" algnuth algnuth.polynom algnuth.quadratic algnuth.jacobi algnuth.ideals
pypi: dist
twine upload dist/*
dist: flake8
-rm dist/*
./setup.py bdist_wheel
clean:
rm -rf algnuth.egg-info build dist
flake8:
flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
.PHONY: doc dist