Files
nixpkgs/pkgs/development/python-modules/systemd-python/default.nix
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

60 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
libredirect,
systemd,
pkg-config,
pytest,
python,
setuptools,
}:
buildPythonPackage rec {
pname = "systemd-python";
version = "235";
pyproject = true;
src = fetchFromGitHub {
owner = "systemd";
repo = "python-systemd";
tag = "v${version}";
hash = "sha256-8p4m4iM/z4o6PHRQIpuSXb64tPTWGlujEYCDVLiIt2o=";
};
build-system = [ setuptools ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ systemd ];
nativeCheckInputs = [
libredirect.hook
pytest
];
checkPhase = ''
echo "12345678901234567890123456789012" > machine-id
export NIX_REDIRECTS=/etc/machine-id=$(realpath machine-id) \
# Those tests assume /etc/machine-id to be available
# But our redirection technique does not work apparently
pytest $out/${python.sitePackages}/systemd -k 'not test_get_machine and not test_get_machine_app_specific and not test_reader_this_machine'
'';
pythonImportsCheck = [
"systemd.journal"
"systemd.id128"
"systemd.daemon"
"systemd.login"
];
meta = {
description = "Python module for native access to the systemd facilities";
homepage = "https://www.freedesktop.org/software/systemd/python-systemd/";
changelog = "https://github.com/systemd/python-systemd/blob/v${version}/NEWS";
license = lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [ raitobezarius ];
};
}