Name: python-pyxdameraulevenshtein Version: 1.7.1 Release: %autorelease Summary: Damerau-Levenshtein (DL) edit distance algorithm License: BSD-3-Clause URL: https://github.com/lanl/pyxDamerauLevenshtein # The PyPI sdist lacks the tests. Source: %{url}/archive/v%{version}/pyxDamerauLevenshtein-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: gcc # Upstream relies on running Cython manually; see: # https://github.com/lanl/pyxDamerauLevenshtein/issues/18 BuildRequires: %{py3_dist Cython} # The tests only require unittest, but pytest is a more convenient runner. BuildRequires: %{py3_dist pytest} %global common_description %{expand: pyxDamerauLevenshtein implements the Damerau-Levenshtein (DL) edit distance algorithm for Python in Cython for high performance.} %description %{common_description} %package -n python3-pyxdameraulevenshtein Summary: %{summary} %description -n python3-pyxdameraulevenshtein %{common_description} %prep %autosetup -n pyxDamerauLevenshtein-%{version} # Remove Cythonized C sources (_initialize.c, but the following is general): # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_using_cython find . -type f -exec grep -FrinIl 'Generated by Cython' '{}' '+' | xargs -r -t rm -v %generate_buildrequires %pyproject_buildrequires %build # Upstream relies on running Cython manually; see: # https://github.com/lanl/pyxDamerauLevenshtein/issues/18 %{python3} -m cython pyxdameraulevenshtein/*.pyx %pyproject_wheel %install %pyproject_install %pyproject_save_files pyxdameraulevenshtein %check %pytest -v %files -n python3-pyxdameraulevenshtein -f %{pyproject_files} # pyproject_files handles AUTHORS.md and LICENSE; verify with “rpm -qL -p …” %doc CHANGES.md %doc README.md %changelog %autochangelog