File python-google-generativeai.spec of Package python-google-generativeai
#
# spec file for package python-google-generativeai
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-google-generativeai
Version: 0.8.2
Release: 0
Summary: Google AI Python SDK for the Gemini API
License: Apache-2.0
URL: https://github.com/google-gemini/generative-ai-python
# https://github.com/google-gemini/generative-ai-python/archive/refs/tags/v%{version}.tar.gz
Source: generative-ai-python-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
# SECTION test requirements
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module google-ai-generativelanguage == 0.6.10}
BuildRequires: %{python_module google-api-core}
BuildRequires: %{python_module google-api-python-client}
BuildRequires: %{python_module google-auth >= 2.15.0}
BuildRequires: %{python_module absl-py}
BuildRequires: %{python_module ipython}
BuildRequires: %{python_module pandas}
BuildRequires: %{python_module Pillow}
BuildRequires: %{python_module protobuf}
BuildRequires: %{python_module pydantic >= 2.0.0}
BuildRequires: %{python_module tqdm}
BuildRequires: %{python_module typing-extensions}
# /SECTION
BuildRequires: fdupes
Requires: python-google-ai-generativelanguage == 0.6.10
Requires: python-google-api-core
Requires: python-google-api-python-client
Requires: python-google-auth >= 2.15.0
Requires: python-protobuf
Requires: python-pydantic
Requires: python-tqdm
Requires: python-typing-extensions
BuildArch: noarch
%python_subpackages
%description
The Google AI Python SDK is the easiest way for Python developers to build with
the Gemini API. The Gemini API gives you access to Gemini models created by
Google DeepMind. Gemini models are built from the ground up to be multimodal,
so you can reason seamlessly across text, images, and code.
%prep
%autosetup -p1 -n generative-ai-python-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# NOTE: disable tests which required internet access: (test_create_dataset_csv-url or test_create_dataset_json-url or test_create_dataset_sheet-export-csv or test_create_dataset_sheet-share or test_create_dataset_sheet-with-tab)
# NOTE: disable "test_repr_error_info_for_chat_streaming_unexpected_stop"
# as the test is not doing ordered comparision of the dictionary which will
# lead to unexpected failure, even though the ordered ones are the same.
# NOTE: disable "test_error" test case as Python 3.12 parseargs is incompatible
# with the previous versions. Instead of raising SystemExit exception on invalid
# arguments, Python 3.12 now raise an InvalidArgument exception instead. This
# cause "test_error" test case to fail.
%pytest -k 'not (test_create_dataset_csv-url or test_create_dataset_json-url or test_create_dataset_sheet-export-csv or test_create_dataset_sheet-share or test_create_dataset_sheet-with-tab or test_repr_error_info_for_chat_streaming_unexpected_stop or test_error)'
%files %{python_files}
%{python_sitelib}/google
%{python_sitelib}/google_generativeai-%{version}.dist-info
%{python_sitelib}/google_generativeai-%{version}-*.pth
%changelog