mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-09 16:18:34 +01:00
74 lines
1.4 KiB
Nix
74 lines
1.4 KiB
Nix
{
|
|
# Basic
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
# Build system
|
|
setuptools,
|
|
# Dependencies
|
|
aiohttp,
|
|
requests,
|
|
websocket-client,
|
|
cryptography,
|
|
certifi,
|
|
# Test
|
|
pytestCheckHook,
|
|
tiktoken,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "dashscope";
|
|
version = "1.25.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "dashscope";
|
|
repo = "dashscope-sdk-python";
|
|
tag = "v${version}";
|
|
hash = "sha256-l7y7JakSc9tljuL7l5Azcw+hzXjbvivxPNtGMAqQOw4=";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
aiohttp
|
|
requests
|
|
websocket-client
|
|
cryptography
|
|
certifi
|
|
];
|
|
|
|
# Specify the version explicitly
|
|
postPatch = ''
|
|
substituteInPlace setup.py \
|
|
--replace-fail "version=get_version()," "version='${version}',"
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
tiktoken
|
|
];
|
|
|
|
pythonImportsCheck = [ "dashscope" ];
|
|
|
|
disabledTests = [
|
|
# Needs network access and/or API key
|
|
"TestAsyncImageSynthesisRequest"
|
|
"TestAsyncRequest"
|
|
"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 ];
|
|
};
|
|
}
|