Blame python-google-cloud-debugger-client.spec

1faa7e9
# tests are enabled by default
1faa7e9
%bcond_without tests
1faa7e9
1faa7e9
%global         srcname     google-cloud-debugger-client
1faa7e9
%global         forgeurl    https://github.com/googleapis/python-debugger-client
1faa7e9
Version:        1.3.1
1faa7e9
%global         tag         v%{version}
1faa7e9
%forgemeta
1faa7e9
1faa7e9
Name:           python-%{srcname}
1faa7e9
Release:        %autorelease
1faa7e9
Summary:        Python Client for Google Cloud Debugger API
1faa7e9
1faa7e9
License:        ASL 2.0
1faa7e9
URL:            %forgeurl
1faa7e9
Source0:        %forgesource
1faa7e9
# Use unittest.mock instead of PyPI mock
1faa7e9
# (https://fedoraproject.org/wiki/Changes/DeprecatePythonMock).
1faa7e9
#
1faa7e9
# This simple patch cannot be submitted upstream because they support
1faa7e9
# Python 3.6 and 3.7, but use AsyncMock, which was introduced to
1faa7e9
# unittest.mock in Python 3.8.
1faa7e9
Patch0:         python-google-cloud-debugger-client-mock.patch
1faa7e9
1faa7e9
BuildArch:      noarch
1faa7e9
1faa7e9
BuildRequires:  python3-devel
1faa7e9
1faa7e9
%if %{with tests}
1faa7e9
BuildRequires:  python3dist(pytest)
1faa7e9
BuildRequires:  python3dist(pytest-asyncio)
1faa7e9
%endif
1faa7e9
1faa7e9
%global _description %{expand:
1faa7e9
Cloud Debugger is a feature of Google Cloud Platform that lets you inspect
1faa7e9
the state of an application, at any code location, without stopping or
1faa7e9
slowing down the running app. Cloud Debugger makes it easier to view the
1faa7e9
application state without adding logging statements.}
1faa7e9
1faa7e9
%description %{_description}
1faa7e9
1faa7e9
1faa7e9
%package -n python3-%{srcname}
1faa7e9
Summary:        %{summary}
1faa7e9
1faa7e9
%description -n python3-%{srcname} %{_description}
1faa7e9
1faa7e9
1faa7e9
%prep
1faa7e9
%forgeautosetup -p1
1faa7e9
1faa7e9
1faa7e9
%generate_buildrequires
1faa7e9
%pyproject_buildrequires -r
1faa7e9
1faa7e9
1faa7e9
%build
1faa7e9
%pyproject_wheel
1faa7e9
1faa7e9
1faa7e9
%install
1faa7e9
%pyproject_install
1faa7e9
%pyproject_save_files google
1faa7e9
1faa7e9
1faa7e9
%if %{with tests}
1faa7e9
%check
1faa7e9
# Work around an unusual pytest/PEP 420 issue where pytest can't import the
1faa7e9
# installed module. Thanks to mhroncok for the help!
1faa7e9
mv google{,_}
1faa7e9
%pytest --disable-warnings tests/unit
1faa7e9
mv google{_,}
1faa7e9
%endif
1faa7e9
1faa7e9
1faa7e9
%files -n python3-%{srcname} -f %{pyproject_files}
1faa7e9
%license LICENSE
7b8d28f
%doc README.rst CHANGELOG.md CONTRIBUTING.rst SECURITY.md samples/
1faa7e9
%{python3_sitelib}/google_cloud_debugger_client-%{version}-py%{python3_version}-nspkg.pth
1faa7e9
1faa7e9
1faa7e9
%changelog
1faa7e9
%autochangelog