2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
anyio,
|
|
|
|
buildPythonPackage,
|
|
|
|
dirty-equals,
|
|
|
|
distro,
|
|
|
|
fetchFromGitHub,
|
|
|
|
google-auth,
|
|
|
|
hatch-fancy-pypi-readme,
|
|
|
|
hatchling,
|
|
|
|
httpx,
|
2024-07-27 06:49:29 +00:00
|
|
|
jiter,
|
2024-05-15 15:35:15 +00:00
|
|
|
pydantic,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
respx,
|
|
|
|
sniffio,
|
|
|
|
tokenizers,
|
|
|
|
typing-extensions,
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anthropic";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.28.1";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "anthropics";
|
|
|
|
repo = "anthropic-sdk-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-n5Vmi2frUdSbrmulopwUlIO+blkf7cANoKTaTFZQdjw=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
2023-11-16 04:20:00 +00:00
|
|
|
hatchling
|
2024-05-15 15:35:15 +00:00
|
|
|
hatch-fancy-pypi-readme
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2023-08-04 22:07:22 +00:00
|
|
|
anyio
|
|
|
|
distro
|
2023-05-24 13:37:59 +00:00
|
|
|
httpx
|
2024-07-27 06:49:29 +00:00
|
|
|
jiter
|
2024-01-02 11:29:13 +00:00
|
|
|
sniffio
|
2023-08-04 22:07:22 +00:00
|
|
|
pydantic
|
2023-05-24 13:37:59 +00:00
|
|
|
tokenizers
|
2023-08-04 22:07:22 +00:00
|
|
|
typing-extensions
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
vertex = [ google-auth ];
|
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeCheckInputs = [
|
2024-01-02 11:29:13 +00:00
|
|
|
dirty-equals
|
2023-08-04 22:07:22 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
respx
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pythonImportsCheck = [ "anthropic" ];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Test require network access
|
|
|
|
"test_copy_build_request"
|
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
disabledTestPaths = [
|
2024-05-15 15:35:15 +00:00
|
|
|
# Test require network access
|
2024-02-07 01:22:34 +00:00
|
|
|
"tests/api_resources"
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Anthropic's safety-first language model APIs";
|
|
|
|
homepage = "https://github.com/anthropics/anthropic-sdk-python";
|
|
|
|
changelog = "https://github.com/anthropics/anthropic-sdk-python/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|