Blob Blame History Raw
%bcond_without tests

%global srcname pyemd

%global desc %{expand: \
PyEMD is a Python wrapper for Ofir Pele and Michael Werman’s implementation of
the Earth Mover’s Distance that allows it to be used with NumPy. If you use
this code, please cite the papers listed in the README.rst file.}

Name:           python-%{srcname}
Version:        0.5.1
Release:        10%{?dist}
Summary:        Fast EMD for Python


License:        MIT
URL:            https://github.com/wmayner/%{srcname}
Source0:        %pypi_source

%description
%{desc}

%package -n python3-%{srcname}
Summary:        %{summary}
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist Cython}
BuildRequires:  %{py3_dist numpy}
BuildRequires:  %{py3_dist pytest}
BuildRequires:  %{py3_dist setuptools}

Requires:       %{py3_dist numpy}
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
%{desc}


%prep
%autosetup -n %{srcname}-%{version}
rm -rf %{srcname}.egg-info
rm -rf .eggs

# Remove unneeded shebangs
sed -i '/^#!\/usr\/bin\/env python3/ d' pyemd/__about__.py
sed -i '/^#!\/usr\/bin\/env python3/ d' pyemd/__init__.py

%build
%py3_build

%install
%py3_install

%check
%if %{with tests}
# Remove this stuff so that the installed copy is used for tests
rm -rf %{srcname} %{srcname}.egg-info
export PYTHONPATH=%{buildroot}/%{python3_sitearch}
pytest-%{python3_version} test
%endif

%files -n python3-%{srcname}
%license LICENSE
%doc README.rst
%{python3_sitearch}/%{srcname}
%{python3_sitearch}/%{srcname}-%{version}-py%{python3_version}.egg-info

%changelog
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Thu Jun 25 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.5.1-8
- Remove py2 bits
- Explicitly BR setuptools

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.5.1-7
- Rebuilt for Python 3.9

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.5.1-5
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.5.1-4
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Wed Nov 14 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.5.1-1
- Initial package
- use {buildroot}
- BRs one per line