%global srcname depinfo Name: python-%{srcname} Version: 2.2.0 Release: 1%{?dist} Summary: List a package's direct dependencies and their versions License: Apache-2.0 URL: https://github.com/Midnighter/depinfo Source: %{pypi_source %{srcname}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros BuildRequires: python3-versioneer # %%check resolves pytest's dependency table as a real-world input. BuildRequires: python3-pytest %global _description %{expand: depinfo prints the direct dependencies of an installed Python package, with the versions that are installed, as a table, a Markdown list or JSON, for bug reports and for recording the environment a result was produced in. It works on any package that declares its requirements in its metadata. COBRApy uses it for `cobra.show_versions()`.} %description %_description %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{srcname}-%{version} # The build backend asks for "versioneer-518", a PyPI name for a patched # versioneer. Fedora has versioneer 0.29 as python3-versioneer; the build was # checked against it (wheel 2.2.0, version read from the sdist's _version.py). grep -q '"versioneer-518",' pyproject.toml || { echo "versioneer-518 requirement not found" >&2; exit 1; } sed -i 's/"versioneer-518",/"versioneer",/' pyproject.toml %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{srcname} %check # PyPI's sdist carries no tests, so this is a smoke test of the installed # package: the console script resolves a real package's dependency table. %pyproject_check_import PATH=%{buildroot}%{_bindir}:$PATH PYTHONPATH=%{buildroot}%{python3_sitelib} \ depinfo --help >/dev/null PATH=%{buildroot}%{_bindir}:$PATH PYTHONPATH=%{buildroot}%{python3_sitelib} \ depinfo --markdown pytest | grep -q -i pluggy %files -n python3-%{srcname} -f %{pyproject_files} %doc README.rst %{_bindir}/depinfo %changelog * Fri Oct 23 2026 Morgan Hough - 2.2.0-1 - Initial package: depinfo 2.2.0 (Apache-2.0, LICENSE). Net-new to Fedora; pure Python, no runtime dependencies on 3.8 and later. Required by COBRApy. - Build requirement "versioneer-518" is replaced by Fedora's versioneer 0.29; wheel builds and reports 2.2.0 under it.