Blame python-google-cloud-bigtable.spec

22da93b
# F35: Do not update past 2.8.1 because protobuf is too old.
22da93b
0d05764
# tests are enabled by default
22da93b
%bcond_without  tests
0d05764
0d05764
%global         srcname     google-cloud-bigtable
0d05764
%global         forgeurl    https://github.com/googleapis/python-bigtable
7e2f3a2
Version:        2.11.1
0d05764
%global         tag         v%{version}
0d05764
%forgemeta
0d05764
0d05764
Name:           python-%{srcname}
0d05764
Release:        %autorelease
0d05764
Summary:        Python Client for Google Cloud Bigtable API
0d05764
0d05764
License:        ASL 2.0
0d05764
URL:            %forgeurl
0d05764
Source0:        %forgesource
0d05764
0d05764
BuildArch:      noarch
0d05764
c76c89f
BuildRequires:  python3-devel
0d05764
0d05764
%if %{with tests}
0d05764
BuildRequires:  python3dist(pytest)
0d05764
BuildRequires:  python3dist(pytest-asyncio)
0d05764
%endif
0d05764
0d05764
%global _description %{expand:
0d05764
Google Cloud Bigtable is Google's NoSQL Big Data database service.}
0d05764
0d05764
%description %{_description}
0d05764
0d05764
0d05764
%package -n python3-%{srcname}
0d05764
Summary:        %{summary}
0d05764
0d05764
%description -n python3-%{srcname} %{_description}
0d05764
0d05764
0d05764
%prep
0d05764
%forgeautosetup -p1
0d05764
5bc4cce
# Replace mock imports with unittest.mock.
5bc4cce
grep -rl "^[[:space:]]*import mock" tests | \
5bc4cce
    xargs sed -i -E 's/^([[:space:]]*)import mock/\1from unittest import mock/'
5bc4cce
f8aa0d2
0d05764
%generate_buildrequires
22da93b
%pyproject_buildrequires
0d05764
0d05764
0d05764
%build
0d05764
%pyproject_wheel
0d05764
0d05764
0d05764
%install
0d05764
%pyproject_install
0d05764
%pyproject_save_files google
0d05764
0d05764
# Remove unnecessary scripts.
0d05764
rm -f %{buildroot}%{_bindir}/fixup_bigtable*.py
0d05764
0d05764
0d05764
%if %{with tests}
0d05764
%check
0d05764
# Work around an unusual pytest/PEP 420 issue where pytest can't import the
0d05764
# installed module. Thanks to mhroncok for the help!
0d05764
mv google{,_}
22da93b
%pytest tests/unit
0d05764
mv google{_,}
0d05764
%endif
0d05764
0d05764
0d05764
%files -n python3-%{srcname} -f %{pyproject_files}
0d05764
%license LICENSE
0d05764
%doc README.rst CHANGELOG.md
0d05764
%{python3_sitelib}/google_cloud_bigtable-%{version}-py%{python3_version}-nspkg.pth
0d05764
0d05764
0d05764
%changelog
0d05764
%autochangelog