From fcc32aadf340c002b01efe319a373d6bdb9fe887 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Mon, 23 Oct 2023 22:41:11 +0200 Subject: [PATCH 1/2] autosuspend: move dependencies to propagatedBuildInputs --- .../os-specific/linux/autosuspend/default.nix | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pkgs/os-specific/linux/autosuspend/default.nix b/pkgs/os-specific/linux/autosuspend/default.nix index 200021024aab..bd5b780f8f77 100644 --- a/pkgs/os-specific/linux/autosuspend/default.nix +++ b/pkgs/os-specific/linux/autosuspend/default.nix @@ -22,26 +22,27 @@ python3.pkgs.buildPythonApplication rec { ''; propagatedBuildInputs = with python3.pkgs; [ + dbus-python + icalendar + jsonpath-ng + lxml + mpd2 portalocker psutil - dbus-python + python-dateutil + pytz + requests + requests-file + tzlocal ]; nativeCheckInputs = with python3.pkgs; [ + freezegun + pytest-datadir + pytest-httpserver + pytest-mock pytestCheckHook python-dbusmock - pytest-httpserver - dateutils - freezegun - pytest-mock - requests - requests-file - icalendar - tzlocal - jsonpath-ng - mpd2 - lxml - pytest-datadir ]; # Disable tests that need root From 0b6b520442871158084c694785807a89e885b9ef Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Mon, 23 Oct 2023 22:47:34 +0200 Subject: [PATCH 2/2] autosuspend: downgrade tzlocal to 4.3.1 autosuspend is incompatible with tzlocal v5 See https://github.com/regebro/tzlocal#api-change --- .../os-specific/linux/autosuspend/default.nix | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/autosuspend/default.nix b/pkgs/os-specific/linux/autosuspend/default.nix index bd5b780f8f77..fc2b2f0c4e38 100644 --- a/pkgs/os-specific/linux/autosuspend/default.nix +++ b/pkgs/os-specific/linux/autosuspend/default.nix @@ -3,7 +3,21 @@ , python3 }: -python3.pkgs.buildPythonApplication rec { +let + python = python3.override { + packageOverrides = self: super: { + # autosuspend is incompatible with tzlocal v5 + # See https://github.com/regebro/tzlocal#api-change + tzlocal = super.tzlocal.overridePythonAttrs (prev: { + src = prev.src.override { + version = "4.3.1"; + hash = "sha256-7jLvjCCAPBmpbtNmrd09SnKe9jCctcc1mgzC7ut/pGo="; + }; + }); + }; + }; +in +python.pkgs.buildPythonApplication rec { pname = "autosuspend"; version = "6.0.0"; @@ -21,7 +35,7 @@ python3.pkgs.buildPythonApplication rec { --replace '--cov-config=setup.cfg' "" ''; - propagatedBuildInputs = with python3.pkgs; [ + propagatedBuildInputs = with python.pkgs; [ dbus-python icalendar jsonpath-ng @@ -36,7 +50,7 @@ python3.pkgs.buildPythonApplication rec { tzlocal ]; - nativeCheckInputs = with python3.pkgs; [ + nativeCheckInputs = with python.pkgs; [ freezegun pytest-datadir pytest-httpserver