[SCM] Core functionality for performing astronomy and astrophysics with Python branch, debian, updated. 04b44774d026fb6fc32f95565d0bfa43e64fce85

Ole Streicher debian at liska.ath.cx
Wed Feb 20 14:40:10 UTC 2013


The following commit has been merged in the debian branch:
commit 04b44774d026fb6fc32f95565d0bfa43e64fce85
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Wed Feb 20 15:40:03 2013 +0100

    Provide python3 package

diff --git a/debian/control b/debian/control
index 0cdc1e1..55358dd 100644
--- a/debian/control
+++ b/debian/control
@@ -4,22 +4,28 @@ Priority: optional
 Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
 Uploaders: Ole Streicher <debian at liska.ath.cx>
 Build-Depends: cython,
-          debhelper (>= 9),
-          graphviz,
-          libcfitsio3-dev,
-          libexpat1-dev,
-          libsofa-c-dev,
-          pkg-config,
-          python-all-dev (>= 2.6.6-3~),
-          python-matplotlib,
-          python-nose,
-          python-numpy,
-          python-setuptools (>= 0.6.4),
-          python-sphinx (>= 1.0.7+dfsg),
-          python-support,
-          wcslib-dev (>= 4.7),
-          zlib1g-dev
+               debhelper (>= 9),
+               graphviz,
+               libcfitsio3-dev,
+               libexpat1-dev,
+               libsofa-c-dev,
+               pkg-config,
+               python-all-dev (>= 2.6.6-3~),
+               python-matplotlib,
+               python-nose,
+               python-numpy,
+               python-setuptools (>= 0.6.4),
+               python-sphinx (>= 1.0.7+dfsg),
+               python-support,
+               python3-all-dev,
+               python3-nose,
+               python3-numpy,
+               python3-setuptools (>= 0.6.4),
+               wcslib-dev (>= 4.7),
+               zlib1g-dev
 Standards-Version: 3.9.4
+X-Python-Version: >= 2.6
+X-Python3-Version: >= 3.2
 Homepage: http://astropy.org
 Vcs-Git: git://anonscm.debian.org/debian-science/packages/python-astropy.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/python-astropy.git
@@ -36,6 +42,18 @@ Description: Core functionality for performing astrophysics with Python
  .
  The current release is a developer preview.
 
+Package: python3-astropy
+Architecture: any
+Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends}
+Suggests: python-astropy-doc
+Description: Core functionality for performing astrophysics with Python3
+ The astropy package contains core functionality and some common tools
+ needed for performing astronomy and astrophysics research with Python3.
+ It is expected to be extended by a number of "affiliated packages" that are
+ intended to work with the core package.
+ .
+ The current release is a developer preview.
+
 Package: python-astropy-doc
 Architecture: all
 Section: doc
@@ -51,8 +69,8 @@ Description: Core functionality for performing astrophysics with Python (doc)
 Package: python-astropy-legacy
 Architecture: all
 Depends: python-astropy, ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
-Conflicts: python-pywcs, python-pyfits
-Provides: python-pywcs, python-pyfits, python-vo.table
+Conflicts: python-pyfits, python-pywcs
+Provides: python-pyfits, python-pywcs, python-vo.table
 Priority: extra
 Description: Astropy legacy modules for pyfits, pywcs, and vo.table
  The astropy package contains core functionality and some common tools
@@ -60,3 +78,16 @@ Description: Astropy legacy modules for pyfits, pywcs, and vo.table
  .
  This package is a wrapper that provides legacy packages for pyfits, pywcs,
  and vo.table for older applications.
