nixpkgs/pkgs/development/python-modules/anthropic/default.nix

76 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, hatchling
, anyio
, distro
, dirty-equals
, httpx
, google-auth
, sniffio
, pydantic
, pytest-asyncio
, respx
, tokenizers
, typing-extensions
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "anthropic";
version = "0.19.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "anthropics";
repo = "anthropic-sdk-python";
rev = "refs/tags/v${version}";
hash = "sha256-D9asbwZ9puOuIK6w7cWJ2HmC3JYjamUZPOxVKWq+Va4=";
};
nativeBuildInputs = [
hatchling
];
propagatedBuildInputs = [
anyio
distro
httpx
sniffio
pydantic
tokenizers
typing-extensions
];
passthru.optional-dependencies = {
vertex = [ google-auth ];
};
nativeCheckInputs = [
dirty-equals
pytest-asyncio
pytestCheckHook
respx
];
disabledTestPaths = [
# require network access
"tests/api_resources"
];
pythonImportsCheck = [
"anthropic"
];
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 ];
};
}