#!/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 distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)") SCRIPT3 := $(shell python3 -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_scripts)") %: dh $@ --with python3,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/