%global h3lib_version 4.5.0 Name: python-h3 Version: 4.5.0 Release: 1%{?dist} Summary: Python bindings for H3, a hierarchical hexagonal geospatial index # The bindings and the bundled H3 C library are both Apache-2.0. License: Apache-2.0 URL: https://github.com/uber/h3-py Source0: %{pypi_source h3} BuildRequires: python3-devel BuildRequires: gcc BuildRequires: cmake BuildRequires: ninja-build BuildRequires: python3-pytest BuildRequires: python3-numpy %global _description %{expand: H3 indexes the Earth's surface as a grid of hexagonal cells at sixteen resolutions. These bindings convert between coordinates and cells, find neighbours, rings and paths, and turn sets of cells into polygons.} %description %{_description} %package -n python3-h3 Summary: %{summary} # h3-py calls cellsToMultiPolygon and destroyGeoMultiPolygon through H3's # internal header cellsToMultiPoly.h, which Fedora's h3-devel (4.4.1) does # not install, so the extension links its own static copy of the C library. Provides: bundled(h3) = %{h3lib_version} %description -n python3-h3 %{_description} %prep %autosetup -n h3-%{version} test "$(cat src/h3lib/VERSION)" = "%{h3lib_version}" %generate_buildrequires %pyproject_buildrequires %build # scikit-build-core strips installed binaries by default, which leaves # nothing for debuginfo; RPM strips them itself. export SKBUILD_INSTALL_STRIP=false %pyproject_wheel %install %pyproject_install # The bundled C library's own install rules put its static archive, header # and CMake/pkg-config files in the wheel; the extension is already linked. rm -r %{buildroot}%{python3_sitearch}/include %{buildroot}%{python3_sitearch}/lib* # No License-File (PEP 639) in the metadata. %pyproject_save_files -L h3 %check %pyproject_check_import # tests/test_cython compiles extra Cython modules against the install. # addopts asks for pytest-cov. %pytest tests/test_lib -o addopts="" %files -n python3-h3 -f %{pyproject_files} # src/h3lib/LICENSE is the same Apache-2.0 text. %license LICENSE %doc readme.md %changelog * Sat Oct 31 2026 Morgan Hough - 4.5.0-1 - Initial package