Debian Codegraph @

Makefile

raw ◀ ▶
1 Debian patch touch this file
1 # simple makefile to simplify repetitive build env management tasks under posix
2 # Ideas borrowed from scikit-learn's and PyMVPA Makefiles -- thanks!
3
•4 PYTHON ?= python3
5
6 MODULE ?= datalad
7
8 all: clean test
9
10 clean:
11 $(PYTHON) setup.py clean
12 rm -rf dist build bin
13 -find . -name '*.pyc' -delete
14 -find . -name '__pycache__' -type d -delete
15
16 bin:
17 mkdir -p $@
18 PYTHONPATH="bin:$(PYTHONPATH)" $(PYTHON) setup.py develop --install-dir $@
19
20 trailing-spaces:
21 find $(MODULE) -name "*.py" -exec perl -pi -e 's/[ \t]*$$//' {} \;
22
23 code-analysis:
24 flake8 $(MODULE) | grep -v __init__ | grep -v external
25 pylint -E -i y $(MODULE)/ # -d E1103,E0611,E1101
26
27 linkissues-changelog:
28 tools/link_issues_CHANGELOG
29
30 update-changelog: CHANGELOG.md
31 @echo ".. This file is auto-converted from CHANGELOG.md (make update-changelog) -- do not edit\n\nChange log\n**********" > docs/source/changelog.rst
32 # sphinx 3.4.3-2 on Debian incorrectly handles unicode character
33 # and then fails claiming that underlines are too short. So we remove all
34 # such problematic ones for now.
35 # Also, for some reason auto sticks subsections all the way to 4th level of sectioning,
36 # so we bring them back to 2nd.
37 # And pandoc manages to just skip all the valid markdown urls for authors within (),
38 # so doing manual post conversion
39 cat "$<" | sed -e 's,^#### ,## ,g' \
40 | iconv -c -f utf-8 -t ascii \
41 | grep -v '^<.*> *$$' \
42 | pandoc -t rst \
43 | sed -e 's,\[\(@[^]]*\)\](\([^)]*\)),\`\1 <\2>\`__,g' \
44 >> docs/source/changelog.rst
45
46
47 release-pypi: update-changelog
48 # avoid upload of stale builds
49 test ! -e dist
50 $(PYTHON) setup.py sdist
51 # the wheels we would produce are broken on windows, because they
52 # install an incompatible entrypoint script
53 # https://github.com/datalad/datalad/issues/4315
54 #$(PYTHON) setup.py bdist_wheel
55 twine upload dist/*
56
57 docs/source/basics_cmdline.rst.in: build/casts/cmdline_basic_usage.json
58 tools/cast2rst $^ > $@
59
60 docs/source/basics_nesteddatasets.rst.in: build/casts/seamless_nested_repos.json
61 tools/cast2rst $^ > $@