From a4061ddcd967835c72251bbd5f1416a19423bc86 Mon Sep 17 00:00:00 2001 From: Troy Curtis Jr Date: Sat, 24 Dec 2022 23:14:14 -0500 Subject: [PATCH] Update to 0.20.8. --- .gitignore | 1 + levenshtein-0.20.8-cython-0.29.patch | 26 ++++++++++ python-Levenshtein.spec | 71 ++++++++++++++++------------ sources | 2 +- 4 files changed, 68 insertions(+), 32 deletions(-) create mode 100644 levenshtein-0.20.8-cython-0.29.patch diff --git a/.gitignore b/.gitignore index e0eb860..047aaf7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ python-Levenshtein-0.10.1.tar.bz2 /python-Levenshtein-0.12.0.tar.gz +/Levenshtein-0.20.8.tar.gz diff --git a/levenshtein-0.20.8-cython-0.29.patch b/levenshtein-0.20.8-cython-0.29.patch new file mode 100644 index 0000000..1d9a8e7 --- /dev/null +++ b/levenshtein-0.20.8-cython-0.29.patch @@ -0,0 +1,26 @@ +diff --git a/_custom_build/backend.py b/_custom_build/backend.py +index 08c3c06..43b0b22 100644 +--- a/_custom_build/backend.py ++++ b/_custom_build/backend.py +@@ -36,7 +36,7 @@ def _ninja_required(): + + return True + +-def get_requires_for_build_wheel(self, config_settings=None): ++def get_requires_for_build_wheel(config_settings=None): + packages = [] + if _cmake_required(): + packages.append('cmake') +diff --git a/pyproject.toml b/pyproject.toml +index 88df1c3..8ff41bb 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -2,7 +2,7 @@ + requires = [ + "setuptools", + "scikit-build>=0.13.0", +- "Cython>=3.0.0a11" ++ "Cython>=0.29.26" + ] + build-backend = "backend" + backend-path = ["_custom_build"] diff --git a/python-Levenshtein.spec b/python-Levenshtein.spec index 477221e..5c04b17 100644 --- a/python-Levenshtein.spec +++ b/python-Levenshtein.spec @@ -1,54 +1,63 @@ %global srcname Levenshtein -Name: python-Levenshtein +%global forgeurl https://github.com/maxbachmann/%{srcname} +Version: 0.20.8 +%forgemeta + +Name: python-%{srcname} Summary: Python extension computing string distances and similarities -Version: 0.12.0 -Release: %autorelease +Release: %{autorelease} License: GPL-2.0-or-later -# The original site: http://trific.ath.cx/python/levenshtein/ -# no longer exists so pointing to the pypi listing instead. -URL: http://pypi.python.org/pypi/%{name}/ +# Levenshtein is the latest name of the package, though the python-Levenshtein repo +# is still being kept up-to-date in lock-step to this official upstream. +URL: %{forgeurl} -Source: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz - -BuildRequires: gcc +Source0: %{forgesource} +Patch0: levenshtein-0.20.8-cython-0.29.patch +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: python3-devel -BuildRequires: python3-setuptools +BuildRequires: python3-pytest +BuildRequires: rapidfuzz-cpp-static -%description +%global _description %{expand: Levenshtein computes Levenshtein distances, similarity ratios, generalized -medians and set medians of Strings and Unicodes. Because it's implemented -in C, it's much faster than corresponding Python library functions and -methods. +medians and set medians of Strings and Unicodes.} + +%description %_description %package -n python3-%{srcname} -Summary: %{summary} -%{?python_provide:%python_provide python3-%{srcname}} -%description -n python3-%{srcname} -Levenshtein computes Levenshtein distances, similarity ratios, generalized -medians and set medians of Strings and Unicodes. Because it's implemented -in C, it's much faster than corresponding Python 3 library functions and -methods. +Summary: %{summary} + +%description -n python3-%{srcname} %_description %prep -%setup -qn %{name}-%{version} +%autosetup -p1 -n %{srcname}-%{version} + +%generate_buildrequires +%pyproject_buildrequires + %build -%py3_build - -%install -%py3_install +%pyproject_wheel -%files -n python3-%{srcname} -%doc README.rst NEWS +%install +%pyproject_install +%pyproject_save_files %{srcname} + +%check +%pyproject_check_import +%pytest + +%files -n python3-%{srcname} -f %{pyproject_files} +%doc README.md %license COPYING -%{python3_sitearch}/%{srcname}/ -%{python3_sitearch}/python_%{srcname}-%{version}-py%{python3_version}.egg-info/ %changelog -%autochangelog +%{autochangelog} diff --git a/sources b/sources index e7f6ec6..177ff30 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e8cde197d6d304bbdc3adae66fec99fb python-Levenshtein-0.12.0.tar.gz +SHA512 (Levenshtein-0.20.8.tar.gz) = 3a248b5d1a18c8afeffaa637c831b07266dd36a094b713c18b7182a49de7df9a3b7316d00e9329e2ae49f92c601e32a61590338e30a7e4f33ffe0d76c6219061