Blame python-google-cloud-pubsub.spec

a77960d
%bcond_without  tests
dc183b0
dc183b0
%global         srcname     google-cloud-pubsub
dc183b0
%global         forgeurl    https://github.com/googleapis/python-pubsub
a77960d
Version:        2.14.1
dc183b0
%global         tag         v%{version}
dc183b0
%forgemeta
dc183b0
dc183b0
Name:           python-%{srcname}
dc183b0
Release:        %autorelease
dc183b0
Summary:        Google Cloud Pub/Sub API client library
dc183b0
a77960d
License:        Apache-2.0
dc183b0
URL:            %forgeurl
dc183b0
Source0:        %forgesource
dc183b0
dc183b0
BuildArch:      noarch
dc183b0
dc183b0
BuildRequires:  python3-devel
dc183b0
dc183b0
%if %{with tests}
dc183b0
BuildRequires:  python3dist(pytest)
abd44b5
BuildRequires:  python3dist(pytest-asyncio)
dc183b0
%endif
dc183b0
dc183b0
%global _description %{expand:
dc183b0
Google Cloud Pub/Sub API client library.}
dc183b0
dc183b0
%description %{_description}
dc183b0
dc183b0
dc183b0
%package -n python3-%{srcname}
dc183b0
Summary:        %{summary}
dc183b0
dc183b0
%description -n python3-%{srcname} %{_description}
dc183b0
dc183b0
# Build the libcst extras subpackage.
dc183b0
%pyproject_extras_subpkg -n python3-%{srcname} libcst
dc183b0
dc183b0
dc183b0
%prep
dc183b0
%forgeautosetup
dc183b0
dc183b0
dc183b0
%generate_buildrequires
dc183b0
%pyproject_buildrequires
dc183b0
dc183b0
dc183b0
%build
dc183b0
%pyproject_wheel
dc183b0
dc183b0
dc183b0
%install
dc183b0
%pyproject_install
dc183b0
%pyproject_save_files google
dc183b0
dc183b0
# Remove unnecessary script.
dc183b0
rm -f %{buildroot}%{_bindir}/fixup_pubsub_v1_keywords.py
dc183b0
dc183b0
dc183b0
%check
a77960d
%pyproject_check_import
a77960d
a77960d
%if %{with tests}
a77960d
# NOTE(mhayden): Setting PYTHONUSERBASE as a hack for PEP 420 namespaces.
a77960d
# Thanks to churchyard for the fix.
a77960d
PYTHONUSERBASE=%{buildroot}%{_prefix} \
abd44b5
    %pytest tests/unit -k "not test_resume_publish"
dc183b0
%endif
dc183b0
dc183b0
dc183b0
%files -n python3-%{srcname} -f %{pyproject_files}
dc183b0
%doc CHANGELOG.md CODE_OF_CONDUCT.md README.rst SECURITY.md
dc183b0
%{python3_sitelib}/google_cloud_pubsub-%{version}-py%{python3_version}-nspkg.pth
dc183b0
dc183b0
dc183b0
%changelog
dc183b0
%autochangelog