Blob Blame History Raw
Name:           python-natsort
Version:        3.5.5
Release:        2%{?dist}
Summary:        Python library that sorts lists using the "natural order" sort

License:        MIT
URL:            https://github.com/SethMMorton/natsort
Source0:        https://pypi.python.org/packages/source/n/natsort/natsort-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

# required for tests
BuildRequires:  pytest
BuildRequires:  python-pytest-cache
BuildRequires:  python-pytest-cov
BuildRequires:  python-pytest-flakes
BuildRequires:  python-pytest-pep8
BuildRequires:  python-execnet
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-cache
BuildRequires:  python3-pytest-cov
BuildRequires:  python3-pytest-flakes
BuildRequires:  python3-pytest-pep8
BuildRequires:  python3-execnet

%description
python-natsort provides "natural sorting".

Under natural sorting, numeric sub-strings are compared numerically,
and the other word characters are compared lexically.

Example:
unsorted:           ['a2', 'a9', 'a1', 'a4', 'a10']
lexicographic sort: ['a1', 'a10', 'a2', 'a4', 'a9']
natural sort:       ['a1', 'a2', 'a4', 'a9', 'a10']


%package -n python3-natsort
Summary:	Python library that sorts lists using the "natural order" sort


%description -n python3-natsort
python-natsort provides "natural sorting".

Under natural sorting, numeric sub-strings are compared numerically,
and the other word characters are compared lexically.

Example:
unsorted:           ['a2', 'a9', 'a1', 'a4', 'a10']
lexicographic sort: ['a1', 'a10', 'a2', 'a4', 'a9']
natural sort:       ['a1', 'a2', 'a4', 'a9', 'a10']


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

rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'


%build
%{__python2} setup.py build
pushd %{py3dir}
%{__python3} setup.py build
popd


%install
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
rm %{buildroot}%{_bindir}/natsort

%{__python2} setup.py install --skip-build --root %{buildroot}

%check
%{__python2} setup.py test
pushd %{py3dir}
%{__python3} setup.py test
popd


%files
%{_bindir}/natsort
%doc LICENSE
%doc README.rst
%{python_sitelib}/natsort
%{python_sitelib}/natsort-%{version}-py*.egg-info

%files -n python3-natsort
%doc LICENSE
%doc README.rst
%{python3_sitelib}/natsort
%{python3_sitelib}/natsort-%{version}-py*.egg-info


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

* Mon Apr  6 2015 José Matos <jamatos@fedoraproject.org> - 3.5.5-1
- update to 3.5.5 (3.5.2+ required by nikola)
- add new dependencies to deal with tests (python?-execnet)

* Fri Sep 26 2014 José Matos <jamatos@fedoraproject.org> - 3.5.1-1
- update to 3.5.1
- add check (tests) section

* Fri May 30 2014 José Matos <jamatos@fedoraproject.org> - 3.2.0-2
- change references to __python to __python2
- fix typo in the list of files of the python3 subpackage that
  referenced the version 2 directory

* Thu May 22 2014 José Matos <jamatos@fedoraproject.org> - 3.2.0-1
- initial package