From c293cdd65150d13bdc25b7d60a4048c93dd43282 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 16 Jan 2025 10:14:24 +0100 Subject: [PATCH] python312Packages.tweepy: refactor -add optional-dependencies --- .../python-modules/tweepy/default.nix | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/tweepy/default.nix b/pkgs/development/python-modules/tweepy/default.nix index 0a79f8da028388..7b1e18f0ebcffc 100644 --- a/pkgs/development/python-modules/tweepy/default.nix +++ b/pkgs/development/python-modules/tweepy/default.nix @@ -9,37 +9,43 @@ pythonOlder, requests, requests-oauthlib, - six, + setuptools, vcrpy, }: buildPythonPackage rec { pname = "tweepy"; version = "4.15.0"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.9"; src = fetchFromGitHub { - owner = pname; - repo = pname; + owner = "tweepy"; + repo = "tweepy"; tag = "v${version}"; hash = "sha256-vbiMwaJh4cN7OY7eYu2s8azs3A0KXvW/kRPVCx50ZVA="; }; - propagatedBuildInputs = [ - aiohttp - async-lru + build-system = [ setuptools ]; + + dependencies = [ oauthlib requests requests-oauthlib - six ]; + optional-dependencies = { + async = [ + aiohttp + async-lru + ]; + }; + nativeCheckInputs = [ pytestCheckHook vcrpy - ]; + ] ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "tweepy" ];