%global srcname fuzzywuzzy Name: python-%{srcname} Version: 0.18.0 Release: 1%{?dist} Summary: Fuzzy string matching using edit distance # GPL-2.0-only, not -or-later: setup.py declares "GPLv2" with the matching # classifier, LICENSE.txt is the bare GPLv2 text, and no source file carries the # "or (at your option) any later version" permission. The only such wording in # the tree is inside the licence's own how-to-apply appendix. License: GPL-2.0-only URL: https://github.com/seatgeek/%{srcname} # GitHub tag archive rather than the PyPI sdist: the sdist ships neither # LICENSE.txt nor any of the three test files. Source0: %{url}/archive/refs/tags/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # %%check BuildRequires: python3-pytest BuildRequires: python3-hypothesis # test_fuzzywuzzy.py imports pycodestyle at module scope for its own style # case, so the module will not import without it even though that case is # deselected below. BuildRequires: python3-pycodestyle # The fast path. See the Requires on the subpackage. BuildRequires: python3-Levenshtein %global _description %{expand: FuzzyWuzzy compares strings that are nearly but not exactly equal and scores how close they are, using Levenshtein edit distance. It handles the cases simple equality does not: words in a different order, one string contained in a longer one, and picking the best of a list of candidates. Note that upstream stopped here. The last release was February 2020; SeatGeek continued the project under the name thefuzz, which reimplements the same API over rapidfuzz. This package exists because it is what several synthetic biology tools still import by name, dnacauldron among them.} %description %_description %package -n python3-%{srcname} Summary: %{summary} # Not an optional speedup in practice. Without the Levenshtein module, # fuzzywuzzy falls back to difflib.SequenceMatcher and warns on every import # that it is "Using slow pure-python SequenceMatcher"; the difference is orders # of magnitude on the list-matching calls callers actually use. Upstream keeps # it behind a "speedup" extra, which is why nothing generates this. Requires: python3-Levenshtein %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{srcname}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{srcname} %check # -p no:logging is load-bearing, not tidying. test_process_warning asserts that # process.extractOne logs "reduces input query to empty string" to stderr and # reads it back through capsys. pytest's logging plugin installs its own root # handler, so the record is captured instead of reaching stderr and the test # sees "". The warning does fire either way -- pytest prints it under "Captured # log call" in the failure report. Disabling the plugin lets logging fall # through to stderr, which is what the test was written against, so this runs # the case properly rather than deselecting it. # # The PEP 8 case is deselected: a style check is not a test of this package, and # it would gate the build on whatever pycodestyle enforces in the buildroot, # against code upstream last touched in 2020. %pytest -q -p no:logging \ test_fuzzywuzzy.py test_fuzzywuzzy_pytest.py test_fuzzywuzzy_hypothesis.py \ --deselect 'test_fuzzywuzzy.py::StyleTests::test_pep8_conformance' %files -n python3-%{srcname} -f %{pyproject_files} %doc README.rst %changelog * Sun Sep 27 2026 Morgan Hough - 0.18.0-1 - Initial package: fuzzywuzzy 0.18.0. Net-new to Fedora. - Packaged to unblock dnacauldron, which imports it by name. Fedora has neither fuzzywuzzy nor its successor thefuzz, though it does carry rapidfuzz, which thefuzz is built on -- so if dnacauldron ever moves to thefuzz, that route is already half open. - Sourced from the GitHub tag: the sdist omits LICENSE.txt and all three test files, so from PyPI alone this could be neither licence-audited nor tested. - Requires python3-Levenshtein rather than treating it as the optional extra upstream calls it. Without it every import warns and the matcher drops to difflib. - The PEP 8 self-check is deselected; the rest of the suite runs, 71 cases. - %%check passes -p no:logging so test_process_warning can see the warning it asserts on: pytest's logging plugin otherwise captures the record before it reaches stderr, and the test reads stderr. The warning itself is correct in both cases, so this runs the test rather than skipping it.