Blob Blame History Raw
%global srcname statsmodels
%global sum Statistics in Python

Name:           python-%{srcname}
Version:        0.8.0
Release:        4%{?dist}
Summary:        %{sum}

# Package is licensed under BSD (3 clauses)
# except the following files in Public Domain
# statsmodels/datasets/elnino/data.py
# statsmodels/datasets/randhie/data.py
License:        BSD and Public Domain
URL:            http://statsmodels.sourceforge.net
Source0:        http://pypi.python.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz


BuildRequires:  python2-devel python3-devel
# For testing
BuildRequires:  xorg-x11-server-Xvfb
# For documentation
BuildRequires:  graphviz

%description
statsmodels is a Python module that provides classes and functions for the
estimation of many different statistical models, as well as for conducting
statistical tests, and statistical data exploration. An extensive list of
result statistics are available for each estimator. The results are tested
against existing statistical packages to ensure that they are correct.

%package -n python2-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python2-%{srcname}}

BuildRequires: python2-numpy
BuildRequires: python2-scipy 
BuildRequires: python2-patsy
BuildRequires: python2-pandas
# For testing
BuildRequires: python2-matplotlib
BuildRequires: python2-matplotlib-tk
BuildRequires: python2-nose
# For documentation

Requires: python2-numpy
Requires: python2-scipy 
Requires: python2-patsy
Requires: python2-pandas

%description -n python2-%{srcname}
statsmodels is a Python module that provides classes and functions for the
estimation of many different statistical models, as well as for conducting
statistical tests, and statistical data exploration. An extensive list of
result statistics are available for each estimator. The results are tested
against existing statistical packages to ensure that they are correct.

%package -n python3-%{srcname}
Summary:        %{sum}
%{?python_provide:%python_provide python3-%{srcname}}

BuildRequires: python3-numpy
BuildRequires: python3-scipy 
BuildRequires: python3-patsy
BuildRequires: python3-pandas
# For testing
BuildRequires: python3-matplotlib
BuildRequires: python3-matplotlib-tk
BuildRequires: python3-nose

Requires: python3-numpy
Requires: python3-scipy 
Requires: python3-patsy
Requires: python3-pandas

%description -n python3-%{srcname}
statsmodels is a Python module that provides classes and functions for the
estimation of many different statistical models, as well as for conducting
statistical tests, and statistical data exploration. An extensive list of
result statistics are available for each estimator. The results are tested
against existing statistical packages to ensure that they are correct.

%package -n python2-%{srcname}-doc
Summary: Documentation for %{srcname}, includes full API docs
BuildArch: noarch

BuildRequires: python2-sphinx
BuildRequires: python-numpydoc
BuildRequires: python-ipython-sphinx

%description -n python2-%{srcname}-doc
This package contains the full API documentation for python2-%{srcname}.

%package -n python3-%{srcname}-doc
Summary: Documentation for %{srcname}, includes full API docs
BuildArch: noarch

BuildRequires: python3-sphinx
BuildRequires: python3-numpydoc
BuildRequires: python3-ipython-sphinx

%description -n python3-%{srcname}-doc
This package contains the full API documentation for python3-%{srcname}.

%prep
%autosetup -n %{srcname}-%{version} -p1

pushd statsmodels
# Copy license files
cp -a stats/libqsturng/LICENSE.txt ../LICENSE.libqsturng.txt
cp -a datasets/README.txt ../README.datasets.txt
cp -a datasets/COPYING ../COPYING.datasets

# remove shebangs
sed -i -e "1d" regression/quantile_regression.py
sed -i -e "1d" tools/print_version.py
sed -i -e "1d" datasets/strikes/data.py
sed -i -e "1d" datasets/fair/data.py
sed -i -e "1d" datasets/template_data.py
sed -i -e "1d" datasets/engel/data.py
sed -i -e "1d" datasets/co2/data.py
sed -i -e "1d" datasets/fertility/data.py
sed -i -e "1d" datasets/modechoice/data.py
sed -i -e "1d" datasets/statecrime/data.py

popd

%build
%py2_build
%py3_build

%{__python2} setup.py build_sphinx
rm -f build/sphinx/html/.buildinfo
mkdir -p build/sphinx3
cp -a build/sphinx/html build/sphinx3

%install
# Must do the python2 install first because the scripts in /usr/bin are
# overwritten with every setup.py install, and in general we want the
# python3 version to be the default.
%py2_install
%py3_install

%check
# False matplotlibrc
mkdir -p matplotlib
touch matplotlib/matplotlibrc
export XDG_CONFIG_HOME=`pwd`
pushd %{buildroot}/%{python2_sitearch}
 xvfb-run nosetests-%{python2_version} %{srcname} || :
popd
pushd %{buildroot}/%{python3_sitearch}
 xvfb-run nosetests-%{python3_version} %{srcname} || :
popd

# Note that there is no %%files section for the unversioned python module if we are building for several python runtimes
%files -n python2-%{srcname}
%license LICENSE.txt LICENSE.libqsturng.txt
%doc COPYRIGHTS.txt README_l1.txt README.rst README.datasets.txt COPYING.datasets
%{python2_sitearch}/*

%files -n python3-%{srcname}
%license LICENSE.txt LICENSE.libqsturng.txt
%doc COPYRIGHTS.txt README_l1.txt README.rst README.datasets.txt COPYING.datasets
%{python3_sitearch}/*

%files -n python2-%{srcname}-doc
%license LICENSE.txt LICENSE.libqsturng.txt
%doc build/sphinx/html

%files -n python3-%{srcname}-doc
%license LICENSE.txt LICENSE.libqsturng.txt
%doc build/sphinx3/html


%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Mon May 15 2017 Sergio Pascual <sergiopr@fedoraproject.org> - 0.8.0-1
- New upstream source (0.8.0)

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.6.1-8
- Rebuild for Python 3.6

* Thu Sep 01 2016 Sergio Pascual <sergiopr@fedoraproject.org> - 0.6.1-7
- Add requirements, were missing

* Thu Apr 21 2016 Sergio Pascual <sergiopr@fedoraproject.org> - 0.6.1-6
- Use new style macros
- Redone patches

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Nov 25 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.6.1-4
- Fix build with new pandas and numpy

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Dec 05 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.6.1-1
- New upstream source, bugfix (0.6.1)

* Mon Nov 17 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.6.0-1
- New upstream source (0.6.0)

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Tue Jun 17 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-11
- Enabled documentation

* Thu Jun 12 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-10
- Documentation broken due to IPython incompatibility, disable for the moment
- Examples moved out installed package
- Disabled tests for the moment

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Jan 24 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-8
- Enable tests in arm
- Disable failling test in i686
- Disable failling test in arm

* Tue Jan 21 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-7
- Disable tests in arm

* Mon Jan 20 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-6
- Add README.txt and COPYING from datasets to doc

* Sun Jan 19 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-5
- Added url for bug report of removed tests
- Minor fixes in the spec
- Included other LICENSE.txt in the documentation

* Wed Jan 15 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-4
- Use an empty matplotlibrc for tests

* Wed Jan 15 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-3
- Patch those tests that fail

* Fri Jan 10 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-2
- Add ipython to build documentation

* Fri Jan 10 2014 Sergio Pascual <sergiopr@fedoraproject.org> - 0.5.0-1
- Initial spec