%global pypi_name cloudpickle
%global desc cloudpickle makes it possible to serialize Python constructs \
not supported by the default pickle module from the Python standard \
library. cloudpickle is especially useful for cluster computing where \
Python expressions are shipped over the network to execute on remote \
hosts, possibly close to the data. Among other things, cloudpickle \
supports pickling for lambda expressions, functions and classes defined \
interactively in the __main__ module.
Name: python-%{pypi_name}
Version: 0.3.1
Release: 1%{?dist}
Summary: Extended pickling support for Python objects
License: BSD
URL: https://github.com/cloudpipe/cloudpickle
Source0: https://files.pythonhosted.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: %{py2_dist setuptools}
BuildRequires: python3-devel
BuildRequires: %{py3_dist setuptools}
# Test requirements
BuildRequires: %{py2_dist mock pytest tornado}
BuildRequires: %{py3_dist mock pytest tornado}
%description
%{desc}
%package -n python2-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
%{desc}
%package -n python3-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
%{desc}
%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py2_build
%py3_build
%install
%py3_install
%py2_install
%check
%{__python2} setup.py test
# There is one test not working with Python 3
# GH issue: https://github.com/cloudpipe/cloudpickle/issues/114
%{__python3} setup.py test || :
%files -n python2-%{pypi_name}
%license LICENSE
%doc README.md
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.md
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%changelog
* Wed Aug 09 2017 Lumir Balhar <lbalhar@redhat.com> - 0.3.1-1
- Initial package.