Skip to content

Commit

Permalink
python310Packages.anthropic: 0.2.10 -> 0.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
natsukium committed Jul 22, 2023
1 parent 664361e commit e89f5ff
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions pkgs/development/python-modules/anthropic/default.nix
Original file line number Diff line number Diff line change
@@ -1,43 +1,55 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, fetchFromGitHub
, poetry-core
, anyio
, distro
, httpx
, importlib-metadata
, requests
, pydantic
, pytest-asyncio
, respx
, tokenizers
, aiohttp
, typing-extensions
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
pname = "anthropic";
version = "0.2.10";
version = "0.3.6";
format = "pyproject";

disabled = pythonOlder "3.8";

src = fetchPypi {
inherit pname version;
hash = "sha256-5NoGGobY/7hgcsCw/q8hmjpPff3dQiTfm6dp5GlJjBk=";
src = fetchFromGitHub {
owner = "anthropics";
repo = "anthropic-sdk-python";
rev = "refs/tags/v${version}";
hash = "sha256-dfMlM7IRP1PG7Ynr+MR4OPeKnHBbhhWKSug7UQ4/4rI=";
};

nativeBuildInputs = [
setuptools
poetry-core
];

propagatedBuildInputs = [
anyio
distro
httpx
requests
pydantic
tokenizers
aiohttp
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
typing-extensions
];

# try downloading tokenizer in tests
# relates https://github.com/anthropics/anthropic-sdk-python/issues/24
doCheck = false;
nativeCheckInputs = [
pytest-asyncio
pytestCheckHook
respx
];

disabledTests = [
"api_resources"
];

pythonImportsCheck = [
"anthropic"
Expand All @@ -49,5 +61,6 @@ buildPythonPackage rec {
changelog = "https://github.com/anthropics/anthropic-sdk-python/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ natsukium ];
broken = lib.versionAtLeast pydantic.version "2";
};
}

0 comments on commit e89f5ff

Please sign in to comment.