File python-blaze.spec of Package python-blaze

#
# spec file for package python-blaze
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without  tests
Name:           python-blaze
Version:        0.11.3
Release:        0
Summary:        NumPy and Pandas interface to Big Data
License:        BSD-3-Clause
Group:          Development/Languages/Python
Url:            https://github.com/blaze/blaze
Source:         https://github.com/blaze/blaze/archive/%{version}.tar.gz
BuildRequires:  %{python_module DataShape}
BuildRequires:  %{python_module Flask >= 0.10.1}
BuildRequires:  %{python_module Flask-Cors}
BuildRequires:  %{python_module SQLAlchemy >= 0.8.0}
BuildRequires:  %{python_module dask-dataframe}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module multipledispatch >= 0.4.7}
BuildRequires:  %{python_module numpy >= 1.7}
BuildRequires:  %{python_module odo >= 0.4.0}
BuildRequires:  %{python_module pandas >= 0.15.0}
BuildRequires:  %{python_module psutil}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module toolz}
BuildRequires:  fdupes
BuildRequires:  python-contextlib2
BuildRequires:  python-rpm-macros
%if %{with test}
BuildRequires:  %{python_module PyHive >= 0.2.1}
BuildRequires:  %{python_module PyMySQL >= 0.7}
BuildRequires:  %{python_module PyYAML >= 3.11}
BuildRequires:  %{python_module bcolz >= 0.12.0}
BuildRequires:  %{python_module bokeh >= 0.12}
BuildRequires:  %{python_module boto >= 2.43.0}
BuildRequires:  %{python_module cytoolz}
BuildRequires:  %{python_module dask-all >= 0.11.1}
BuildRequires:  %{python_module h5py >= 2.6.0}
BuildRequires:  %{python_module numba >= 0.29.0}
BuildRequires:  %{python_module paramiko >= 2.0.0}
BuildRequires:  %{python_module psycopg2 >= 2.6.0}
BuildRequires:  %{python_module pymongo > 2.9.0}
BuildRequires:  %{python_module pytest >= 3.0.3}
BuildRequires:  %{python_module pytest-cov >= 2.0.0}
BuildRequires:  %{python_module requests >= 2.0.0}
BuildRequires:  %{python_module sas7bdat >= 2.0.0}
BuildRequires:  %{python_module tables >= 3.3.0}
%endif
Requires:       python-DataShape
Requires:       python-Flask >= 0.10.1
Requires:       python-Flask-Cors
Requires:       python-SQLAlchemy >= 0.8.0
Requires:       python-dask-dataframe
Requires:       python-multipledispatch >= 0.4.7
Requires:       python-numpy >= 1.7
Requires:       python-odo >= 0.4.0
Requires:       python-pandas >= 0.15.0
Requires:       python-psutil
Requires:       python-toolz
Recommends:     python-PyHive >= 0.2.1
Recommends:     python-PyMySQL >= 0.7
Recommends:     python-PyYAML >= 3.11
Recommends:     python-bokeh >= 0.12
Recommends:     python-boto >= 2.43.0
Recommends:     python-cytoolz
Recommends:     python-dask-all >= 0.11.1
Recommends:     python-h5py >= 2.6.0
Recommends:     python-numba >= 0.29.0
Recommends:     python-paramiko >= 2.0.0
Recommends:     python-psycopg2 >= 2.6.0
Recommends:     python-pymongo > 2.9.0
Recommends:     python-pytest >= 3.0.3
Recommends:     python-pytest-cov >= 2.0.0
Recommends:     python-requests >= 2.0.0
Recommends:     python-sas7bdat >= 2.0.0
Recommends:     python-tables >= 3.3.0
%ifpython2
Requires:       python-contextlib2
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch:      noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives

%python_subpackages

%description
Blaze translates a subset of modified NumPy and Pandas-like syntax to
databases and other computing systems.  Blaze allows Python users a familiar
interface to query data living in other data storage systems.

%prep
%setup -q -n blaze-%{version}

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/blaze-server

%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/blaze/server/spider.py
# Fix wrong-script-interpreter
sed -i "s|#!/usr/bin/env python|#!%__$python|" %{buildroot}%{$python_sitelib}/blaze/server/spider.py
$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/blaze/server/
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/blaze/server/
%fdupes %{buildroot}%{$python_sitelib}
}

%post
%python_install_alternative blaze-server

%postun
%python_uninstall_alternative blaze-server

%if %{with test}
%check
pushd blaze/tests
PYTHONPATH="%{buildroot}%{python_sitelib}" py.test blaze
popd
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc README.rst LICENSE.txt
%python_alternative %{_bindir}/blaze-server
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by