File python-langchain-core.spec of Package python-langchain-core

#
# spec file for package python-langchain-core
#
# Copyright (c) 2025 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/
#

%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -%{flavor}
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name:           python-langchain-core%{psuffix}
Version:        0.3.69
Release:        0
Summary:        Building applications with LLMs through composability
License:        MIT
URL:            https://python.langchain.com
Source:         https://files.pythonhosted.org/packages/source/l/langchain-core/langchain_core-%{version}.tar.gz
# PATCH-FIX-UPSTREAM mentioned in https://github.com/langchain-ai/langchain/issues/7100 (auto-closed)
Patch:          pytest-args.patch
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pdm-backend}
BuildRequires:  %{python_module pip}
%if %{with test}
# SECTION test requirements
BuildRequires:  %{python_module blockbuster}
BuildRequires:  %{python_module freezegun}
BuildRequires:  %{python_module grandalf}
BuildRequires:  %{python_module jsonpatch >= 1.33}
BuildRequires:  %{python_module langsmith >= 0.3.45}
BuildRequires:  %{python_module langchain-core = %{version}}
BuildRequires:  %{python_module langchain-tests}
BuildRequires:  %{python_module packaging >= 23.2}
BuildRequires:  %{python_module pydantic >= 2.7.4}
BuildRequires:  %{python_module pytest-mock}
BuildRequires:  %{python_module PyYAML >= 5.3}
BuildRequires:  %{python_module tenacity}
BuildRequires:  %{python_module typing-extensions >= 4.7}
# /SECTION
%endif
BuildRequires:  fdupes
Requires:       python-jsonpatch >= 1.33
Requires:       python-langsmith >= 0.3.45
Requires:       python-packaging >= 23.2
Requires:       python-pydantic >= 2.7.4
Requires:       python-PyYAML >= 5.3
Requires:       python-tenacity
Requires:       python-typing-extensions >= 4.7
BuildArch:      noarch
%python_subpackages

%description
LangChain Core contains the base abstractions that power the rest of the LangChain ecosystem.

These abstractions are designed to be as modular and simple as possible. Examples of these abstractions include those for language models, document loaders, embedding models, vectorstores, retrievers, and more.

The benefit of having these abstractions is that any provider can implement the required interface and then easily be used in the rest of the LangChain ecosystem.

For full documentation see the [API reference](https://python.langchain.com/api_reference/core/index.html).

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

%build
%if !%{with test}
%pyproject_wheel
%endif

%install
%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif

%check
%if %{with test}
%pytest
%endif

%if !%{with test}
%files %{python_files}
%{python_sitelib}/langchain_core
%{python_sitelib}/langchain_core-%{version}.dist-info
%endif

%changelog
openSUSE Build Service is sponsored by