From 9f5b334eb6d0f64460f14d76255b096777a46332 Mon Sep 17 00:00:00 2001
From: Ben Sima <ben@bsima.me>
Date: Tue, 4 Feb 2025 21:18:03 -0500
Subject: Update ollama, llm-ollama, openai-python, llm

I couldn't use llm-ollama because it required some package upgrades, so I
started going down that rabbit hole and ended up 1) realizing that these
packages are way out of date now, and 2) fiddling with overrides to get
everything to work. I finally figured it out, the `postPatch` in ollama-python
was throwing me off for like half a day.

Anyway, one thing to note is that these are changing fast and I need to either
move onto nixpkgs unstable for python stuff, or maintain my own builds of all of
these. Not sure which is more appropriate right now.

Oh and I had to fixup some logging stuff in Biz/Storybook.py because ruff
started complaining about something, which is weird because I don't think the
version changed? But it was easy enough to change.
---
 Omni/Bild/Deps/openai-python.nix | 99 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Omni/Bild/Deps/openai-python.nix

(limited to 'Omni/Bild/Deps/openai-python.nix')

diff --git a/Omni/Bild/Deps/openai-python.nix b/Omni/Bild/Deps/openai-python.nix
new file mode 100644
index 0000000..79db11c
--- /dev/null
+++ b/Omni/Bild/Deps/openai-python.nix
@@ -0,0 +1,99 @@
+{
+  lib,
+  buildPythonPackage,
+  pythonOlder,
+  # build-system
+  hatchling,
+  hatch-fancy-pypi-readme,
+  # dependencies
+  anyio,
+  distro,
+  httpx,
+  jiter,
+  pydantic,
+  sniffio,
+  tqdm,
+  typing-extensions,
+  numpy,
+  pandas,
+  pandas-stubs,
+  # check deps
+  pytestCheckHook,
+  dirty-equals,
+  inline-snapshot,
+  nest-asyncio,
+  pytest-asyncio,
+  pytest-mock,
+  respx,
+  sources,
+}:
+buildPythonPackage rec {
+  pname = "openai";
+  version = sources.openai-python.version;
+  pyproject = true;
+
+  disabled = pythonOlder "3.8";
+
+  src = sources.openai-python;
+
+  build-system = [
+    hatchling
+    hatch-fancy-pypi-readme
+  ];
+
+  dependencies = [
+    anyio
+    distro
+    httpx
+    jiter
+    pydantic
+    sniffio
+    tqdm
+    typing-extensions
+  ];
+
+  optional-dependencies = {
+    datalib = [
+      numpy
+      pandas
+      pandas-stubs
+    ];
+  };
+
+  pythonImportsCheck = ["openai"];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+    dirty-equals
+    inline-snapshot
+    nest-asyncio
+    pytest-asyncio
+    pytest-mock
+    respx
+  ];
+
+  pytestFlagsArray = [
+    "-W"
+    "ignore::DeprecationWarning"
+  ];
+
+  disabledTests = [
+    # Tests make network requests
+    "test_copy_build_request"
+    "test_basic_attribute_access_works"
+  ];
+
+  disabledTestPaths = [
+    # Test makes network requests
+    "tests/api_resources"
+  ];
+
+  meta = with lib; {
+    description = "Python client library for the OpenAI API";
+    homepage = "https://github.com/openai/openai-python";
+    changelog = "https://github.com/openai/openai-python/releases/tag/v${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [malo];
+    mainProgram = "openai";
+  };
+}
-- 
cgit v1.2.3