depot/third_party/nixpkgs/pkgs/development/python-modules/anthropic/default.nix
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

75 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 ];
};
}