From a5a98b81ec90a6b4ef4debc4f7130f1e61127826 Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Oct 17 2016 13:00:08 +0000 Subject: Refactored spec - Remove pandas dep, it's circular - Recommend scipy, not require it --- diff --git a/python-patsy.spec b/python-patsy.spec index 71332f4..2dc8d3c 100644 --- a/python-patsy.spec +++ b/python-patsy.spec @@ -1,12 +1,15 @@ -%global upname patsy +%global srcname patsy +%global summary Describing statistical models in Python using symbolic formulas -%global with_python3 1 -Name: python-%{upname} -Version: 0.4.1 -Release: 3%{?dist} -Summary: Describing statistical models in Python using symbolic formulas +%global common_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. -Group: Development/Languages +Name: python-%{srcname} +Version: 0.4.1 +Release: 4%{?dist} +Summary: %{summary} # All code is under BSD except patsy.compat that is under Python # See LICENSE.txt for details License: BSD and Python @@ -15,127 +18,123 @@ URL: https://github.com/pydata/patsy Source0: https://pypi.python.org/packages/source/p/patsy/patsy-%{version}.zip BuildArch: noarch +BuildRequires: python2-devel python3-devel + +%description +%{common_description} + +%package -n python2-%{srcname} +Summary: %{summary} -BuildRequires: python2-devel python-nose -BuildRequires: python-six +BuildRequires: python2-nose +BuildRequires: python2-six +BuildRequires: python2-numpy # For the docs -BuildRequires: python-sphinx +BuildRequires: python2-sphinx BuildRequires: python-ipython-sphinx -BuildRequires: numpy +# This should be required by python-ipython-sphinx +BuildRequires: python2-matplotlib +# For splines +BuildRequires: python2-scipy + +Requires: python2-six +Requires: python2-numpy # For splines -BuildRequires: scipy -BuildRequires: python-pandas +Recommends: python2-scipy -Requires: numpy scipy python-pandas -Requires: python-six -# New python guidelines -Provides: python2-%{upname} +%{?python_provide:%python_provide python2-%{srcname}} -%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. +%description -n python2-%{srcname} +%{common_description} -%package doc -Summary: Documentation for %{name}, includes full API docs +%package -n python2-%{srcname}-doc +Summary: Documentation for python2-%{srcname}, includes full API docs BuildArch: noarch -%description doc -This package contains the full API documentation for %{name}. +%description -n python2-%{srcname}-doc +This package contains the full API documentation for python2-%{srcname}. -%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 +%package -n python3-%{srcname} +Summary: %{summary} +BuildRequires: python3-nose +BuildRequires: python3-six +BuildRequires: python3-numpy # For the docs BuildRequires: python3-sphinx BuildRequires: python3-ipython-sphinx +# This should be required by python3-ipython-sphinx +BuildRequires: python3-matplotlib +# For splines +BuildRequires: python3-scipy -Requires: python3-numpy python3-scipy python3-pandas Requires: python3-six +Requires: python3-numpy +# For splines +Recommends: python3-scipy + +%{?python_provide:%python_provide python3-%{srcname}} -%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. +%description -n python3-%{srcname} +%{common_description} -%package -n python3-%{upname}-doc -Summary: Documentation for %{name}, includes full API docs +%package -n python3-%{srcname}-doc +Summary: Documentation for python3-%{srcname}, includes full API docs BuildArch: noarch -%description -n python3-%{upname}-doc -This package contains the full API documentation for %{name}. +%description -n python3-%{srcname}-doc +This package contains the full API documentation for python3-%{srcname}. -%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}|' +%autosetup -n %{srcname}-%{version} %build -%{__python2} setup.py build +%py2_build %{__python2} setup.py build_sphinx rm -f build/sphinx/html/.buildinfo - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build +%py3_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} +%py2_install +%py3_install %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 + +%files -n python2-%{srcname} %license LICENSE.txt %doc README.rst TODO %{python2_sitelib}/patsy* -%files doc +%files -n python2-%{srcname}-doc %license LICENSE.txt %doc README.rst TODO build/sphinx/html -%if 0%{?with_python3} -%files -n python3-%{upname} +%files -n python3-%{srcname} %doc README.rst TODO %license LICENSE.txt %{python3_sitelib}/patsy* -%files -n python3-%{upname}-doc +%files -n python3-%{srcname}-doc %doc README.rst TODO build/sphinx/html %license LICENSE.txt -%endif # with_python3 %changelog +* Mon Oct 17 2016 Sergio Pascual - 0.4.1-4 +- Refactored spec +- Remove pandas dep, it's circular +- Recommend scipy, not require it + * Tue Jul 19 2016 Fedora Release Engineering - 0.4.1-3 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages