python3Packages.duckduckgo-search: use orjson and curl-cffi

This commit is contained in:
Pol Dellaiera 2024-06-12 15:13:58 +02:00
parent c6e1d0bf0f
commit 715b4dadb6
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA

View File

@ -8,42 +8,10 @@
orjson,
curl-cffi,
# To build orjson
rustPlatform,
# Optional dependencies
lxml,
}:
let
curl-cffi_0_7_0 = curl-cffi.overrideAttrs (
final: old: {
version = "0.7.0b4";
src = fetchFromGitHub {
owner = "yifeikong";
repo = "curl_cffi";
rev = "v${final.version}";
hash = "sha256-txrJNUzswAPeH4Iazn0iKJI0Rqk0HHRoDrtTfDHKMoo=";
};
}
);
orjson_3_10_3 = orjson.overrideAttrs (
final: old: {
version = "3.10.3";
src = fetchFromGitHub {
owner = "ijl";
repo = "orjson";
rev = "refs/tags/${final.version}";
hash = "sha256-bK6wA8P/IXEbiuJAx7psd0nUUKjR1jX4scFfJr1MBAk=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit (final) src;
name = "${old.pname}-${final.version}";
hash = "sha256-ilGq+/gPSuNwURUWy2ZxInzmUv+PxYMxd8esxrMpr2o=";
};
}
);
in
buildPythonPackage rec {
pname = "duckduckgo-search";
version = "v5.3.1";
@ -58,12 +26,12 @@ buildPythonPackage rec {
hash = "sha256-T7rlB3dU7y+HbHr1Ss9KkejlXFORhnv9Va7cFTRtfQU=";
};
nativeBuildInputs = [ setuptools ];
build-system = [ setuptools ];
propagatedBuildInputs = [
dependencies = [
click
orjson_3_10_3
curl-cffi_0_7_0
curl-cffi
orjson
];
passthru.optional-dependencies = {