%global upname patsy
%global with_python3 1
Name: python-%{upname}
Version: 0.4.1
Release: 1%{?dist}
Summary: Describing statistical models in Python using symbolic formulas
Group: Development/Languages
# All code is under BSD except patsy.compat that is under Python
# See LICENSE.txt for details
License: BSD and Python
URL: https://github.com/pydata/patsy
Source0: https://pypi.python.org/packages/source/p/patsy/patsy-%{version}.zip
BuildArch: noarch
BuildRequires: python2-devel python-nose
BuildRequires: python-six
# For the docs
BuildRequires: python-sphinx
BuildRequires: python-ipython-sphinx
BuildRequires: numpy
# For splines
BuildRequires: scipy
BuildRequires: python-pandas
Requires: numpy scipy python-pandas
Requires: python-six
# New python guidelines
Provides: python2-%{upname}
%description
A Python package for describing statistical models and for building design
matrices. It is closely inspired by and compatible with the 'formula'
mini-language used in R and S.
%package doc
Summary: Documentation for %{name}, includes full API docs
BuildArch: noarch
%description doc
This package contains the full API documentation for %{name}.
%if 0%{?with_python3}
%package -n python3-%{upname}
Summary: Describing statistical models in Python using symbolic formulas
BuildRequires: python3-devel
BuildRequires: python3-six
BuildRequires: python3-numpy python3-scipy python3-pandas
BuildRequires: python3-nose
# For the docs
BuildRequires: python3-sphinx
BuildRequires: python3-ipython-sphinx
Requires: python3-numpy python3-scipy python3-pandas
Requires: python3-six
%description -n python3-%{upname}
A Python package for describing statistical models and for building design
matrices. It is closely inspired by and compatible with the 'formula'
mini-language used in R and S.
%package -n python3-%{upname}-doc
Summary: Documentation for %{name}, includes full API docs
BuildArch: noarch
%description -n python3-%{upname}-doc
This package contains the full API documentation for %{name}.
%endif # with_python3
%prep
%setup -q -n %{upname}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%endif # with_python3
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
%build
%{__python2} setup.py build
%{__python2} setup.py build_sphinx
rm -f build/sphinx/html/.buildinfo
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
# Creating the docs with python3-sphinx doesn't work
#%{__python3} setup.py build_sphinx
popd
%endif # with_python3
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3
%{__python2} setup.py install --root %{buildroot}
%check
pushd %{buildroot}/%{python2_sitelib}
nosetests-%{python2_version} patsy
popd
%if 0%{?with_python3}
pushd %{buildroot}/%{python3_sitelib}
nosetests-%{python3_version} patsy
popd
%endif # with_python3
%files
%license LICENSE.txt
%doc README.rst TODO
%{python2_sitelib}/patsy*
%files doc
%license LICENSE.txt
%doc README.rst TODO build/sphinx/html
%if 0%{?with_python3}
%files -n python3-%{upname}
%doc README.rst TODO
%license LICENSE.txt
%{python3_sitelib}/patsy*
%files -n python3-%{upname}-doc
%doc README.rst TODO build/sphinx/html
%license LICENSE.txt
%endif # with_python3
%changelog
* Tue Nov 17 2015 Sergio Pascual <sergio.pasra@gmail.com> - 0.4.1-1
- New upstream source (0.4.1)
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Wed Sep 02 2015 Sergio Pascual <sergio.pasra@gmail.com> - 0.4.0-1
- New upstream source (0.4.0)
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Jul 21 2014 Sergio Pascual <sergio.pasra@gmail.com> - 0.3.0-1
- New upstream source (0.3.0)
- Removed patches
* Tue Jun 17 2014 Sergio Pascual <sergio.pasra@gmail.com> - 0.2.1-6
- Doc generation enabled, patch from upstream
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon Jun 02 2014 Sergio Pascual <sergio.pasra@gmail.com> - 0.2.1-4
- Doc generation broken due to new ipython, disabled for the moment
* Fri Apr 04 2014 Sergio Pascual <sergio.pasra@gmail.com> - 0.2.1-3
- Enable pandas support in python3-patsy
* Sat Jan 11 2014 Sergio Pascual <sergio.pasra@gmail.com> - 0.2.1-2
- Split docs in a subpackage
- License is BSD and Python
* Fri Dec 13 2013 Sergio Pascual <sergio.pasra@gmail.com> - 0.2.1-1
- Initial specfile