From 707c36253b03763353422361b3c40f108adc02119a3e368033efca2cb903ecc8 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 26 Jan 2024 22:19:48 +0000 Subject: [PATCH] Accepting request 1141752 from home:mcalabkova:branches:devel:languages:python - Update to 1.10.0 * Auto-retry with backoff if there's an error * Proper types (for mypy/pyright/editors) * You can now instantiate a client, instead of using a global default. * Switch to explicit client instantiation * Weights and Biases CLI will now be included in their own package * many more smaller changes, see https://github.com/openai/openai-python/blob/main/CHANGELOG.md - Use an upstream tarball and run at least some tests OBS-URL: https://build.opensuse.org/request/show/1141752 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-openai?expand=0&rev=6 --- openai-0.27.8.tar.gz | 3 --- openai-1.10.0.tar.gz | 3 +++ python-openai.changes | 12 ++++++++++++ python-openai.spec | 35 ++++++++++++++++++++++++++--------- 4 files changed, 41 insertions(+), 12 deletions(-) delete mode 100644 openai-0.27.8.tar.gz create mode 100644 openai-1.10.0.tar.gz diff --git a/openai-0.27.8.tar.gz b/openai-0.27.8.tar.gz deleted file mode 100644 index 51767a0..0000000 --- a/openai-0.27.8.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2483095c7db1eee274cebac79e315a986c4e55207bb4fa7b82d185b3a2ed9536 -size 60012 diff --git a/openai-1.10.0.tar.gz b/openai-1.10.0.tar.gz new file mode 100644 index 0000000..76b5911 --- /dev/null +++ b/openai-1.10.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed658cd629add79dd692926bc6f08fa368b0080c59a25c482b70d6aaf35c52b8 +size 175912 diff --git a/python-openai.changes b/python-openai.changes index 4f0cdb0..aa90337 100644 --- a/python-openai.changes +++ b/python-openai.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Jan 26 12:54:53 UTC 2024 - Markéta Machová , Module Updater + +- Update to 1.10.0 + * Auto-retry with backoff if there's an error + * Proper types (for mypy/pyright/editors) + * You can now instantiate a client, instead of using a global default. + * Switch to explicit client instantiation + * Weights and Biases CLI will now be included in their own package + * many more smaller changes, see https://github.com/openai/openai-python/blob/main/CHANGELOG.md +- Use an upstream tarball and run at least some tests + ------------------------------------------------------------------- Mon Jul 24 20:18:16 UTC 2023 - Dirk Müller diff --git a/python-openai.spec b/python-openai.spec index 8c89609..ec77acd 100644 --- a/python-openai.spec +++ b/python-openai.spec @@ -1,7 +1,7 @@ # # spec file for package python-openai # -# Copyright (c) 2023 SUSE LLC +# 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 @@ -19,25 +19,38 @@ %define skip_python2 1 %define skip_python36 1 Name: python-openai -Version: 0.27.8 +Version: 1.10.0 Release: 0 Summary: OpenAI bindings for python License: MIT Group: Development/Languages/Python URL: https://github.com/openai/openai-python -Source: https://files.pythonhosted.org/packages/source/o/openai/openai-%{version}.tar.gz -BuildRequires: %{python_module aiohttp} +Source: https://github.com/openai/openai-python/archive/refs/tags/v%{version}.tar.gz#/openai-%{version}.tar.gz +BuildRequires: %{python_module anyio} +BuildRequires: %{python_module dirty-equals} +BuildRequires: %{python_module distro} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module httpx} BuildRequires: %{python_module pip} BuildRequires: %{python_module poetry} +BuildRequires: %{python_module pydantic} BuildRequires: %{python_module pytest >= 3.5} +BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest-mock} +BuildRequires: %{python_module respx} +BuildRequires: %{python_module sniffio} BuildRequires: %{python_module tqdm} +BuildRequires: %{python_module typing_extensions} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-aiohttp -Requires: python-requests >= 2.20 -Requires: python-tqdm +Requires: python-anyio >= 3.5.0 +Requires: python-distro >= 1.7.0 +Requires: python-httpx >= 0.23.0 +Requires: python-pydantic >= 1.9.0 +Requires: python-sniffio +Requires: python-tqdm > 4 +Requires: python-typing_extensions Requires(post): update-alternatives Requires(postun):update-alternatives BuildArch: noarch @@ -55,7 +68,7 @@ You can find usage examples for the OpenAI Python library in https://github.com/openai/openai-cookbook/. %prep -%autosetup -p1 -n openai-%{version} +%autosetup -p1 -n openai-python-%{version} %build %pyproject_wheel @@ -65,7 +78,11 @@ You can find usage examples for the OpenAI Python library in %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/openai -# test suite only works with network and registered API key +%check +# most of tests/api_resources need registered API key +# test_streaming_response needs network connection +# test_copy_build_request needs "warmed up" machinery and OBS starts always fresh +%pytest --ignore "tests/api_resources" -k "not (test_streaming_response or test_copy_build_request)" %post %python_install_alternative openai