%global pypi_name ruamel.ordereddict %global pname ruamel-ordereddict # Disabling python 3 package as it is not ported to py3 # https://bitbucket.org/ruamel/ordereddict/issues/2/please-provide-a-python3-package#comment-30018391 %global with_python3 0 Name: python-%{pname} Version: 0.4.9 Release: 5%{?dist} Summary: Ordered dictionary with Key Insertion Order License: MIT URL: https://bitbucket.org/ruamel/ordereddict Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: pytest BuildRequires: python-rpm-macros %description This is an implementation of an ordered dictionary with Key Insertion Order (KIO: updates of values do not affect the position of the key), Key Value Insertion Order (KVIO, an existing key's position is removed and put at the back). The standard library module OrderedDict, implemented later, implements a subset of ordereddict functionality. %package -n python2-%{pname} Summary: Ordered dictionary with Key Insertion Order %{?python_provide:%python_provide python2-%{pname}} Requires: python-setuptools %description -n python2-%{pname} This is an implementation of an ordered dictionary with Key Insertion Order (KIO: updates of values do not affect the position of the key), Key Value Insertion Order (KVIO, an existing key's position is removed and put at the back). The standard library module OrderedDict, implemented later, implements a subset of ordereddict functionality. %if 0%{?with_python3} %package -n python3-%{pname} Summary: Ordered dictionary with Key Insertion Order BuildRequires: python3-devel BuildRequires: python3-setuptools %{?python_provide:%python_provide python3-%{pname}} BuildRequires: python3-devel BuildRequires: python3-setuptools Requires: python3-setuptools %description -n python3-%{pname} This is an implementation of an ordered dictionary with Key Insertion Order (KIO: updates of values do not affect the position of the key), Key Value Insertion Order (KVIO, an existing key's position is removed and put at the back). The standard library module OrderedDict, implemented later, implements a subset of ordereddict functionality. %endif %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py_build %if 0%{?with_python3} %py3_build %endif %install %if 0%{?with_python3} %py3_install %endif %py_install %check builddir=$(echo build/lib.*%{python2_version}) touch ${builddir}/ruamel/__init__.py export PYTHONPATH=$builddir %{__python2} test/testordereddict.py py.test-%{python2_version} test/test_ordereddict.py test/test_dictviews.py %files -n python2-%{pname} %doc README.rst %{python2_sitearch}/ruamel/ordereddict %{python2_sitearch}/%{pypi_name}-%{version}-py?.?-*.pth %{python2_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info %{python2_sitearch}/_ordereddict.so %if 0%{?with_python3} %files -n python3-%{pname} %doc README.rst %{python3_sitearch}/ruamel/ordereddict %{python3_sitearch}/%{pypi_name}-%{version}-py?.?-*.pth %{python3_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info %{python3_sitearch}/_ordereddict.so %endif %changelog * Fri Nov 17 2017 Yaakov Selkowitz - 0.4.9-5 - Rebuilt for multi-arch enablement * Sat Feb 11 2017 Fedora Release Engineering - 0.4.9-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Oct 26 2016 Orion Poplawski - 0.4.9-3 - Run tests * Tue Oct 25 2016 Chandan Kumar - 0.4.9-2 - Fixed package name of python-setuptools * Fri Oct 14 2016 Chandan Kumar - 0.4.9-1 - Initial package.