## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## 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 %bcond_without tests Name: python-lazy-loader Version: 0.1~rc2 Release: %autorelease Summary: Populate library namespace without incurring immediate import costs License: BSD URL: https://github.com/scientific-python/lazy_loader # The GitHub tarball contains tests; the PyPI sdist does not. %global pypi_version %(echo '%{version}' | tr -d '~') Source0: %{url}/archive/%{pypi_version}/lazy_loader-%{pypi_version}.tar.gz BuildArch: noarch BuildRequires: python3-devel %if %{with tests} # The “test” extra includes unwanted linters, etc.; we manually BR pytest # rather than patching out all the others from pyproject.toml. BuildRequires: python3dist(pytest) # These are required for some of the tests, but are not captured in the # metadata, so we must BR them manually as well: BuildRequires: python3dist(numpy) BuildRequires: python3dist(scipy) %endif %global common_description %{expand: \ lazy-loader makes it easy to load subpackages and functions on demand. Motivation: • Allow subpackages to be made visible to users without incurring import costs. • Allow external libraries to be imported only when used, improving import times.} %description %{common_description} %package -n python3-lazy-loader Summary: %{summary} %description -n python3-lazy-loader %{common_description} %prep %autosetup -n lazy_loader-%{pypi_version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files lazy_loader %check %if %{with tests} %pytest %else %pyproject_check_import %endif %files -n python3-lazy-loader -f %{pyproject_files} %license LICENSE.md %doc CONTRIBUTOR.md %doc README.md %changelog * Sat Apr 30 2022 Benjamin A. Beasley - 0.1~rc2-1 - Initial package (close RHBZ#2077429)