[pyfits] Added compatibility setup.py to avoid using d2to1 package Added a dependency on 2to3
Sergio Pascual
sergiopr at fedoraproject.org
Fri Jan 20 23:49:04 UTC 2012
commit 15b4292583872f341e929015fa982f04024ed755
Author: Pasrario <harenawer at zoho.com>
Date: Sat Jan 21 00:48:39 2012 +0100
Added compatibility setup.py to avoid using d2to1 package
Added a dependency on 2to3
pyfits-compat-setup.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++
pyfits.spec | 14 ++++++++++----
2 files changed, 56 insertions(+), 4 deletions(-)
---
diff --git a/pyfits-compat-setup.py b/pyfits-compat-setup.py
new file mode 100644
index 0000000..646f4b2
--- /dev/null
+++ b/pyfits-compat-setup.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+#from setuptools import setup, Extension
+from distutils.core import setup, Extension
+
+import numpy
+numpy_include = numpy.get_include()
+
+comp = Extension('pyfits.compression', [
+ 'src/compress.c',
+ 'src/fits_hcompress.c',
+ 'src/fits_hdecompress.c',
+ 'src/fitsio.c',
+ 'src/pliocomp.c',
+ 'src/compressionmodule.c',
+ 'src/quantize.c',
+ 'src/ricecomp.c',
+ 'src/zlib.c',
+ 'src/inffast.c',
+ 'src/inftrees.c',
+ 'src/trees.c'
+ ],
+ include_dirs=[numpy_include])
+
+setup(name='pyfits',
+ version='3.0.1',
+ author= 'J. C. Hsu, Paul Barrett, Christopher Hanley, James Taylor, Michael Droettboom, Erik Bray',
+ author_email='help at stsci.edu',
+ description='Reads FITS images and tables into numpy or numarray objects and manipulates FITS headers',
+ url='http://www.stsci.edu/resources/software_hardware/pyfits',
+ classifiers=[
+ "Intended Audience :: Science/Research",
+ "License :: OSI Approved :: BSD License",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Topic :: Scientific/Engineering :: Astronomy",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ ],
+ package_dir={'': 'lib'},
+ packages=['pyfits', 'pyfits.hdu', 'pyfits.tests'],
+ ext_modules=[comp],
+ package_data={"pyfits.tests": ["data/*.fits"]},
+ scripts=['scripts/fitscheck'],
+ )
+
diff --git a/pyfits.spec b/pyfits.spec
index f5b4bb5..581adcc 100644
--- a/pyfits.spec
+++ b/pyfits.spec
@@ -6,7 +6,7 @@
Name: pyfits
Version: 3.0.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Python interface to FITS
Group: Development/Languages
@@ -14,16 +14,16 @@ License: BSD
URL: http://www.stsci.edu/resources/software_hardware/pyfits
Source0: http://pypi.python.org/packages/source/p/pyfits/%{name}-%{version}.tar.gz
+Source1: pyfits-compat-setup.py
BuildRequires: python2-devel python-setuptools numpy
Requires: numpy
%if 0%{?with_python3}
-BuildRequires: python3-devel python3-numpy python3-setuptools
+BuildRequires: python3-devel python3-numpy python3-setuptools /usr/bin/2to3
Requires: python3-numpy
%endif # with_python3
-
# we don't want to provide private python extension libs
%{?filter_setup:
%filter_provides_in %{python_sitearch}/.*\.so$
@@ -48,11 +48,14 @@ writing analysis scripts in Python using FITS files as either input or output.
%prep
%setup -q
sed -i -e "1d" lib/pyfits/core.py
+rm -f setup.py setup.cfg
+cp %SOURCE1 setup.py
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+2to3 --write --nobackup %{py3dir}
%endif # with_python3
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
@@ -79,7 +82,6 @@ popd
chmod 755 %{buildroot}%{python_sitearch}/pyfits/compression.so
%files
-%defattr(-,root,root,-)
%doc LICENSE.txt CHANGES.txt
%{_bindir}/fitscheck
%{python_sitearch}/*
@@ -93,6 +95,10 @@ chmod 755 %{buildroot}%{python_sitearch}/pyfits/compression.so
%endif # with_python3
%changelog
+* Fri Jan 20 2012 Sergio Pascual <sergiopr at fedoraproject.org> - 3.0.1-3
+- Added compatibility setup.py to avoid using d2to1 package
+- Added a dependency on 2to3
+
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list