## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 4; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Not packaged in Fedora: # python-abydos %bcond abydos 0 # python-distance %bcond distance 0 # python-pyxDamerauLevenshtein %bcond pdl 0 %global forgeurl https://github.com/orsinium/textdistance %global tag %{version} Name: python-textdistance Version: 4.5.0 Release: %autorelease Summary: Compute distance between the two texts %forgemeta # SPDX License: MIT URL: %{forgeurl} # The PyPI sdist lacks tests, so we must use the GitHub archive. Source: %{forgesource} # Remove executable bit from filesystem permissions of README.md Patch: https://github.com/life4/textdistance/pull/85.patch # Update URL and name for python-Levenshtein # https://github.com/life4/textdistance/pull/86 # # Rebased on 4.4.0; changes to constraints.txt removed so the patch will # apply to the PyPI sdist, which lacks it # # It’s good in general to use the name preferred by upstream (Levenshtein # rather than python-Levenshtein), but it’s also important because the # python-Levenshtein package currently lacks virtual Provides for # python3-python-Levenshtein. Patch: textdistance-4.4.0-pr-86.patch # Replace deprecated license_file with license_files in setup.cfg Patch: https://github.com/life4/textdistance/pull/87.patch BuildArch: noarch BuildRequires: python3-devel # For running tests in parallel: BuildRequires: %{py3_dist pytest-xdist} %global _description %{expand: TextDistance - python library for comparing distance between two or more sequences by many algorithms. Features: • 30+ algorithms • Pure python implementation • Simple usage • More than two sequences comparing • Some algorithms have more than one implementation in one class. • Optional numpy usage for maximum speed.} %description %{_description} %package -n python3-textdistance Summary: %{summary} %description -n python3-textdistance %{_description} # Both “common” and “extra” are equivalent to ”extras”, and are provided for # backward compatibility and to handle typos, respectively. %if %{with abydos} && %{with pdl} %pyproject_extras_subpkg -n python3-textdistance extras common extra %endif # We don’t choose to provide a metapackage for the “benchmark”/“benchmarks” # extra; besides missing dependencies, we think that it is akin to the “test” # and “lint” extras in not being intended for library *users*. %if %{with pdl} %pyproject_extras_subpkg -n python3-textdistance DamerauLevenshtein %endif %if %{with abydos} && %{with distance} %pyproject_extras_subpkg -n python3-textdistance Hamming %endif %pyproject_extras_subpkg -n python3-textdistance Jaro JaroWinkler Levenshtein %prep %forgeautosetup -p1 # This really doesn’t belong in the test extras! sed -r -i 's/^([[:blank:]]*)(.*\b(isort)\b)/\1# \2/' setup.py %generate_buildrequires %pyproject_buildrequires -x test,Jaro,JaroWinkler,Levenshtein %{pyproject_buildrequires \ -x test \ %if %{with abydos} && %{with pdl} -x extras -x common -x extra \ %endif %if %{with pdl} -x DamerauLevenshtein \ %endif %if %{with abydos} && %{with distance} -x Hamming \ %endif -x Jaro \ -x JaroWinkler \ -x Levenshtein} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files textdistance %check %if %{without abydos} k="${k-}${k+ and } not test_compare[DamerauLevenshtein]" k="${k-}${k+ and } not test_compare[Hamming]" k="${k-}${k+ and } not test_compare[Levenshtein]" k="${k-}${k+ and } not test_list_of_numbers[DamerauLevenshtein]" k="${k-}${k+ and } not test_list_of_numbers[Hamming]" k="${k-}${k+ and } not test_list_of_numbers[Levenshtein]" k="${k-}${k+ and } not test_qval[1-DamerauLevenshtein]" k="${k-}${k+ and } not test_qval[1-Hamming]" k="${k-}${k+ and } not test_qval[1-Levenshtein]" k="${k-}${k+ and } not test_qval[2-DamerauLevenshtein]" k="${k-}${k+ and } not test_qval[2-Hamming]" k="${k-}${k+ and } not test_qval[2-Levenshtein]" k="${k-}${k+ and } not test_qval[3-DamerauLevenshtein]" k="${k-}${k+ and } not test_qval[3-Hamming]" k="${k-}${k+ and } not test_qval[3-Levenshtein]" k="${k-}${k+ and } not test_qval[DamerauLevenshtein]" k="${k-}${k+ and } not test_qval[Hamming]" k="${k-}${k+ and } not test_qval[Levenshtein]" k="${k-}${k+ and } not test_qval[None-DamerauLevenshtein]" k="${k-}${k+ and } not test_qval[None-Hamming]" k="${k-}${k+ and } not test_qval[None-Levenshtein]" %endif %pytest -v -k "${k-}" -n auto %files -n python3-textdistance -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Wed Sep 27 2023 Benjamin A. Beasley - 4.5.0-4 - Add a packit config * Wed Sep 27 2023 Benjamin A. Beasley - 4.5.0-3 - Run tests in parallel * Wed Sep 27 2023 Benjamin A. Beasley - 4.5.0-2 - Replace deprecated license_file with license_files in setup.cfg * Wed Sep 27 2023 Benjamin A. Beasley - 4.5.0-1 - Update to 4.5.0 * Wed Sep 27 2023 Benjamin A. Beasley - 4.4.0-1 - Update to 4.4.0 * Wed Sep 27 2023 Benjamin A. Beasley - 4.3.0-1 - Update to 4.3.0 * Wed Sep 27 2023 Benjamin A. Beasley - 4.2.2-1 - Update to 4.2.2 - Two patches are now merged upstream * Wed Sep 27 2023 Benjamin A. Beasley - 4.2.1-1 - Update to 4.2.1 - README.rst is removed upstream in favor of README.md - We now package the GitHub archive instead of the PyPI sdist, since the latter no longer contains tests * Wed Sep 27 2023 Benjamin A. Beasley - 4.2.0-27 - Confirm License is SPDX MIT * Wed Sep 27 2023 Benjamin A. Beasley - 4.2.0-26 - Port to pyproject-rpm-macros - Add extras metapackages * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-25 - Package README.rst too, not just README.md * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-24 - Replace the executable-readme workaround with an upstream PR and patch * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-23 - Use the pytest macro to run tests * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-22 - Drop obsolete python_provide macro * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-21 - Don’t unnecessarily number sources and patches * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-20 - Reduce macro indirection in the spec file * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-19 - Stop using deprecated zero-argument version of pypi_source * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-18 - Fix leading blank lines in descriptions * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-17 - Nicer description formatting * Tue Sep 26 2023 Benjamin A. Beasley - 4.2.0-16 - Adjust whitespace and ordering for legibility * Tue Sep 26 2023 Sandro - 4.2.0-14 - Rebuild for RHBZ#2171687 (corrected bug#) * Tue Sep 26 2023 Sandro - 4.2.0-13 - Rebuild for RHBZ#2240745 * Fri Jul 21 2023 Fedora Release Engineering - 4.2.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Thu Jul 13 2023 Mamoru TASAKA - 4.2.0-11 - Backport upstream patch for numpy 1.24.x numpy.int removal - Backport upstream patch for test_jaro_winkler test fix * Thu Jun 15 2023 Python Maint - 4.2.0-10 - Rebuilt for Python 3.12 * Fri Jan 20 2023 Fedora Release Engineering - 4.2.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Jul 22 2022 Fedora Release Engineering - 4.2.0-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Mon Jun 13 2022 Python Maint - 4.2.0-7 - Rebuilt for Python 3.11 * Fri Jan 21 2022 Fedora Release Engineering - 4.2.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Jul 23 2021 Fedora Release Engineering - 4.2.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 4.2.0-4 - Rebuilt for Python 3.10 * Wed Jan 27 2021 Fedora Release Engineering - 4.2.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Fri Dec 25 2020 Mukundan Ragavan - 4.2.0-2 - Fix directory ownership - run tests * Thu Dec 24 2020 Mukundan Ragavan - 4.2.0-1 - Initial package.