File python-scoop.spec of Package python-scoop

#
# spec file for package python-scoop
#
# 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-%{**}}
# Test data files not in source archive
%bcond_with     test
Name:           python-scoop
Version:        0.7.1.1
Release:        0
Summary:        Scalable COncurrent Operations in Python
License:        LGPL-3.0
Group:          Development/Languages/Python
Url:            http://github.com/soravux/scoop
Source:         https://files.pythonhosted.org/packages/source/s/scoop/scoop-%{version}.tar.gz
# PATCH-FIX-UPSTREAM -- dont_require_argparse.patch -- https://github.com/soravux/scoop/issues/16
Patch0:         dont_require_argparse.patch
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  python-rpm-macros
BuildRequires:  python3
%if %{with test}
BuildRequires:  %{python_module greenlet >= 0.3.4}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module pyzmq >= 13.1.0}
%endif
BuildRequires:  fdupes
Requires:       python-greenlet >= 0.3.4
Requires:       python-pyzmq >= 13.1.0
Suggests:       python-psutil >= 0.6.1
BuildArch:      noarch

%python_subpackages

%description
SCOOP (Scalable COncurrent Operations in Python) is a distributed task module 
allowing concurrent parallel programming on various environments, from 
heterogeneous grids to supercomputers.

%prep
%setup -q -n scoop-%{version}
%patch0 -p1
find scoop -name '*.py' -exec sed -i "s|#!/usr/bin/env python||" {} \;

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%if %{with test}
%check
pushd test
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
$python -m unittest discover
}
popd
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc CHANGELOG.txt LICENSE.txt README.txt
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by