[statsmodels] 01/21: Convert to using pybuild.

Diane Trout diane at moszumanska.debian.org
Mon Sep 25 06:39:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

diane pushed a commit to branch detrout-python3-try2
in repository statsmodels.

commit 1ed8d80cda5922b9e995cbcae8758f571ebd0bd1
Author: Diane Trout <diane at ghic.org>
Date:   Thu Sep 7 22:55:38 2017 -0700

    Convert to using pybuild.
    
    This simplifies building cython files for both python 2 & 3.
    Though we still have to jump through hoops to move the .so files
---
 debian/rules | 61 +++++++-----------------------------------------------------
 1 file changed, 7 insertions(+), 54 deletions(-)

diff --git a/debian/rules b/debian/rules
index ad59f6e..0881063 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,28 +6,12 @@
 export HOME=$(CURDIR)/build
 export MPLCONFIGDIR=$(HOME)
 
-PACKAGE_NAME = python-statsmodels
-PACKAGE_ROOT_DIR = debian/${PACKAGE_NAME}
-
-PYVERS = $(shell pyversions -vr)
-PYVER = $(shell pyversions -vd)
-
-UVER := $(shell LC_ALL=C dpkg-parsechangelog | awk '/^Version:/{print $$2;}' | sed -e 's,-[^-]*$$,,g')
-CYTHONVER := $(shell dpkg -l cython | awk '/^ii/{print $$3;}' || echo 0)
-MPLVER := $(shell dpkg -l python-matplotlib | awk '/^ii/{print $$3;}' || echo 0)
-IPYTHONVER := $(shell ipython -V || echo 0) # 0.12 is needed to build docs, otherwise use IPython01x
-IPYTHONPATH := $(shell dpkg --compare-versions $(IPYTHONVER) lt 0.13 \
-				 && echo ":/usr/lib/python$(PYVER)/dist-packages/IPython01X" || echo '')
-
-MIN_CYTHONVER = 0.19
-
-ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
-export OPT+=-g -O0
-endif
+export PYBUILD_NAME=statsmodels
+export PYBUILD_INSTALL_ARGS=--install-layout=deb
+export PYBUILD_TEST_ARGS=--exclude='(test_sarimax)|(test_structural)|(test_dynamic_factor)|(test_varmax)'
 
 %:
-	dh  $@ --with python2,python3
-
+	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
 
 cythonize:
 	find statsmodels -iname *.pyx | sed -e 's,\.pyx,\.c,g' | xargs -r rm -f
@@ -36,20 +20,9 @@ cythonize:
 	mkdir -p debian/cythonized-files
 	cp $$(find statsmodels -iname *.pyx | sed -e 's,\.pyx,\.c,g') debian/cythonized-files
 	echo "$(UVER)" >| debian/cythonized-files/VERSION
-
-
-override_dh_auto_configure:
-	dpkg --compare-versions $(CYTHONVER) lt $(MIN_CYTHONVER) && { \
-		echo "I: Using pre-Cython-ed files"; \
-		find -iname *pyx | while read p; do \
-		  f=$$(basename $$p); f=$${f%%.pyx}; d=$$(dirname $$p); \
-		  cp -rp debian/cythonized-files/$$f.c $$d/; done; } || :
-	dh_auto_configure
-
-
-override_dh_auto_test:
-	: # overriden since testing happens against installed version across
-	: # all supported python versions
+ifeq (,$(filter nocheck,$(DEB_BUILD_PROFILES)))
+.PHONY: override_dh_auto_test
+endif
 
 # To guarantee HOME existence with mpl 1.3.0
 # See https://github.com/matplotlib/matplotlib/issues/2300
@@ -87,26 +60,6 @@ override_dh_clean:
 	: # Remove autogenerated version.py
 	rm -f statsmodels/version.py
 
-override_dh_auto_install-arch: ${PYVERS:%=python-install%} ${PYVERS:%=python-test%}
-
-override_dh_auto_install-indep:
-
-# Per Python version logic -- install, test, move .so into -lib
-python-install%:
-	python$* setup.py install --install-layout=deb --root=$(PACKAGE_ROOT_DIR)
-
-python-test%: python-install%
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-	: # Run unittests here against installed statsmodels
-	cd build/ && \
-	 PYTHONPATH=`/bin/ls -d $(CURDIR)/$(PACKAGE_ROOT_DIR)/usr/lib/python$*/*/` \
-	 MPLCONFIGDIR=$(CURDIR)/build \
-	 python$* /usr/bin/nosetests -s -v --exclude=sandbox --exclude=test_plot_month statsmodels
-else
-	: # Skip unittests due to nocheck
-endif
-
-
 override_dh_install:
 	dh_install
 	: # Remove compiled due to testing files

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/statsmodels.git



More information about the debian-science-commits mailing list