Blame python-google-cloud-datacatalog.spec

c227c53
%bcond_without tests
c227c53
c227c53
%global         srcname     google-cloud-datacatalog
c227c53
%global         forgeurl    https://github.com/googleapis/python-datacatalog
661fce7
Version:        3.11.1
c227c53
%global         tag         v%{version}
c227c53
%forgemeta
c227c53
c227c53
Name:           python-%{srcname}
c227c53
Release:        %autorelease
c227c53
Summary:        Python SDK for Google Cloud Data Catalog API
c227c53
661fce7
License:        Apache-2.0
c227c53
URL:            %forgeurl
c227c53
Source0:        %forgesource
c227c53
c227c53
BuildArch:      noarch
c227c53
c227c53
BuildRequires:  python3-devel
c227c53
c227c53
%if %{with tests}
c227c53
BuildRequires:  python3dist(pytest)
c227c53
BuildRequires:  python3dist(pytest-asyncio)
c227c53
%endif
c227c53
c227c53
%global _description %{expand:
c227c53
Google Cloud Data Catalog API: Google Cloud Data Catalog API provides features
c227c53
to attach metadata to Google Cloud Platform resources like BigQuery Tables. Key
c227c53
critical resources include: Entries (Data Catalog representation of a cloud
c227c53
resource).}
c227c53
c227c53
%description %{_description}
c227c53
c227c53
c227c53
%package -n python3-%{srcname}
c227c53
Summary:        %{summary}
c227c53
c227c53
%description -n python3-%{srcname} %{_description}
c227c53
c227c53
c227c53
%package -n python-%{srcname}-doc
c227c53
Summary:        Documentation for %{name}
c227c53
c227c53
%description -n python-%{srcname}-doc
c227c53
Documentation for python-%{srcname}.
c227c53
c227c53
c227c53
%prep
c227c53
%forgeautosetup -p1
c227c53
c227c53
c227c53
%generate_buildrequires
661fce7
%pyproject_buildrequires
c227c53
c227c53
c227c53
%build
c227c53
%pyproject_wheel
c227c53
c227c53
c227c53
%install
c227c53
%pyproject_install
c227c53
%pyproject_save_files google
c227c53
c227c53
# Remove unnecessary scripts.
c227c53
rm -f %{buildroot}%{_bindir}/fixup*
c227c53
c227c53
c227c53
%check
661fce7
%pyproject_check_import
661fce7
661fce7
%if %{with tests}
661fce7
# NOTE(mhayden): Setting PYTHONUSERBASE as a hack for PEP 420 namespaces.
661fce7
# Thanks to churchyard for the fix.
661fce7
PYTHONUSERBASE=%{buildroot}%{_prefix} \
661fce7
    %pytest tests/unit
c227c53
%endif
c227c53
c227c53
c227c53
%files -n python3-%{srcname} -f %{pyproject_files}
c227c53
%doc README.rst CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.rst SECURITY.md UPGRADING.md
c227c53
%{python3_sitelib}/google_cloud_datacatalog-%{version}-py%{python3_version}-nspkg.pth
c227c53
c227c53
c227c53
%files -n python-%{srcname}-doc
c227c53
%doc samples
c227c53
c227c53
c227c53
%changelog
c227c53
%autochangelog