From 19c8149641c98c513ed5aec68f9fbd24621df278 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 23 Aug 2022 10:02:59 +0200 Subject: [PATCH] python3Packages.ripe-atlas-sagan: add optional dependency --- .../ripe-atlas-sagan/default.nix | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/ripe-atlas-sagan/default.nix b/pkgs/development/python-modules/ripe-atlas-sagan/default.nix index ae536ba968947d..3b3b16ce78e5e5 100644 --- a/pkgs/development/python-modules/ripe-atlas-sagan/default.nix +++ b/pkgs/development/python-modules/ripe-atlas-sagan/default.nix @@ -1,38 +1,51 @@ { lib , buildPythonPackage -, python-dateutil -, pytz , cryptography -, pytest -, pytestCheckHook , fetchFromGitHub +, pytestCheckHook +, python-dateutil +, pythonOlder +, pytz +, ujson }: buildPythonPackage rec { pname = "ripe-atlas-sagan"; version = "1.3.1"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "RIPE-NCC"; repo = pname; rev = "v${version}"; - sha256 = "sha256-xIBIKsQvDmVBa/C8/7Wr3WKeepHaGhoXlgatXSUtWLA="; + hash = "sha256-xIBIKsQvDmVBa/C8/7Wr3WKeepHaGhoXlgatXSUtWLA="; }; propagatedBuildInputs = [ + cryptography python-dateutil pytz - cryptography ]; + passthru.optional-dependencies = { + fast = [ + ujson + ]; + }; + checkInputs = [ pytestCheckHook ]; - pytestFlagsArray = [ "tests/*.py" ]; + pytestFlagsArray = [ + "tests/*.py" + ]; disabledTests = [ - "test_invalid_country_code" # This test fail for unknown reason, I suspect it to be flaky. + # This test fail for unknown reason, I suspect it to be flaky. + "test_invalid_country_code" ]; pythonImportsCheck = [