494bd22
%global srcname Levenshtein
d73258a
a4061dd
%global forgeurl https://github.com/maxbachmann/%{srcname}
702b554
Version:        0.23.0
a4061dd
%forgemeta
a4061dd
a4061dd
Name:         python-%{srcname}
d73258a
Summary:      Python extension computing string distances and similarities
a4061dd
Release:      %{autorelease}
d73258a
abebaf9
License:      GPL-2.0-or-later
d73258a
a4061dd
# Levenshtein is the latest name of the package, though the python-Levenshtein repo
a4061dd
# is still being kept up-to-date in lock-step to this official upstream.
a4061dd
URL:          %{forgeurl}
d73258a
a4061dd
Source0:      %{forgesource}
494bd22
a4061dd
BuildRequires: cmake
a4061dd
BuildRequires: gcc
a4061dd
BuildRequires: gcc-c++
494bd22
BuildRequires: python3-devel
a4061dd
BuildRequires: python3-pytest
a4061dd
BuildRequires: rapidfuzz-cpp-static
d73258a
a4061dd
%global _description %{expand:
d73258a
Levenshtein computes Levenshtein distances, similarity ratios, generalized
a4061dd
medians and set medians of Strings and Unicodes.}
a4061dd
a4061dd
%description %_description
d73258a
494bd22
%package -n python3-%{srcname}
a4061dd
494bd22
Summary:  %{summary}
494bd22
a4061dd
%description -n python3-%{srcname} %_description
d73258a
d73258a
%prep
187dd07
%autosetup -n %{srcname}-%{version}
187dd07
# Levenshtein can build under older Cython successfully
187dd07
sed 's/Cython>=3.0.0[ab0-9]\+/Cython>=0.29.26/' -i pyproject.toml
a4061dd
a4061dd
%generate_buildrequires
a4061dd
%pyproject_buildrequires
a4061dd
d73258a
d73258a
%build
a4061dd
%pyproject_wheel
a4061dd
d73258a
%install
a4061dd
%pyproject_install
a4061dd
%pyproject_save_files %{srcname}
a4061dd
a4061dd
%check
a4061dd
%pyproject_check_import
a4061dd
%pytest
494bd22
a4061dd
%files -n python3-%{srcname} -f %{pyproject_files}
a4061dd
%doc README.md
494bd22
%license COPYING
d73258a
d73258a
d73258a
%changelog
a4061dd
%{autochangelog}