From 49e157ab0653b3fed2ecce63a487eeddadbfe9fc Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 13:12:12 +0200 Subject: [PATCH 1/3] python311Packages.automate-home: refactor --- .../python-modules/automate-home/default.nix | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/automate-home/default.nix b/pkgs/development/python-modules/automate-home/default.nix index c13395aa42e3..9386e4585abf 100644 --- a/pkgs/development/python-modules/automate-home/default.nix +++ b/pkgs/development/python-modules/automate-home/default.nix @@ -7,6 +7,7 @@ , hiredis , aioredis , ephem +, setuptools , pytz , pyyaml }: @@ -14,7 +15,7 @@ buildPythonPackage rec { pname = "automate-home"; version = "0.9.1"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.8"; @@ -23,7 +24,18 @@ buildPythonPackage rec { hash = "sha256-41qd+KPSrOrczkovwXht3irbcYlYehBZ1HZ44yZe4cM="; }; - propagatedBuildInputs = [ + postPatch = '' + # Rename pyephem, https://github.com/majamassarini/automate-home/pull/3 + substituteInPlace setup.py \ + --replace-fail "pyephem" "ephem" \ + --replace-fail "aioredis==1.3.1" "aioredis" + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ apscheduler hiredis aioredis @@ -36,13 +48,6 @@ buildPythonPackage rec { pytestCheckHook ]; - postPatch = '' - # Rename pyephem, https://github.com/majamassarini/automate-home/pull/3 - substituteInPlace setup.py \ - --replace "pyephem" "ephem" \ - --replace "aioredis==1.3.1" "aioredis" - ''; - pythonImportsCheck = [ "home" ]; @@ -50,6 +55,7 @@ buildPythonPackage rec { meta = with lib; { description = "Python module to automate (home) devices"; homepage = "https://github.com/majamassarini/automate-home"; + changelog = "https://github.com/majamassarini/automate-home/releases/tag/${version}"; license = licenses.gpl3Only; maintainers = with maintainers; [ fab ]; }; From 2101d569c7af3412aa7f2f69b787f63acd7a58a9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 13:12:44 +0200 Subject: [PATCH 2/3] python311Packages.automate-home: format with nixfmt --- .../python-modules/automate-home/default.nix | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/automate-home/default.nix b/pkgs/development/python-modules/automate-home/default.nix index 9386e4585abf..dde06a46a890 100644 --- a/pkgs/development/python-modules/automate-home/default.nix +++ b/pkgs/development/python-modules/automate-home/default.nix @@ -1,15 +1,16 @@ -{ lib -, buildPythonPackage -, fetchPypi -, pytestCheckHook -, pythonOlder -, apscheduler -, hiredis -, aioredis -, ephem -, setuptools -, pytz -, pyyaml +{ + lib, + buildPythonPackage, + fetchPypi, + pytestCheckHook, + pythonOlder, + apscheduler, + hiredis, + aioredis, + ephem, + setuptools, + pytz, + pyyaml, }: buildPythonPackage rec { @@ -31,9 +32,7 @@ buildPythonPackage rec { --replace-fail "aioredis==1.3.1" "aioredis" ''; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; dependencies = [ apscheduler @@ -44,13 +43,9 @@ buildPythonPackage rec { pyyaml ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; - pythonImportsCheck = [ - "home" - ]; + pythonImportsCheck = [ "home" ]; meta = with lib; { description = "Python module to automate (home) devices"; From cd24c5e0cf8fe30dc68ae190f3e5ca0833895ac6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 13:14:21 +0200 Subject: [PATCH 3/3] python312Packages.automate-home: disable on Python 3.12 --- .../python-modules/automate-home/default.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/automate-home/default.nix b/pkgs/development/python-modules/automate-home/default.nix index dde06a46a890..bfaa26afc761 100644 --- a/pkgs/development/python-modules/automate-home/default.nix +++ b/pkgs/development/python-modules/automate-home/default.nix @@ -1,16 +1,17 @@ { lib, - buildPythonPackage, - fetchPypi, - pytestCheckHook, - pythonOlder, - apscheduler, - hiredis, aioredis, + apscheduler, + buildPythonPackage, ephem, - setuptools, + fetchPypi, + hiredis, + pytestCheckHook, + pythonAtLeast, + pythonOlder, pytz, pyyaml, + setuptools, }: buildPythonPackage rec { @@ -18,7 +19,8 @@ buildPythonPackage rec { version = "0.9.1"; pyproject = true; - disabled = pythonOlder "3.8"; + # Typing issue + disabled = pythonOlder "3.8" || pythonAtLeast "3.12"; src = fetchPypi { inherit pname version;