depot/third_party/nixpkgs/pkgs/development/python-modules/anthropic/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

53 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, httpx
, importlib-metadata
, requests
, tokenizers
, aiohttp
, pythonOlder
}:
buildPythonPackage rec {
pname = "anthropic";
version = "0.2.10";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-5NoGGobY/7hgcsCw/q8hmjpPff3dQiTfm6dp5GlJjBk=";
};
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
httpx
requests
tokenizers
aiohttp
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];
# try downloading tokenizer in tests
# relates https://github.com/anthropics/anthropic-sdk-python/issues/24
doCheck = false;
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 ];
};
}