## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Run at least the handwritten tests? %bcond tests 1 %bcond minimal_tests 1 # The necessary files take a long # time (~30 minutes) to generate. %bcond full_tests 0 Name: python-fortranformat Version: 2.0.0 Release: %{autorelease} Summary: FORTRAN format interpreter for Python License: MIT URL: https://github.com/brendanarnold/py-fortranformat # The PyPI sdist lacks tests, CHANGELOG.md, etc. that are present in GitHub # source archives. There are no release tags # (https://github.com/brendanarnold/py-fortranformat/issues/32), so we must # reference a particular commit; however, since we are confident that this # commit corresponds to the PyPI release, we do not add a snapshot information # field to the Version as prescribed in # https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots. %global release_commit 07e119639746ebe1cf3016b508625d67585a052e Source: %{url}/archive/%{release_commit}/py-fortranformat-%{release_commit}.tar.gz Patch: remove-nose.patch BuildArch: noarch BuildRequires: python3-devel %if %{with tests} BuildRequires: python3-pytest %if %{with minimal_tests} || %{with full_tests} BuildRequires: make %endif %if %{with full_tests} BuildRequires: gcc-gfortran %endif %endif %global _description %{expand: Generates text from a Python list of variables or will read a line of text into Python variables according to the FORTRAN format statement passed. } %description %_description %package -n python3-fortranformat Summary: %{summary} %description -n python3-fortranformat %_description %prep %autosetup -p1 -n py-fortranformat-%{release_commit} sed -r -i 's@\bpython\b@%{python3}@' Makefile %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %if %{with tests} %if %{with minimal_tests} || %{with full_tests} %make_build buildtests %endif %if %{with full_tests} # This takes a long time! %make_build compilertests %endif %endif %install %pyproject_install %pyproject_save_files fortranformat %check %pyproject_check_import fortranformat %if %{with tests} %if %{without full_tests} && %{without minimal_tests} # At least run the hand-written tests: %pytest tests/handwritten %endif %if %{with minimal_tests} %py3_test_envvars %make_build runminimaltests %endif %if %{with full_tests} %py3_test_envvars %make_build runtests %endif %endif %files -n python3-fortranformat -f %{pyproject_files} %doc README.* %changelog ## START: Generated by rpmautospec * Fri Feb 16 2024 John Doe - 2.0.0-1 - Uncommitted changes ## END: Generated by rpmautospec