Blame python-google-cloud-billing-budgets.spec

57bbaa8
# tests are enabled by default
57bbaa8
%bcond_without tests
57bbaa8
57bbaa8
%global         srcname     google-cloud-billing-budgets
57bbaa8
%global         forgeurl    https://github.com/googleapis/python-billingbudgets
1d33815
Version:        1.5.1
57bbaa8
%global         tag         v%{version}
57bbaa8
%forgemeta
57bbaa8
57bbaa8
Name:           python-%{srcname}
8f7354e
Release:        %autorelease
57bbaa8
Summary:        Python Client for Google Cloud Billing Budget API
57bbaa8
57bbaa8
License:        ASL 2.0
57bbaa8
URL:            %forgeurl
57bbaa8
Source0:        %forgesource
57bbaa8
Patch0:         python-google-cloud-billingbudgets-mock.patch
57bbaa8
57bbaa8
BuildArch:      noarch
57bbaa8
57bbaa8
BuildRequires:  pyproject-rpm-macros
57bbaa8
57bbaa8
%if %{with tests}
57bbaa8
BuildRequires:  python3dist(pytest)
57bbaa8
BuildRequires:  python3dist(pytest-asyncio)
57bbaa8
%endif
57bbaa8
57bbaa8
%global _description %{expand:
57bbaa8
The Google Cloud Billing Budget API stores Cloud Billing budgets, which define a
57bbaa8
budget plan and the rules to execute as spend is tracked against that plan.}
57bbaa8
57bbaa8
%description %{_description}
57bbaa8
57bbaa8
57bbaa8
%package -n python3-%{srcname}
57bbaa8
Summary:        %{summary}
8f7354e
Obsoletes:      python3-azure-sdk < 5.0.1
57bbaa8
%description -n python3-%{srcname} %{_description}
57bbaa8
57bbaa8
57bbaa8
%prep
abee3e4
%forgeautosetup -p1
57bbaa8
57bbaa8
57bbaa8
%generate_buildrequires
57bbaa8
%pyproject_buildrequires -r
57bbaa8
57bbaa8
57bbaa8
%build
57bbaa8
%pyproject_wheel
57bbaa8
57bbaa8
57bbaa8
%install
57bbaa8
%pyproject_install
57bbaa8
%pyproject_save_files google
57bbaa8
57bbaa8
# Remove unnecessary script.
57bbaa8
rm -f %{buildroot}%{_bindir}/fixup_budgets*.py
57bbaa8
57bbaa8
57bbaa8
%if %{with tests}
57bbaa8
%check
966e222
# Work around an usual pytest/PEP 420 issue where pytest can't import the
966e222
# installed module. Thanks to mhroncok for the help!
966e222
mv google{,_}
966e222
%pytest --disable-warnings tests/unit
966e222
mv google{_,}
57bbaa8
%endif
57bbaa8
57bbaa8
57bbaa8
%files -n python3-%{srcname} -f %{pyproject_files}
57bbaa8
%license LICENSE
57bbaa8
%doc README.rst CHANGELOG.md
57bbaa8
%{python3_sitelib}/google_cloud_billing_budgets-%{version}-py%{python3_version}-nspkg.pth
57bbaa8
57bbaa8
57bbaa8
%changelog
8f7354e
%autochangelog