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
|
#!/usr/bin/make -f
# See https://wiki.debian.org/Python/LibraryStyleGuide.
%:
dh $@ --with=python2,python3,sphinxdoc
# ptk/async_*.py files contain the "async def" syntax, causing a
# compilation error for versions << 3.5.
PYBUILD_TARGETS := $(addprefix override_dh_auto_,configure build test install)
.PHONY: $(PYBUILD_TARGETS)
$(PYBUILD_TARGETS): override_dh_auto_%:
mv ptk/async_*.py debian
pybuild --$* --name=ptk --pyver="`pyversions -vr`" $(PYBUILD_ARGS)
mv debian/async_*.py ptk
pybuild --$* --name=ptk --pyver="`py3versions -vr`" $(PYBUILD_ARGS)
# README.rst and html are also mentioned in python-ptk-doc.doc*.
override_dh_auto_build: README.rst html
README.rst:
$(MAKE) prepare
# Forbid internet access.
# Select Python3, able to parse async def in imported Python modules.
html:
https_proxy=127.0.0.1:9 \
PYTHONPATH=. http_proxy='127.0.0.1:9' $(MAKE) documentation \
SPHINXBUILD=/usr/share/sphinx/scripts/python3/sphinx-build
# Discover requires an explicit start-directory to find anything.
# Only run test_all.py, which skips twisted if it is not installed.
override_dh_auto_test: PYBUILD_ARGS := \
"--test-args=--start-directory=tests --pattern=test_all.py"
# Avoid pybuild when cleaning, as it creates subdirectories.
.PHONY: override_dh_auto_clean
override_dh_auto_clean:
rm -fr .pybuild doc/build html
find . -name '*.pyc' -delete
rm -f README.rst
|