File python-unstructured-client.spec of Package python-unstructured-client
#
# spec file for package python-unstructured-client
#
# 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/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-unstructured-client%{?psuffix}
Version: 0.25.9
Release: 0
Summary: Python Client SDK for Unstructured API
License: MIT
URL: https://github.com/Unstructured-IO/unstructured-python-client
Source: %{url}/archive/v%{version}.tar.gz#/unstructured-client-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
%if %{with test}
BuildRequires: %{python_module certifi >= 2023.7.22}
BuildRequires: %{python_module charset-normalizer >= 3.2.0}
BuildRequires: %{python_module dataclasses-json >= 0.6.4}
BuildRequires: %{python_module deepdiff >= 6.0}
BuildRequires: %{python_module httpx >= 0.27.0}
BuildRequires: %{python_module idna >= 3.4}
BuildRequires: %{python_module jsonpath-python >= 1.0.6}
BuildRequires: %{python_module marshmallow >= 3.19.0}
BuildRequires: %{python_module mypy_extensions >= 1.0.0}
BuildRequires: %{python_module nest-asyncio >= 1.6.0}
BuildRequires: %{python_module packaging >= 23.1}
BuildRequires: %{python_module pypdf >= 4.0}
BuildRequires: %{python_module python-dateutil >= 2.8.2}
BuildRequires: %{python_module requests >= 2.31.0}
BuildRequires: %{python_module requests-toolbelt >= 1.0.0}
BuildRequires: %{python_module six >= 1.16.0}
BuildRequires: %{python_module typing-inspect >= 0.9.0}
BuildRequires: %{python_module typing_extensions >= 4.7.1}
BuildRequires: %{python_module unstructured-client = %{version}}
BuildRequires: %{python_module urllib3 >= 1.26.18}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module requests-mock}
%endif
BuildRequires: fdupes
Requires: python-certifi >= 2023.7.22
Requires: python-charset-normalizer >= 3.2.0
Requires: python-dataclasses-json >= 0.6.4
Requires: python-deepdiff >= 6.0
Requires: python-httpx >= 0.27.0
Requires: python-idna >= 3.4
Requires: python-jsonpath-python >= 1.0.6
Requires: python-marshmallow >= 3.19.0
Requires: python-mypy_extensions >= 1.0.0
Requires: python-nest-asyncio >= 1.6.0
Requires: python-packaging >= 23.1
Requires: python-pypdf >= 4.0
Requires: python-python-dateutil >= 2.8.2
Requires: python-requests >= 2.31.0
Requires: python-requests-toolbelt >= 1.0.0
Requires: python-six >= 1.16.0
Requires: python-typing-inspect >= 0.9.0
Requires: python-typing_extensions >= 4.7.1
Requires: python-urllib3 >= 1.26.18
BuildArch: noarch
%python_subpackages
%description
Python Client SDK for Unstructured API
%prep
%autosetup -p1 -n unstructured-python-client-%{version}
%if !%{with test}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%else
mv _test_unstructured_client/unit_utils.py _test_unstructured_client/unit/unit_utils.py
sed -i -e 's/from _test_unstructured_client\.unit_utils/from unit_utils/' _test_unstructured_client/unit/test_custom_hooks.py
%endif
%if %{with test}
%check
%pytest _test_unstructured_client -v -k "unit"
# Integration tests require unstructured-api running on localhost:8000
#%%pytest _test_unstructured_client -v -k "integration" --maxfail=1
%endif
%if !%{with test}
%files %{python_files}
%doc README.md
%license LICENSE.md
%{python_sitelib}/unstructured_client
%{python_sitelib}/unstructured_client-%{version}.dist-info
%endif
%changelog