about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/instructor
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-05-03 15:14:25 +0200
committerAlyssa Ross <hi@alyssa.is>2024-05-07 11:19:19 +0200
commitd92b2b6a1bbd322dd65a8b6f51019610d350046e (patch)
tree7f7c21927b9cc05676501f297c51eb76b49e326c /nixpkgs/pkgs/development/python-modules/instructor
parent93c9e56b40530cc627d921cfc255c05b495d4017 (diff)
parent49050352f602fe87d16ff7b2b6a05b79eb20dc6f (diff)
downloadnixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.gz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.bz2
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.lz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.xz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.zst
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable-small'
Conflicts:
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/instructor')
-rw-r--r--nixpkgs/pkgs/development/python-modules/instructor/default.nix71
1 files changed, 60 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/instructor/default.nix b/nixpkgs/pkgs/development/python-modules/instructor/default.nix
index 476741835116..bb36e7a8abf2 100644
--- a/nixpkgs/pkgs/development/python-modules/instructor/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/instructor/default.nix
@@ -1,24 +1,50 @@
-{ lib
-, python3
-, fetchPypi
-, buildPythonPackage
+{
+  lib,
+  aiohttp,
+  anthropic,
+  buildPythonPackage,
+  docstring-parser,
+  fetchFromGitHub,
+  openai,
+  poetry-core,
+  pydantic,
+  pytest-examples,
+  pytest-asyncio,
+  pytestCheckHook,
+  fastapi,
+  diskcache,
+  redis,
+  pythonOlder,
+  pythonRelaxDepsHook,
+  rich,
+  tenacity,
+  typer,
 }:
 
 buildPythonPackage rec {
   pname = "instructor";
-  version = "0.6.4";
+  version = "1.2.3";
   pyproject = true;
 
-  src = fetchPypi {
-    inherit pname version;
-    hash = "sha256-Af52TGnkqY/t0cPkHoRfhFqa/tuOpQXAI/fFfMTcM4Y=";
+  disabled = pythonOlder "3.9";
+
+  src = fetchFromGitHub {
+    owner = "jxnl";
+    repo = "instructor";
+    rev = "refs/tags/${version}";
+    hash = "sha256-LmorlFKIG7iPAK4pDbQqjxjiwB1md3u52B4u5WlqqTk=";
   };
 
-  nativeBuildInputs = [
-    python3.pkgs.poetry-core
+  pythonRelaxDeps = [
+    "docstring-parser"
+    "pydantic"
   ];
 
-  propagatedBuildInputs = with python3.pkgs; [
+  build-system = [ poetry-core ];
+
+  nativeBuildInputs = [ pythonRelaxDepsHook ];
+
+  dependencies = [
     aiohttp
     docstring-parser
     openai
@@ -28,8 +54,31 @@ buildPythonPackage rec {
     typer
   ];
 
+  nativeCheckInputs = [
+    anthropic
+    fastapi
+    redis
+    diskcache
+    pytest-asyncio
+    pytest-examples
+    pytestCheckHook
+  ];
+
   pythonImportsCheck = [ "instructor" ];
 
+  disabledTests = [
+    # Tests require OpenAI API key
+    "test_partial"
+    "successfully"
+  ];
+
+  disabledTestPaths = [
+    # Tests require OpenAI API key
+    "tests/test_distil.py"
+    "tests/test_new_client.py"
+    "tests/llm/"
+  ];
+
   meta = with lib; {
     description = "Structured outputs for llm";
     homepage = "https://github.com/jxnl/instructor";