]> git.k1024.org Git - debian-pylibacl.git/blob - Makefile
Remove dbg package and prepare upload
[debian-pylibacl.git] / Makefile
1 PYTHON        = python3
2 SPHINXOPTS    = -W
3 SPHINXBUILD   = $(PYTHON) -m sphinx
4 DOCDIR        = doc
5 DOCHTML       = $(DOCDIR)/html
6 DOCTREES      = $(DOCDIR)/doctrees
7 ALLSPHINXOPTS = -d $(DOCTREES) $(SPHINXOPTS) $(DOCDIR)
8 VERSION       = 0.6.0
9 FULLVER       = pylibacl-$(VERSION)
10 DISTFILE      = $(FULLVER).tar.gz
11
12 MODNAME = posix1e.so
13 RSTFILES = doc/index.rst doc/module.rst doc/news.rst doc/readme.md doc/conf.py
14
15 all: doc test
16
17 $(MODNAME): acl.c
18         $(PYTHON) ./setup.py build_ext --inplace
19
20 $(DOCHTML)/index.html: $(MODNAME) $(RSTFILES) acl.c
21         $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCHTML)
22         touch $@
23
24 doc: $(DOCHTML)/index.html
25
26 doc/readme.md: README.md
27         ln -s ../README.md doc/readme.md
28
29 doc/news.rst: NEWS
30         ln -s ../NEWS doc/news.rst
31
32 dist:
33         fakeroot $(PYTHON) ./setup.py sdist
34
35 distcheck: dist
36         set -e; \
37         TDIR=$$(mktemp -d) && \
38         trap "rm -rf $$TDIR" EXIT; \
39         tar xzf dist/$(DISTFILE) -C $$TDIR && \
40         (cd $$TDIR/$(FULLVER) && make doc && make test && make dist) && \
41         echo "All good, you can upload $(DISTFILE)!"
42
43 test:
44         @set -e; \
45         for ver in 3.4 3.5 3.6 3.7 3.8 3.9; do \
46           for flavour in "" "-dbg"; do \
47             if type python$$ver$$flavour >/dev/null; then \
48               echo Testing with python$$ver$$flavour; \
49               python$$ver$$flavour ./setup.py build_ext -i; \
50               python$$ver$$flavour -m pytest tests ;\
51             fi; \
52           done; \
53         done; \
54         for pp in pypy3; do \
55           if type $$pp >/dev/null; then \
56             echo Testing with $$pp; \
57             $$pp ./setup.py build_ext -i; \
58             $$pp -m pytest tests; \
59           fi; \
60         done
61
62 fast-test:
63         python3 setup.py build_ext -i
64         python3 -m pytest tests
65
66 ci:
67         while inotifywait -e CLOSE_WRITE tests/test_*.py; do \
68           python3 -m pytest tests; \
69         done
70
71 coverage:
72         $(MAKE) clean
73         $(MAKE) test CFLAGS="-coverage"
74         lcov --capture --no-external --directory . --output-file coverage.info
75         genhtml coverage.info --output-directory out
76
77 clean:
78         rm -rf $(DOCHTML) $(DOCTREES)
79         rm -f doc/readme.md doc/news.rst
80         rm -f $(MODNAME)
81         rm -f *.so
82         rm -rf build
83
84 types:
85         MYPYPATH=. mypy --check-untyped-defs --warn-incomplete-stub tests/test_acls.py
86
87 .PHONY: doc test clean dist coverage ci types