depot/third_party/nixpkgs/pkgs/development/python-modules/anthropic/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

88 lines
1.6 KiB
Nix

{
lib,
anyio,
buildPythonPackage,
dirty-equals,
distro,
fetchFromGitHub,
google-auth,
hatch-fancy-pypi-readme,
hatchling,
httpx,
jiter,
pydantic,
pytest-asyncio,
pytestCheckHook,
pythonOlder,
respx,
sniffio,
tokenizers,
typing-extensions,
}:
buildPythonPackage rec {
pname = "anthropic";
version = "0.28.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "anthropics";
repo = "anthropic-sdk-python";
rev = "refs/tags/v${version}";
hash = "sha256-n5Vmi2frUdSbrmulopwUlIO+blkf7cANoKTaTFZQdjw=";
};
build-system = [
hatchling
hatch-fancy-pypi-readme
];
dependencies = [
anyio
distro
httpx
jiter
sniffio
pydantic
tokenizers
typing-extensions
];
passthru.optional-dependencies = {
vertex = [ google-auth ];
};
nativeCheckInputs = [
dirty-equals
pytest-asyncio
pytestCheckHook
respx
];
pythonImportsCheck = [ "anthropic" ];
disabledTests = [
# Test require network access
"test_copy_build_request"
];
disabledTestPaths = [
# Test require network access
"tests/api_resources"
];
pytestFlagsArray = [
"-W"
"ignore::DeprecationWarning"
];
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 ];
};
}