fc60d6f
%bcond tests 1
39ab8c4
39ab8c4
%global _description %{expand:
39ab8c4
The library implements the Trie data structure. The trie variable is a
39ab8c4
dict-like object that can have Unicode keys of certain ranges and Python
39ab8c4
objects as values.
39ab8c4
39ab8c4
In addition to implementing the mapping interface, the library tries to
39ab8c4
facilitate finding the items for a given prefix, and vice versa, finding the
39ab8c4
items whose keys are prefixes of a given string. As a common special case,
39ab8c4
finding the longest-prefix item is also supported.}
39ab8c4
7aafcfb
Name:           python-datrie
39ab8c4
Version:        0.8.2
523e136
Release:        %autorelease
39ab8c4
Summary:        Super-fast, efficiently stored Trie for Python
39ab8c4
106460d
License:        LGPL-2.1-or-later
7aafcfb
URL:            https://github.com/pytries/datrie
7aafcfb
Source:         %{pypi_source datrie}
f1f1378
# BUGFIX: Decode string based on byteorder of system
f1f1378
# https://github.com/pytries/datrie/pull/85
f1f1378
#
f1f1378
# Fixes:
f1f1378
#
f1f1378
# UnicodeDecodeError: 'utf32' codec can't decode bytes in position 0-3: code
f1f1378
# point not in range(0x110000)
39ab8c4
# https://github.com/pytries/datrie/issues/38
0a52485
Patch:          %{url}/pull/85.patch
0a52485
# Fix AlphaMap definition in cdatrie.pxd
0a52485
# Fixes failure to compile on GCC with -Werror=incompatible-pointer-types.
0a52485
# https://github.com/pytries/datrie/pull/99
0a52485
#
0a52485
# Fixes:
0a52485
#
0a52485
# python-datrie: FTBFS in Fedora rawhide/f40
0a52485
# https://bugzilla.redhat.com/show_bug.cgi?id=2261554
0a52485
Patch:          %{url}/pull/99.patch
39ab8c4
19d867e
BuildRequires:  python3-devel
39ab8c4
39ab8c4
BuildRequires:  gcc-c++
39ab8c4
BuildRequires:  libdatrie
39ab8c4
19d867e
%description %_description
39ab8c4
19d867e
%package -n python3-datrie
19d867e
Summary:        %{summary}
39ab8c4
7aafcfb
%description -n python3-datrie %_description
39ab8c4
39ab8c4
%prep
7aafcfb
%autosetup -p1 -n datrie-%{version}
39ab8c4
39ab8c4
# use system's libdatrie
1090ef1
sed -r -i -e 's@\.\./libdatrie/@@g' src/cdatrie.pxd
39ab8c4
19d867e
%generate_buildrequires
19d867e
%pyproject_buildrequires -t
19d867e
39ab8c4
%build
19d867e
%pyproject_wheel
39ab8c4
39ab8c4
%install
19d867e
%pyproject_install
7691b7a
%pyproject_save_files -l datrie
39ab8c4
39ab8c4
%check
39ab8c4
%if %{with tests}
19d867e
%tox
39ab8c4
%endif
39ab8c4
19d867e
%files -n python3-datrie -f %{pyproject_files}
39ab8c4
%doc README.rst
39ab8c4
39ab8c4
%changelog
523e136
%autochangelog