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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/python3/python.mk
# Python default library and script directories
LIB3 := $(shell python3 -c "from setuptools.command.build import build ; from setuptools import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)")
SCRIPT3 := $(shell python3 -c "from setuptools.command.build import build ; from setuptools import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_scripts)")
%:
dh $@ --with sphinxdoc --buildsystem=pybuild
override_dh_auto_build:
# python module build
NO_SETUPTOOLS=1 python3 setup.py build
# we need this hack because we have to import "logilab.common.pytest"
# and for doc generation, but since it's a namespace package,
# we need to "simulate" it
touch $(CURDIR)/$(LIB3)/logilab/__init__.py
# build doc
cd docs ; PYTHONPATH=$(CURDIR) $(MAKE) html ; cd ..
# remove dummy file
rm -f $(CURDIR)/$(LIB3)/logilab/__init__.py
override_dh_auto_test:
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
# we need this hack because we have to import "logilab.common.pytest"
# and for doc generation, but since it's a namespace package,
# we need to "simulate" it
touch $(CURDIR)/$(LIB3)/logilab/__init__.py
# run tests
# use the default python version to select the script dir to run the tests
-PYTHONPATH=$(CURDIR)/ $(CURDIR)/$(SCRIPT3)/logilab-pytest -t $(CURDIR)/test
# remove dummy file
rm -f $(CURDIR)/$(LIB3)/logilab/__init__.py
endif
override_dh_auto_clean:
NO_SETUPTOOLS=1 python3 setup.py clean
find . -name "*.pyc" -delete
rm -rf docs/_build build/ .pybuild/
dh_auto_clean
override_dh_auto_install: build
NO_SETUPTOOLS=1 python3 setup.py install --no-compile \
--root=$(CURDIR)/debian/python3-logilab-common/ \
${py_setup_install_args}
# remove __pycache__ dirs
find $(CURDIR)/debian/python3-logilab-common -type d -name "__pycache__" | xargs rm -rf
# remove test directory
rm -rf debian/python3-logilab-common/usr/lib/python*/*-packages/logilab/common/test
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
override_dh_installdocs:
dh_installdocs README.rst docs/_build/html/
override_dh_compress:
dh_compress -X.py -X.ini -X.xml -Xtest/ -Xapidoc/
|