Blame python-google-cloud-dlp.spec

b146388
# F35: Do not update past 3.7.0. F35's protobuf is too old.
b146388
c9c337d
# tests are enabled by default
b146388
%bcond_without  tests
c9c337d
c9c337d
%global         srcname     google-cloud-dlp
c9c337d
%global         forgeurl    https://github.com/googleapis/python-dlp
bdefc8a
Version:        3.9.0
c9c337d
%global         tag         v%{version}
c9c337d
%forgemeta
c9c337d
c9c337d
Name:           python-%{srcname}
c9c337d
Release:        %autorelease
c9c337d
Summary:        Python SDK for Google Cloud Data Loss Prevention API
c9c337d
c9c337d
License:        ASL 2.0
c9c337d
URL:            %forgeurl
c9c337d
Source0:        %forgesource
c9c337d
c9c337d
BuildArch:      noarch
c9c337d
c9c337d
BuildRequires:  python3-devel
c9c337d
c9c337d
%if %{with tests}
c9c337d
BuildRequires:  python3dist(pytest)
c9c337d
BuildRequires:  python3dist(pytest-asyncio)
c9c337d
%endif
c9c337d
c9c337d
%global _description %{expand:
c9c337d
Cloud Data Loss Prevention (DLP) API: Provides methods for detection, risk
c9c337d
analysis, and de-identification of privacy-sensitive fragments in text, images,
c9c337d
and Google Cloud Platform storage repositories.}
c9c337d
c9c337d
%description %{_description}
c9c337d
c9c337d
c9c337d
%package -n python3-%{srcname}
c9c337d
Summary:        %{summary}
c9c337d
c9c337d
%description -n python3-%{srcname} %{_description}
c9c337d
c9c337d
# Build the libcst extras subpackage.
c9c337d
%pyproject_extras_subpkg -n python3-%{srcname} libcst
c9c337d
c9c337d
c9c337d
%prep
c9c337d
%forgeautosetup -p1
c9c337d
b146388
# Replace mock imports with unittest.mock.
b146388
grep -rl "^[[:space:]]*import mock" tests | \
b146388
    xargs sed -i -E 's/^([[:space:]]*)import mock/\1from unittest import mock/'
b146388
c9c337d
c9c337d
%generate_buildrequires
c9c337d
%pyproject_buildrequires -r
c9c337d
c9c337d
c9c337d
%build
c9c337d
%pyproject_wheel
c9c337d
c9c337d
c9c337d
%install
c9c337d
%pyproject_install
c9c337d
%pyproject_save_files google
c9c337d
c9c337d
# Remove unnecessary scripts.
c9c337d
rm -f %{buildroot}%{_bindir}/fixup*
c9c337d
c9c337d
c9c337d
%if %{with tests}
c9c337d
%check
c9c337d
%pytest --disable-warnings tests/unit
c9c337d
%endif
c9c337d
c9c337d
c9c337d
%files -n python3-%{srcname} -f %{pyproject_files}
c9c337d
%doc README.rst CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.rst SECURITY.md UPGRADING.md samples
c9c337d
%{python3_sitelib}/google_cloud_dlp-%{version}-py%{python3_version}-nspkg.pth
c9c337d
c9c337d
c9c337d
c9c337d
%changelog
c9c337d
%autochangelog