Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101{ # Basic lib, buildPythonPackage, fetchFromGitHub, # Build system setuptools, # Dependencies aiohttp, requests, websocket-client, cryptography, certifi, typer, rich, httpx, httpx-sse, pyyaml, # Optional dependencies tiktoken, # Test pytestCheckHook, pytest-asyncio, pydantic, tenacity,}:
buildPythonPackage rec { pname = "dashscope"; version = "1.26.6"; pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub { owner = "dashscope"; repo = "dashscope-sdk-python"; tag = "v${version}"; hash = "sha256-4plniNvpRNIUquTRDJZonQsa4inktGS7AluxKsX+Mpg="; };
build-system = [ setuptools ];
dependencies = [ aiohttp requests websocket-client cryptography certifi typer rich httpx httpx-sse # Not listed in requirements.txt pyyaml ];
optional-dependencies = { tokenizer = [ tiktoken ]; };
# Specify the version explicitly postPatch = '' substituteInPlace setup.py \ --replace-fail "version=get_version()," "version='${version}'," '';
nativeCheckInputs = [ pytestCheckHook pytest-asyncio pydantic tenacity ] ++ optional-dependencies.tokenizer;
pythonImportsCheck = [ "dashscope" ];
disabledTests = [ # Needs network access and/or API key "TestAsyncImageSynthesisRequest" "TestAsyncRequest" "TestAsyncSessionLifecycle" "TestAsyncSessionUsage" "TestAsyncSessionWithDifferentMethods" "TestAsyncVideoSynthesisRequest" "TestEncryption" "TestSpeechRecognition" "TestSpeechTranscribe" "TestSynthesis" "TestWebSocketAsyncRequest" "TestWebSocketSyncRequest" ];
meta = { description = "Python SDK for dashscope"; homepage = "https://github.com/dashscope/dashscope-sdk-python"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ thattemperature ]; };}