Blob Blame History Raw
# Run slow tests? In this case, “slow” is just a few minutes.
%bcond_without slow_tests

Name:           python-py27hash
Version:        1.1.0
Release:        %autorelease
Summary:        Python 2.7 hashing and iteration in Python 3+

License:        MIT
# The GitHub tarball contains tests; the PyPI sdist does not.
Source0:        %{url}/archive/v%{version}/py27hash-%{version}.tar.gz

# Since the package previously had an arch-dependent failure, we build on all
# platforms (the base package is not noarch) to flush out any similar issues.
# However, we produce only a noarch binary package. Since there is no compiled
# code, there is no debug package.
%global debug_package %{nil}

BuildRequires:  python3-devel

%global common_description %{expand:
This package helps ease the migration from Python 2 to 3 for applications that
depend on the old hash/iteration order of sets/dicts. Even when setting
PYTHONHASHSEED=0, the hash (and default iteration order) will still be
different as the hashing algorithm changed in Python 3. This package allows
Python 2.7 hashing and set/dict iteration.}

%description %{common_description}

%package -n python3-py27hash
Summary:        %{summary}

BuildArch:      noarch

%description -n python3-py27hash %{common_description}

%autosetup -n py27hash-%{version}



%pyproject_save_files py27hash

# See scripts/, which we have here slightly modified for our purposes:

export PATH="${TEST_DIR}:${PATH}"
export SKIPSLOW='%{?!with_slow_tests:skipslow}'
%{python3} -m unittest discover -v -s "${TEST_DIR}"

%files -n python3-py27hash -f %{pyproject_files}
# pyproject-rpm-macros takes care of LICENSE; verify with “rpm -qL -p …”