Blame python-google-cloud-appengine-admin.spec

a22d4b6
# tests are enabled by default
a22d4b6
%bcond_without tests
a22d4b6
a22d4b6
%global         srcname     google-cloud-appengine-admin
a22d4b6
%global         forgeurl    https://github.com/googleapis/python-appengine-admin
324d6c6
Version:        1.2.0
a22d4b6
%global         tag         v%{version}
a22d4b6
%forgemeta
a22d4b6
a22d4b6
Name:           python-%{srcname}
a22d4b6
Release:        %autorelease
a22d4b6
Summary:        Python Client for Google Cloud App Engine Admin
a22d4b6
a22d4b6
License:        ASL 2.0
a22d4b6
URL:            %forgeurl
a22d4b6
Source0:        %forgesource
a22d4b6
Patch0:         python-google-cloud-appengine-admin-mock.patch
a22d4b6
a22d4b6
BuildArch:      noarch
a22d4b6
a22d4b6
BuildRequires:  pyproject-rpm-macros
a22d4b6
a22d4b6
%if %{with tests}
a22d4b6
BuildRequires:  python3dist(pytest)
a22d4b6
BuildRequires:  python3dist(pytest-asyncio)
a22d4b6
%endif
a22d4b6
a22d4b6
%global _description %{expand:
a22d4b6
App Engine Admin allows you to manage your App Engine applications.}
a22d4b6
a22d4b6
%description %{_description}
a22d4b6
a22d4b6
a22d4b6
%package -n python3-%{srcname}
a22d4b6
Summary:        %{summary}
a22d4b6
a22d4b6
%description -n python3-%{srcname} %{_description}
a22d4b6
a22d4b6
a22d4b6
%package -n python3-%{srcname}-doc
a22d4b6
Requires:       python3-docs
a22d4b6
BuildRequires:  python3-docs
a22d4b6
BuildRequires:  python3dist(recommonmark)
a22d4b6
BuildRequires:  python3dist(sphinx)
a22d4b6
Summary:        Documentation for python-%{srcname}
a22d4b6
a22d4b6
%description -n python3-%{srcname}-doc
a22d4b6
Documentation for python-%{srcname}
a22d4b6
a22d4b6
a22d4b6
%prep
a22d4b6
%forgeautosetup -p1
a22d4b6
a22d4b6
a22d4b6
%generate_buildrequires
a22d4b6
%pyproject_buildrequires -r
a22d4b6
a22d4b6
a22d4b6
%build
a22d4b6
%pyproject_wheel
a22d4b6
a22d4b6
# Generate documentation.
a22d4b6
PYTHONPATH="${PWD}:${PWD}/docs/" sphinx-build docs html %{?_smp_mflags}
a22d4b6
rm -rf html/.{doctrees,buildinfo}
a22d4b6
a22d4b6
a22d4b6
%install
a22d4b6
%pyproject_install
a22d4b6
%pyproject_save_files google
a22d4b6
a22d4b6
# Remove unneeded executable.
a22d4b6
rm -f %{buildroot}%{_bindir}/fixup_accessapproval_v1_keywords.py
a22d4b6
a22d4b6
a22d4b6
%if %{with tests}
a22d4b6
%check
a22d4b6
# Work around an usual pytest/PEP 420 issue where pytest can't import the
a22d4b6
# installed module. Thanks to mhroncok for the help!
a22d4b6
mv google{,_}
a22d4b6
%pytest --disable-warnings tests/unit
a22d4b6
mv google{_,}
a22d4b6
%endif
a22d4b6
a22d4b6
a22d4b6
%files -n python3-%{srcname} -f %{pyproject_files}
a22d4b6
%license LICENSE
a22d4b6
%doc README.rst CHANGELOG.md
a22d4b6
%{python3_sitelib}/google_cloud_appengine_admin-%{version}-py%{python3_version}-nspkg.pth
a22d4b6
a22d4b6
a22d4b6
%files -n python3-%{srcname}-doc
a22d4b6
%license LICENSE
a22d4b6
%doc html
a22d4b6
a22d4b6
a22d4b6
%changelog
a22d4b6
%autochangelog