%global pypi_name pybtex-apa-style # The sdist has no LICENSE file; the repository has one (MIT) at this commit. %global licence_commit 4040a6495a13ea8000ad21b7688a2069cc7711f5 Name: python-%{pypi_name} Version: 1.3 Release: 1%{?dist} Summary: APA-like citation style plugin for Pybtex License: MIT URL: https://github.com/naeka/pybtex-apa-style Source0: %{pypi_source %{pypi_name}} Source1: %{url}/raw/%{licence_commit}/LICENSE BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-pybtex BuildRequires: python3-six %global _description %{expand: Pybtex plugins that format bibliographies in an APA-like style: the "apa" formatting and label styles and the "firstlast" name style. tedana uses them to render its citation list.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} # formatting/apa.py imports six; upstream's setup.py does not declare it. Requires: python3-pybtex Requires: python3-six %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{pypi_name}-%{version} cp -p %{SOURCE1} LICENSE %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install # Upstream installs three generic top-level modules (formatting, labels, names) # and registers them as pybtex entry points; there is no package of their own. %pyproject_save_files -l formatting labels names %check # Resolve the styles through pybtex's plugin system, as tedana does, and # format a real entry. %{py3_test_envvars} %{python3} - <<'PY' from pybtex.plugin import find_plugin from pybtex.database import parse_string fmt = find_plugin('pybtex.style.formatting', 'apa')() assert find_plugin('pybtex.style.labels', 'apa') assert find_plugin('pybtex.style.names', 'firstlast') bib = parse_string('''@article{DuPre2021, author = {DuPre, Elizabeth and Salo, Taylor}, title = {TE-dependent analysis of multi-echo fMRI with tedana}, journal = {Journal of Open Source Software}, year = {2021}, volume = {6}, number = {66}, pages = {3669}}''', 'bibtex') out = list(fmt.format_entries(bib.entries.values())) assert len(out) == 1 text = out[0].text.render_as('text') print(text) assert 'DuPre' in text and '2021' in text PY %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %changelog * Fri Oct 16 2026 Morgan Hough - 1.3-1 - New package: pybtex style plugins required by tedana 26