File python-anthropic.spec of Package python-anthropic

#
# spec file for package python-anthropic
#
# 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-anthropic
Version:        0.33.1
Release:        0
Summary:        The official Python library for the anthropic API
License:        MIT
URL:            None
Source:         https://files.pythonhosted.org/packages/source/a/anthropic/anthropic-%{version}.tar.gz
Patch0:         fix-test-suite-errors.patch
Patch1:         anthropic-pr765-httpx0.28.patch
Patch2:         anthropic-pr777-httpx-remove-deprecated.patch
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module hatch-fancy-pypi-readme}
BuildRequires:  %{python_module hatchling}
BuildRequires:  %{python_module pip}
# SECTION test requirements
BuildRequires:  %{python_module anyio >= 3.5.0}
BuildRequires:  %{python_module botocore}
BuildRequires:  %{python_module boto3}
BuildRequires:  %{python_module dirty-equals}
BuildRequires:  %{python_module distro >= 1.7.0}
BuildRequires:  %{python_module httpx >= 0.23.0}
BuildRequires:  %{python_module jiter >= 0.4.0}
BuildRequires:  %{python_module pydantic >= 1.9.0}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module pytest-asyncio}
BuildRequires:  %{python_module respx}
BuildRequires:  %{python_module sniffio}
BuildRequires:  %{python_module tokenizers >= 0.13.0}
BuildRequires:  %{python_module typing-extensions >= 4.7}
# /SECTION
BuildRequires:  fdupes
Requires:       python-anyio >= 3.5.0
Requires:       python-distro >= 1.7.0
Requires:       python-httpx >= 0.23.0
Requires:       python-jiter >= 0.4.0
Requires:       python-pydantic >= 1.9.0
Requires:       python-sniffio
Requires:       python-tokenizers >= 0.13.0
Requires:       python-typing-extensions >= 4.7
BuildArch:      noarch
%python_subpackages

%description
The Anthropic Python library provides convenient access to the Anthropic REST API from any Python 3.7+
application. It includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).


%prep
%autosetup -p1 -n anthropic-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
# Makes HTTP requests
rm -r tests/api_resources/
%pytest

%files %{python_files}
%doc CHANGELOG.md README.md
%license LICENSE
%{python_sitelib}/anthropic
%{python_sitelib}/anthropic-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by