Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python310Packages.anthropic: 0.2.10 -> 0.3.6 #244377

Merged
merged 1 commit into from
Jul 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
};
}