# linetimer -- a tiny context manager (CodeTimer) that prints how long a block # took. New to Fedora. babelbrain imports it in Step 1 (BabelDatasetPreps, # CTZTEProcessing), Step 2 (TranscranialModeling) and Step 3 # (ThermalModeling), unconditionally, so nothing in BabelBrain runs without it. # # Upstream is a 2020-era setup.py project (last release 0.1.5, 2021). Its sdist # omits the Readme.md that setup.py opens for long_description, so the build # would die in %%build; %%prep writes a one-line stand-in. %global pypi_name linetimer Name: python-%{pypi_name} Version: 0.1.5 Release: 1%{?dist} Summary: Measure the time taken by an indented block of Python code License: MIT URL: https://github.com/justasb/linetimer Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: linetimer provides CodeTimer, a context manager and decorator that measures and prints the time spent in a block of code, with a name, a unit and an optional logger.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -p1 -n %{pypi_name}-%{version} # setup.py reads Readme.md, which the sdist does not contain. test ! -e Readme.md echo '%{summary}.' > Readme.md %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} %check %pyproject_check_import cd / PYTHONPATH=%{buildroot}%{python3_sitelib} %{python3} -c ' from linetimer import CodeTimer with CodeTimer("block", unit="s"): sum(range(1000))' %files -n python3-%{pypi_name} -f %{pyproject_files} %changelog * Sun Oct 11 2026 Morgan Hough - 0.1.5-1 - Initial package, for babelbrain Steps 1 to 3.