From bda800cd77c3f08ad7feb3cdeead5f8e0590cf94 Mon Sep 17 00:00:00 2001 From: Tom Hunze Date: Sun, 31 Aug 2025 16:08:57 +0200 Subject: [PATCH 1/3] python313Packages.pystemd: fix build --- .../python-modules/pystemd/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/pystemd/default.nix b/pkgs/development/python-modules/pystemd/default.nix index f3847e030065..c580b0dedc3e 100644 --- a/pkgs/development/python-modules/pystemd/default.nix +++ b/pkgs/development/python-modules/pystemd/default.nix @@ -6,8 +6,7 @@ systemd, lxml, psutil, - pytest, - mock, + pytestCheckHook, pkg-config, cython, }: @@ -44,17 +43,18 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - mock - pytest + pytestCheckHook ]; - checkPhase = '' - runHook preCheck - # pytestCheckHook doesn't work - pytest tests - runHook postCheck + # Having the source root in `sys.path` causes import issues + preCheck = '' + cd tests ''; + disabledTestPaths = [ + "test_version.py" # Requires cstq which is not in nixpkgs + ]; + pythonImportsCheck = [ "pystemd" ]; meta = { From 6ee0933c4031822aef061a1e4a96273b15f7b910 Mon Sep 17 00:00:00 2001 From: Tom Hunze Date: Sun, 31 Aug 2025 16:12:13 +0200 Subject: [PATCH 2/3] python313Packages.pystemd: fetch src from GitHub --- .../python-modules/pystemd/default.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/pystemd/default.nix b/pkgs/development/python-modules/pystemd/default.nix index c580b0dedc3e..ca17d40949fe 100644 --- a/pkgs/development/python-modules/pystemd/default.nix +++ b/pkgs/development/python-modules/pystemd/default.nix @@ -1,7 +1,7 @@ { - buildPythonPackage, lib, - fetchPypi, + buildPythonPackage, + fetchFromGitHub, setuptools, systemd, lxml, @@ -16,16 +16,13 @@ buildPythonPackage rec { version = "0.13.4"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-8G1OWyGIGnyRAEkuYMzC9LZOULTWt3c8lAE9LG8aANs="; + src = fetchFromGitHub { + owner = "systemd"; + repo = "pystemd"; + tag = "v${version}"; + hash = "sha256-Ph0buiyH2cLRXyqgA8DmpE9crb/x8OaerIoZuv8hjMI="; }; - postPatch = '' - # remove cythonized sources, build them anew to support more python version - rm pystemd/*.c - ''; - buildInputs = [ systemd ]; build-system = [ From 756b6b88f056cf7dcfff4f5cf08ddcb700551826 Mon Sep 17 00:00:00 2001 From: Tom Hunze Date: Sun, 31 Aug 2025 16:14:29 +0200 Subject: [PATCH 3/3] python313Packages.pystemd: refactor --- pkgs/development/python-modules/pystemd/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pystemd/default.nix b/pkgs/development/python-modules/pystemd/default.nix index ca17d40949fe..67143d6bfd49 100644 --- a/pkgs/development/python-modules/pystemd/default.nix +++ b/pkgs/development/python-modules/pystemd/default.nix @@ -34,7 +34,7 @@ buildPythonPackage rec { pkg-config ]; - propagatedBuildInputs = [ + dependencies = [ lxml psutil ]; @@ -59,7 +59,8 @@ buildPythonPackage rec { Thin Cython-based wrapper on top of libsystemd, focused on exposing the dbus API via sd-bus in an automated and easy to consume way ''; - homepage = "https://github.com/facebookincubator/pystemd/"; + homepage = "https://github.com/facebookincubator/pystemd"; + changelog = "https://github.com/systemd/pystemd/releases/tag/${src.tag}"; license = lib.licenses.lgpl21Plus; maintainers = with lib.maintainers; [ flokli ]; };