From 4ff7a38739fc4c050aa51e601424cb1a3ae11fe6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 13 Sep 2024 09:39:44 +0200 Subject: [PATCH] python312Packages.aiogram: add optional-dependencies --- .../python-modules/aiogram/default.nix | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/aiogram/default.nix b/pkgs/development/python-modules/aiogram/default.nix index 78051d815e18..bddcb187798e 100644 --- a/pkgs/development/python-modules/aiogram/default.nix +++ b/pkgs/development/python-modules/aiogram/default.nix @@ -1,8 +1,9 @@ { lib, + aiodns, aiofiles, - aiohttp, aiohttp-socks, + aiohttp, aresponses, babel, buildPythonPackage, @@ -22,6 +23,7 @@ pythonOlder, pytz, redis, + uvloop, }: buildPythonPackage rec { @@ -40,31 +42,37 @@ buildPythonPackage rec { build-system = [ hatchling ]; - - pythonRelaxDeps = [ "pydantic" ]; - dependencies = [ aiofiles aiohttp - babel certifi magic-filter pydantic ]; + optional-dependencies = { + fast = [ + aiodns + uvloop + ]; + mongo = [ + motor + pymongo + ]; + redis = [ redis ]; + proxy = [ aiohttp-socks ]; + i18n = [ babel ]; + }; + nativeCheckInputs = [ - aiohttp-socks aresponses - motor pycryptodomex - pymongo pytest-aiohttp pytest-asyncio pytest-lazy-fixture pytestCheckHook pytz - redis - ]; + ] ++ lib.flatten (builtins.attrValues optional-dependencies); pytestFlagsArray = [ "-W"