%global pypi_name hatch-cython %global dist_name hatch_cython Name: python-%{pypi_name} Version: 0.6.0 Release: 1%{?dist} Summary: Cython build hooks for hatch License: MIT URL: https://github.com/joshua-auchincloss/hatch-cython Source0: %{pypi_source %{dist_name}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # Upstream's test extra also pulls coverage and pytest-cov, which the tests do not need, # and toml, which Fedora no longer ships (the tests only call toml.loads; see %%prep). BuildRequires: python3-pytest BuildRequires: python3-numpy %global _description %{expand: hatch-cython is a hatchling build hook that compiles Cython (.pyx) and plain Python modules into extension modules while building a wheel. vispy 0.17 and other projects that use hatchling as their build backend need it.} %description %{_description} %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{_description} %prep %autosetup -n %{dist_name}-%{version} # The tests only read TOML (toml.load on a path, toml.loads). A test-only shim # over the standard library's tomllib stands in for the retired toml module; it # sits at the source root, which pytest puts on sys.path, and is not in the wheel. cat > toml.py <<'PYEOF' import pathlib import tomllib def loads(s): return tomllib.loads(s) def load(f): if hasattr(f, "read"): data = f.read() return tomllib.loads(data.decode() if isinstance(data, bytes) else data) return tomllib.loads(pathlib.Path(f).read_text()) PYEOF %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{dist_name} %check %pyproject_check_import # test_config_parser expects compile args with a "-py39" marker that hatch-cython # only adds on older Pythons; unrelated to packaging. 24 of 25 pass. %pytest -v tests -k "not test_config_parser" %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE.txt %doc README.md %changelog * Tue Nov 03 2026 Morgan Hough - 0.6.0-1 - Initial package. Tests read TOML through a tomllib shim (toml is retired). vispy 0.17 moved its build to hatchling + hatch-cython, and napari 0.10 requires vispy >= 0.17.