Blame python-google-cloud-api-gateway.spec

b15af7f
# tests are enabled by default
b15af7f
%bcond_without tests
b15af7f
b15af7f
%global         srcname     google-cloud-api-gateway
b15af7f
%global         forgeurl    https://github.com/googleapis/python-api-gateway
b15af7f
Version:        1.0.4
b15af7f
%global         tag         v%{version}
b15af7f
%forgemeta
b15af7f
b15af7f
Name:           python-%{srcname}
b15af7f
Release:        %autorelease
b15af7f
Summary:        Python Client for Google Cloud API Gateway
b15af7f
b15af7f
License:        ASL 2.0
b15af7f
URL:            %forgeurl
b15af7f
Source0:        %forgesource
b15af7f
Patch0:         python-google-cloud-api-gateway-mock.patch
b15af7f
b15af7f
BuildArch:      noarch
b15af7f
b15af7f
BuildRequires:  pyproject-rpm-macros
b15af7f
b15af7f
%if %{with tests}
b15af7f
BuildRequires:  python3dist(pytest)
b15af7f
BuildRequires:  python3dist(pytest-asyncio)
b15af7f
%endif
b15af7f
b15af7f
%global _description %{expand:
b15af7f
API Gateway allows you to create, secure, and monitor APIs for Google Cloud
b15af7f
serverless back ends, including Cloud Functions, Cloud Run, and App Engine.
b15af7f
Built on Envoy, API Gateway gives you high performance, scalability, and the
b15af7f
freedom to focus on building great apps.}
b15af7f
b15af7f
%description %{_description}
b15af7f
b15af7f
b15af7f
%package -n python3-%{srcname}
b15af7f
Summary:        %{summary}
b15af7f
b15af7f
%description -n python3-%{srcname} %{_description}
b15af7f
b15af7f
b15af7f
%package -n python3-%{srcname}-doc
b15af7f
Requires:       python3-docs
b15af7f
BuildRequires:  python3-docs
b15af7f
BuildRequires:  python3dist(recommonmark)
b15af7f
BuildRequires:  python3dist(sphinx)
b15af7f
Summary:        Documentation for python-%{srcname}
b15af7f
b15af7f
%description -n python3-%{srcname}-doc
b15af7f
Documentation for python-%{srcname}
b15af7f
b15af7f
b15af7f
%prep
b15af7f
%forgeautosetup -p1
b15af7f
b15af7f
b15af7f
%generate_buildrequires
b15af7f
%pyproject_buildrequires -r
b15af7f
b15af7f
b15af7f
%build
b15af7f
%pyproject_wheel
b15af7f
b15af7f
# Generate documentation.
b15af7f
PYTHONPATH="${PWD}:${PWD}/docs/" sphinx-build docs html %{?_smp_mflags}
b15af7f
rm -rf html/.{doctrees,buildinfo}
b15af7f
b15af7f
b15af7f
%install
b15af7f
%pyproject_install
b15af7f
%pyproject_save_files google
b15af7f
b15af7f
b15af7f
%if %{with tests}
b15af7f
%check
b15af7f
# Work around an usual pytest/PEP 420 issue where pytest can't import the
b15af7f
# installed module. Thanks to mhroncok for the help!
b15af7f
mv google{,_}
b15af7f
%pytest --disable-warnings tests/unit
b15af7f
mv google{_,}
b15af7f
%endif
b15af7f
b15af7f
b15af7f
%files -n python3-%{srcname} -f %{pyproject_files}
b15af7f
%license LICENSE
b15af7f
%doc README.rst CHANGELOG.md
b15af7f
%{python3_sitelib}/google_cloud_api_gateway-%{version}-py%{python3_version}-nspkg.pth
b15af7f
b15af7f
b15af7f
%files -n python3-%{srcname}-doc
b15af7f
%license LICENSE
b15af7f
%doc html
b15af7f
b15af7f
b15af7f
%changelog
b15af7f
%autochangelog