+
+Package: python3-astropy-legacy
+Architecture: all
+Depends: python3-astropy, ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}
+Conflicts: python-pyfits, python-pywcs
+Provides: python3-pyfits, python3-pywcs, python3-vo.table
+Priority: extra
+Description: Astropy legacy modules for pyfits, pywcs, and vo.table (Python3)
+ The astropy package contains core functionality and some common tools
+ needed for performing astronomy and astrophysics research with Python3.
+ .
+ This package is a wrapper that provides legacy packages for pyfits, pywcs,
+ and vo.table for older applications.
diff --git a/debian/patches/fix_python3.patch b/debian/patches/fix_python3.patch
new file mode 100644
index 0000000..f95ae09
--- /dev/null
+++ b/debian/patches/fix_python3.patch
@@ -0,0 +1,14 @@
+Author: Ole Streicher <debian at liska.ath.cx>
+Description: Fix FTBS to build python3 package
+Bug: https://github.com/astropy/astropy/issues/799
+--- a/astropy/setup_helpers.py
++++ b/astropy/setup_helpers.py
+@@ -1307,7 +1307,7 @@ def pkg_config(packages, default_libraries, include_dirs, library_dirs,
+ 
+     try:
+         pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
+-        output = pipe.communicate()[0].strip()
++        output = pipe.communicate()[0].strip().decode()
+     except subprocess.CalledProcessError as e:
+         lines = [
+             "pkg-config failed.  This may cause the build to fail below.",
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..01c09fc
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix_python3.patch
diff --git a/debian/python-astropy-legacy.install b/debian/python-astropy-legacy.install
index bcd47b4..f421846 100644
--- a/debian/python-astropy-legacy.install
+++ b/debian/python-astropy-legacy.install
@@ -1,3 +1,3 @@
-usr/lib/python*/dist-packages/pyfits
-usr/lib/python*/dist-packages/pywcs
-usr/lib/python*/dist-packages/vo
+usr/lib/python2*/dist-packages/pyfits
+usr/lib/python2*/dist-packages/pywcs
+usr/lib/python2*/dist-packages/vo
diff --git a/debian/python-astropy.install b/debian/python-astropy.install
index 551af66..27f6a13 100644
--- a/debian/python-astropy.install
+++ b/debian/python-astropy.install
@@ -1 +1 @@
-usr/lib/python*/dist-packages/astropy*
+usr/lib/python2*/dist-packages/astropy*
diff --git a/debian/python3-astropy-legacy.install b/debian/python3-astropy-legacy.install
new file mode 100644
index 0000000..e022060
--- /dev/null
+++ b/debian/python3-astropy-legacy.install
@@ -0,0 +1,3 @@
+usr/lib/python3*/dist-packages/pyfits
+usr/lib/python3*/dist-packages/pywcs
+usr/lib/python3*/dist-packages/vo
diff --git a/debian/python3-astropy.install b/debian/python3-astropy.install
new file mode 100644
index 0000000..9d13fec
--- /dev/null
+++ b/debian/python3-astropy.install
@@ -0,0 +1 @@
+usr/lib/python3*/dist-packages/astropy*
diff --git a/debian/python-astropy.lintian-overrides b/debian/python3-astropy.lintian-overrides
similarity index 59%
copy from debian/python-astropy.lintian-overrides
copy to debian/python3-astropy.lintian-overrides
index 46dc32c..55ec2d3 100644
--- a/debian/python-astropy.lintian-overrides
+++ b/debian/python3-astropy.lintian-overrides
@@ -1,3 +1,3 @@
 # The hardening is switched on, but does not cover all functions mentioned
 # in hardening-check.
-hardening-no-fortify-functions */astropy/utils/xml/_iterparser.so
+hardening-no-fortify-functions */astropy/utils/xml/_iterparser.*
diff --git a/debian/rules b/debian/rules
index 232b4a6..0d3b043 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,14 +1,33 @@
 #!/usr/bin/make -f
 
+PYTHON2:=$(shell pyversions -vr)
+PYTHON3:=$(shell py3versions -vr)
+
+# Prevent setuptools/distribute from accessing the internet.
+export http_proxy = http://127.0.9.1:9
+
 %:
-	dh $@ --with python2,sphinxdoc
+	dh $@ --with python2,python3,sphinxdoc
+
+build-python%:
+	python$* setup.py build --use-system-libraries --enable-legacy
+
+# We need to build python2 first, since cython is currently only available for 
+# python2, and we need cython to (re-) generate some of the C files.
+override_dh_auto_build: $(PYTHON2:%=build-python%) $(PYTHON3:%=build-python%)
+	#dh_auto_build
 
-override_dh_auto_build:
-	dh_auto_build -- --use-system-libraries --enable-legacy
+install-python%:
+	python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb
+
+override_dh_auto_install: $(PYTHON3:%=install-python%)
+	dh_auto_install
+	rm -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/astropy/sphinx/themes/bootstrap-astropy/static/*.png
 
 override_dh_shlibdeps:
 	dh_shlibdeps
 	dh_numpy
+	dh_numpy3
 
 override_dh_installdocs-indep:
 	python setup.py build_sphinx
@@ -17,14 +36,17 @@ override_dh_installdocs-indep:
 override_dh_sphinxdoc-arch:
 	# sphinxdoc is only needed on indep and does not work here.
 
+override_dh_installchangelogs:
+	dh_installchangelogs docs/changelog.rst
+
 override_dh_auto_clean:
 	dh_auto_clean
 	rm -rf build astropy.egg-info
 	rm -rf docs/_build docs/_generated
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-override_dh_auto_test:
-	  for PYTHON in $(shell pyversions -r); do \
-	    $$PYTHON setup.py test || exit $$? ; \
-	  done
+test-python%:
+	python$* setup.py test -vv
+
+override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%)
 endif

-- 
Core functionality for performing astronomy and astrophysics with Python



More information about the debian-science-commits mailing list