%global pypi_name refleak Name: python-%{pypi_name} Version: 0.2.2 Release: 1%{?dist} Summary: Find what still holds a reference to an object that should be dead License: BSD-3-Clause URL: https://github.com/mne-tools/refleak Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-setuptools_scm # %%check runs upstream's own suite, which ships inside the package. BuildRequires: python3-pytest %global _description %{expand: refleak helps track down reference leaks: given an object that should have been collected, it reports what is still holding a reference to it. It also provides pytest helpers for asserting that no instances of a type survive a test.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{pypi_name}-%{version} -p1 %generate_buildrequires # setuptools_scm derives the version from git metadata, which a PyPI sdist has # none of. It can fall back to PKG-INFO, but pinning it is deterministic and # costs nothing. export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_buildrequires %build export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_wheel %install export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_install %pyproject_save_files -l %{pypi_name} %check %pyproject_check_import # Upstream ships its tests inside the package (refleak/testing/tests), so unlike # most of the Python stack here they can be run against the INSTALLED module # rather than the source tree. --pyargs does exactly that. -o addopts= drops # upstream's coverage flags, which need pytest-cov and mean nothing in a package # build. %pytest -o addopts= --pyargs %{pypi_name} %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.rst %license LICENSE %changelog * Mon Sep 14 2026 Morgan Hough - 0.2.2-1 - Initial package. refleak is the one thing standing between python-mne and a real test suite: mne/conftest.py does an unconditional "from refleak.testing import Snapshot, assert_no_instances, gc_collect_once", and it is mne's *root* conftest, so pytest loads it for any selection -- verified in mock that even a single test file dies at collection without it. Fedora does not package refleak, which is why python-mne currently ships with %%pyproject_check_import as its %%check instead of the upstream suite. - Pure Python, no runtime dependencies, and upstream classifies for 3.14. - %%check runs upstream's suite against the installed module via "%%pytest --pyargs refleak". That is possible here, and unusual: refleak ships its tests inside the package rather than excluding them from the wheel.