3 SPHINXBUILD = $(PYTHON) -m sphinx
5 DOCHTML = $(DOCDIR)/html
6 DOCTREES = $(DOCDIR)/doctrees
7 ALLSPHINXOPTS = -d $(DOCTREES) $(SPHINXOPTS) $(DOCDIR)
9 FULLVER = pylibacl-$(VERSION)
10 DISTFILE = $(FULLVER).tar.gz
13 RSTFILES = doc/index.rst doc/module.rst doc/news.rst doc/readme.md doc/conf.py
18 $(PYTHON) ./setup.py build_ext --inplace
20 $(DOCHTML)/index.html: $(MODNAME) $(RSTFILES) acl.c
21 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCHTML)
24 doc: $(DOCHTML)/index.html
26 doc/readme.md: README.md
27 ln -s ../README.md doc/readme.md
30 ln -s ../NEWS doc/news.rst
33 fakeroot $(PYTHON) ./setup.py sdist
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)!"
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 ;\
55 if type $$pp >/dev/null; then \
56 echo Testing with $$pp; \
57 $$pp ./setup.py build_ext -i; \
58 $$pp -m pytest tests; \
63 python3 setup.py build_ext -i
64 python3 -m pytest tests
67 while inotifywait -e CLOSE_WRITE tests/test_*.py; do \
68 python3 -m pytest tests; \
73 $(MAKE) test CFLAGS="-coverage"
74 lcov --capture --no-external --directory . --output-file coverage.info
75 genhtml coverage.info --output-directory out
78 rm -rf $(DOCHTML) $(DOCTREES)
79 rm -f doc/readme.md doc/news.rst
85 MYPYPATH=. mypy --check-untyped-defs --warn-incomplete-stub tests/test_acls.py
87 .PHONY: doc test clean dist coverage ci types