1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, hatchling
5, anyio
6, distro
7, httpx
8, pydantic
9, pytest-asyncio
10, respx
11, tokenizers
12, typing-extensions
13, pytestCheckHook
14, pythonOlder
15}:
16
17buildPythonPackage rec {
18 pname = "anthropic";
19 version = "0.5.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "anthropics";
26 repo = "anthropic-sdk-python";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-+EiFp55tPsILl6uuTh9qmeQDMKlUzegn3xUo6BupN2E=";
29 };
30
31 nativeBuildInputs = [
32 hatchling
33 ];
34
35 propagatedBuildInputs = [
36 anyio
37 distro
38 httpx
39 pydantic
40 tokenizers
41 typing-extensions
42 ];
43
44 nativeCheckInputs = [
45 pytest-asyncio
46 pytestCheckHook
47 respx
48 ];
49
50 disabledTests = [
51 "api_resources"
52 ];
53
54 pythonImportsCheck = [
55 "anthropic"
56 ];
57
58 meta = with lib; {
59 description = "Anthropic's safety-first language model APIs";
60 homepage = "https://github.com/anthropics/anthropic-sdk-python";
61 changelog = "https://github.com/anthropics/anthropic-sdk-python/releases/tag/v${version}";
62 license = licenses.mit;
63 maintainers = with maintainers; [ natsukium ];
64 };
65}