From d6323ba597c5740818c3190f19a801c94836fc14 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Sat, 27 Dec 2025 12:03:21 +0100 Subject: [PATCH] gnu: python-slurm-magic: Switch to pyproject. * gnu/packages/parallel.scm (python-slurm-magic): [build-system]: Switch to pyproject-build-system. [arguments]: Improve style, modernize with gexps and seaerch-input-file. <#:tests?>: Disable them. [native-inputs]: Add python-setuptools. Change-Id: Ic5243c647f645de49eeb54262eabeea6df73743e Signed-off-by: Sharlatan Hellseher --- gnu/packages/parallel.scm | 54 ++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm index 55c3f0c7bb501a38b07352c84b838e5fa59ac628..716f46736dae03a6fe969a782e07cf0e8d45075d 100644 --- a/gnu/packages/parallel.scm +++ b/gnu/packages/parallel.scm @@ -552,33 +552,35 @@ supercomputer (via, e.g., MPI or JobLib).") (name "python-slurm-magic") (version (git-version "0.0" revision commit)) (home-page "https://github.com/NERSC/slurm-magic") - (source (origin - (method git-fetch) - (uri (git-reference (url home-page) - (commit commit))) - (sha256 - (base32 - "19pp2vs0wm8mx0arz9n6lw9wgyv70w9wyi4y6b91qc5j3bz5igfs")) - (file-name (git-file-name name version)))) - (build-system python-build-system) + (source + (origin + (method git-fetch) + (uri (git-reference + (url home-page) + (commit commit))) + (sha256 + (base32 "19pp2vs0wm8mx0arz9n6lw9wgyv70w9wyi4y6b91qc5j3bz5igfs")) + (file-name (git-file-name name version)))) + (build-system pyproject-build-system) (arguments - '(#:phases (modify-phases %standard-phases - (add-before 'build 'set-slurm-path - (lambda* (#:key inputs #:allow-other-keys) - ;; The '_execute' method tries to exec 'salloc' - ;; etc. from $PATH. Record the absolute file name - ;; instead. - (let ((slurm (assoc-ref inputs "slurm"))) - (substitute* "slurm_magic.py" - (("name = (.*)$" _ value) - (string-append "name = \"" - slurm "/bin/\" + " - value "\n"))) - #t)))))) - (inputs - (list slurm)) - (propagated-inputs - (list python-ipython python-pandas)) + (list + #:tests? #f ; No tests. + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'set-slurm-path + (lambda* (#:key inputs #:allow-other-keys) + ;; The '_execute' method tries to exec 'salloc' + ;; etc. from $PATH. Record the absolute file name + ;; instead. + (let ((slurm-bin (dirname + (search-input-file inputs "/bin/sinfo")))) + (substitute* "slurm_magic.py" + (("name = (.*)$" _ value) + (string-append "name = \"" slurm-bin "/\" + " + value "\n"))))))))) + (native-inputs (list python-setuptools)) + (inputs (list slurm)) + (propagated-inputs (list python-ipython python-pandas)) (synopsis "Control the SLURM batch scheduler from Jupyter Notebook") (description "This package implements Jupyter/IPython