diff options
author | Kacper Kowalik <xarthisius@gentoo.org> | 2012-01-06 16:54:11 +0000 |
---|---|---|
committer | Kacper Kowalik <xarthisius@gentoo.org> | 2012-01-06 16:54:11 +0000 |
commit | a0e61b3c15b298b6398fc3ebc2dfec39e8700fdd (patch) | |
tree | a026a35ca4b8f7a7ae751443c456c9ca7e2ccd70 /dev-python/pyfits | |
parent | Marking tvtime-1.0.2_p20110131-r3 ppc for bug 385353 (diff) | |
download | gentoo-2-a0e61b3c15b298b6398fc3ebc2dfec39e8700fdd.tar.gz gentoo-2-a0e61b3c15b298b6398fc3ebc2dfec39e8700fdd.tar.bz2 gentoo-2-a0e61b3c15b298b6398fc3ebc2dfec39e8700fdd.zip |
Version bump with Python3 support. Claim for sci-astronomy
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/pyfits')
-rw-r--r-- | dev-python/pyfits/ChangeLog | 10 | ||||
-rw-r--r-- | dev-python/pyfits/files/pyfits-3.0.4-tests_python3.patch | 118 | ||||
-rw-r--r-- | dev-python/pyfits/metadata.xml | 1 | ||||
-rw-r--r-- | dev-python/pyfits/pyfits-3.0.4.ebuild | 39 |
4 files changed, 166 insertions, 2 deletions
diff --git a/dev-python/pyfits/ChangeLog b/dev-python/pyfits/ChangeLog index d251ee8a0746..114e849d0778 100644 --- a/dev-python/pyfits/ChangeLog +++ b/dev-python/pyfits/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-python/pyfits -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pyfits/ChangeLog,v 1.25 2011/03/22 10:54:02 arfrever Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pyfits/ChangeLog,v 1.26 2012/01/06 16:54:11 xarthisius Exp $ + +*pyfits-3.0.4 (06 Jan 2012) + + 06 Jan 2012; Kacper Kowalik <xarthisius@gentoo.org> + +files/pyfits-3.0.4-tests_python3.patch, +pyfits-3.0.4.ebuild, metadata.xml: + Version bump with Python3 support. Claim for sci-astronomy 22 Mar 2011; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> -pyfits-2.3.1.ebuild: diff --git a/dev-python/pyfits/files/pyfits-3.0.4-tests_python3.patch b/dev-python/pyfits/files/pyfits-3.0.4-tests_python3.patch new file mode 100644 index 000000000000..0138d5798f9a --- /dev/null +++ b/dev-python/pyfits/files/pyfits-3.0.4-tests_python3.patch @@ -0,0 +1,118 @@ +--- lib/pyfits/tests/test_division.py ++++ lib/pyfits/tests/test_division.py +@@ -1,7 +1,10 @@ + from __future__ import division # confidence high + from __future__ import with_statement + +-from cStringIO import StringIO ++try: ++ from cStringIO import StringIO ++except: ++ from io import StringIO + + import numpy as np + +--- lib/pyfits/tests/test_structured.py ++++ lib/pyfits/tests/test_structured.py +@@ -65,8 +65,8 @@ + st['f1'] = [1, 3, 5] + st['f2'] = ['hello', 'world', 'byebye'] + st['f3'] = np.random.random(st['f3'].shape) +- print st.dtype.descr +- print st ++ print(st.dtype.descr) ++ print(st) + + return st + +@@ -75,26 +75,26 @@ + def test_structured(self): + fname = self.data('stddata.fits') + +- print 'Reading from ', fname ++ print('Reading from ', fname) + data1, h1 = pyfits.getdata(fname, ext=1, header=True) + data2, h2 = pyfits.getdata(fname, ext=2, header=True) + + st = get_test_data() + + outfile = self.temp('test.fits') +- print 'Writing to file data1:', outfile ++ print('Writing to file data1:', outfile) + pyfits.writeto(outfile, data1, clobber=True) +- print 'Appending to file: data2', outfile ++ print('Appending to file: data2', outfile) + pyfits.append(outfile, data2) + +- print 'Appending to file: st', outfile ++ print('Appending to file: st', outfile) + pyfits.append(outfile, st) +- print st.dtype.descr +- print st ++ print(st.dtype.descr) ++ print(st) + assert st.dtype.isnative + assert np.all(st['f1'] == [1,3,5]) + +- print 'Reading data back' ++ print('Reading data back') + data1check, h1check = pyfits.getdata(outfile, ext=1, header=True) + data2check, h2check = pyfits.getdata(outfile, ext=2, header=True) + stcheck, sthcheck = pyfits.getdata(outfile, ext=3, header=True) +@@ -103,12 +103,12 @@ + raise ValueError('Fail') + if not compare_arrays(data2, data2check, verbose=True): + raise ValueError('Fail') +- print st, stcheck ++ print(st, stcheck) + if not compare_arrays(st, stcheck, verbose=True): + raise ValueError('Fail') + + # try reading with view +- print 'Reading with ndarray view' ++ print('Reading with ndarray view') + dataviewcheck, hviewcheck = pyfits.getdata(outfile, ext=2, header=True, + view=np.ndarray) + if not compare_arrays(data2, dataviewcheck, verbose=True): +--- lib/pyfits/tests/test_table.py ++++ lib/pyfits/tests/test_table.py +@@ -51,7 +51,7 @@ + nfieldsa = len(a.dtype.names) + nfieldsb = len(b.dtype.names) + if nfieldsa != nfieldsb: +- print "number of fields don't match" ++ print("number of fields don't match") + return False + for i in range(nfieldsa): + fielda = a.field(i) +@@ -63,21 +63,21 @@ + if (type(fielda) != type(fieldb) and not + (issubclass(type(fielda), type(fieldb)) or + issubclass(type(fieldb), type(fielda)))): +- print "type(fielda): ",type(fielda)," fielda: ",fielda +- print "type(fieldb): ",type(fieldb)," fieldb: ",fieldb +- print 'field %d type differs' % i ++ print("type(fielda): ",type(fielda)," fielda: ",fielda) ++ print("type(fieldb): ",type(fieldb)," fieldb: ",fieldb) ++ print('field %d type differs' % i) + return False + if isinstance(fielda[0], np.floating): + if not comparefloats(fielda, fieldb): +- print "fielda: ",fielda +- print "fieldb: ",fieldb +- print 'field %d differs' % i ++ print("fielda: ",fielda) ++ print("fieldb: ",fieldb) ++ print('field %d differs' % i) + return False + else: + if np.any(fielda != fieldb): +- print "fielda: ",fielda +- print "fieldb: ",fieldb +- print 'field %d differs' % i ++ print("fielda: ",fielda) ++ print("fieldb: ",fieldb) ++ print('field %d differs' % i) + return False + return True + diff --git a/dev-python/pyfits/metadata.xml b/dev-python/pyfits/metadata.xml index b44353fe734c..fa8abffa4853 100644 --- a/dev-python/pyfits/metadata.xml +++ b/dev-python/pyfits/metadata.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> +<herd>sci-astronomy</herd> <herd>python</herd> <longdescription lang="en"> PyFITS provides an interface to FITS formatted files under the diff --git a/dev-python/pyfits/pyfits-3.0.4.ebuild b/dev-python/pyfits/pyfits-3.0.4.ebuild new file mode 100644 index 000000000000..a4d84aa3fda5 --- /dev/null +++ b/dev-python/pyfits/pyfits-3.0.4.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pyfits/pyfits-3.0.4.ebuild,v 1.1 2012/01/06 16:54:11 xarthisius Exp $ + +EAPI=4 +SUPPORT_PYTHON_ABIS="1" +PYTHON_DEPEND="*:2.6" + +inherit distutils eutils + +DESCRIPTION="Provides an interface to FITS formatted files under python" +HOMEPAGE="http://www.stsci.edu/resources/software_hardware/pyfits http://pypi.python.org/pypi/pyfits" +SRC_URI="http://pypi.python.org/packages/source/p/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~x86-fbsd" +IUSE="test" + +RDEPEND="dev-python/numpy" +DEPEND="${RDEPEND} + test? ( dev-python/nose )" + +src_prepare() { + sed -e 's/Exception, e/Exception as e/g' \ + -i lib/pyfits/{hdu/base.py,_release.py,tests/test_core.py} || die + epatch "${FILESDIR}"/${P}-tests_python3.patch + distutils_src_prepare +} + +src_test() { + testing() { + local t + for t in lib/${PN}/tests/test_*.py; do + PYTHONPATH="$(ls -d build-${PYTHON_ABI}/lib*)" "$(PYTHON)" "${t}" || die "${t} failed with Python ${PYTHON_ABI}" + done + } + python_execute_function testing +} |