Blame python-google-cloud-automl.spec

dcc1994
# tests are enabled by default
dcc1994
%bcond_without tests
dcc1994
dcc1994
%global         srcname     google-cloud-automl
dcc1994
%global         forgeurl    https://github.com/googleapis/python-automl
3e1ee42
Version:        2.7.2
dcc1994
%global         tag         v%{version}
dcc1994
%forgemeta
dcc1994
dcc1994
Name:           python-%{srcname}
dcc1994
Release:        %autorelease
dcc1994
Summary:        Python Client for Google Cloud AutoML API
dcc1994
dcc1994
License:        ASL 2.0
dcc1994
URL:            %forgeurl
dcc1994
Source0:        %forgesource
dcc1994
Patch0:         python-google-cloud-automl-mock.patch
dcc1994
dcc1994
BuildArch:      noarch
dcc1994
3e1ee42
BuildRequires:  python3-devel
dcc1994
dcc1994
%if %{with tests}
dcc1994
BuildRequires:  python3dist(google-cloud-storage)
dcc1994
BuildRequires:  python3dist(pandas)
dcc1994
BuildRequires:  python3dist(pytest)
dcc1994
BuildRequires:  python3dist(pytest-asyncio)
dcc1994
%endif
dcc1994
dcc1994
%global _description %{expand:
dcc1994
The Cloud AutoML API is a suite of machine learning products that enables
dcc1994
developers with limited machine learning expertise to train high-quality
dcc1994
models specific to their business needs, by leveraging Google’s
dcc1994
state-of-the-art transfer learning, and Neural Architecture Search technology.}
dcc1994
dcc1994
%description %{_description}
dcc1994
dcc1994
dcc1994
%package -n python3-%{srcname}
dcc1994
Summary:        %{summary}
dcc1994
dcc1994
%description -n python3-%{srcname} %{_description}
dcc1994
dcc1994
dcc1994
%prep
dcc1994
%forgeautosetup -p1
dcc1994
dcc1994
dcc1994
%generate_buildrequires
dcc1994
%pyproject_buildrequires -r
dcc1994
dcc1994
dcc1994
%build
dcc1994
%pyproject_wheel
dcc1994
dcc1994
dcc1994
%install
dcc1994
%pyproject_install
dcc1994
%pyproject_save_files google
dcc1994
dcc1994
# Remove extra scripts.
dcc1994
rm -f %{buildroot}%{_bindir}/fixup_automl*.py
dcc1994
dcc1994
dcc1994
%if %{with tests}
dcc1994
%check
dcc1994
# Work around an unusual pytest/PEP 420 issue where pytest can't import the
dcc1994
# installed module. Thanks to mhroncok for the help!
dcc1994
# NOTE(mhayden): The test_prediction_client_client_info requires some
dcc1994
# credentials which are not included in the source repo.
dcc1994
mv google{,_}
dcc1994
%pytest --disable-warnings -k "not test_prediction_client_client_info" tests/unit
dcc1994
mv google{_,}
dcc1994
%endif
dcc1994
dcc1994
dcc1994
%files -n python3-%{srcname} -f %{pyproject_files}
dcc1994
%license LICENSE
dcc1994
%doc README.rst CHANGELOG.md
dcc1994
%{python3_sitelib}/google_cloud_automl-%{version}-py%{python3_version}-nspkg.pth
dcc1994
dcc1994
dcc1994
%changelog
dcc1994
%autochangelog