From 24061dccef5ce2c4538dea3bdc2eb3df50da30f6 Mon Sep 17 00:00:00 2001 From: Akiyoshi Suda Date: Sat, 2 May 2026 23:21:31 +0900 Subject: [PATCH] gnu: Add python-rustworkx. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/python-xyz.scm (python-rustworkx): New variable. * gnu/packages/rust-crates.scm (lookup-cargo-inputs)[python-rustworkx]: New entry. Change-Id: Ic5fbb7303d00ebadc9086a92936ce59bc7b745fe Merges: https://codeberg.org/guix/guix/pulls/8290 Reviewed-by: Efraim Flashner Reviewed-by: Hugo Buddelmeijer Signed-off-by: Nguyễn Gia Phong --- gnu/packages/python-xyz.scm | 69 ++++++++++++++++ gnu/packages/rust-crates.scm | 147 +++++++++++++++++++++++++++++++++++ 2 files changed, 216 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index cb9ed478ac6..6abbcfaf028 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -180,6 +180,7 @@ ;;; Copyright © 2025 Isidor Zeuner ;;; Copyright © 2025 Andy Tai ;;; Copyright © 2026 Daniel Khodabakhsh +;;; Copyright © 2026 Akiyoshi Suda ;;; ;;; This file is part of GNU Guix. ;;; @@ -2600,6 +2601,74 @@ well-formed Roman numerals.") reused when throttling user interactions with a resource (e.g., an API).") (license license:expat))) +(define-public python-rustworkx + (package + (name "python-rustworkx") + (version "0.17.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Qiskit/rustworkx") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0sr0wrfb9wzxcljhb7swwgk2hdxqjfmcfj785jq624mx14kqc4k8")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags #~(list "--test-path" "tests") + #:imported-modules (append %cargo-build-system-modules + %pyproject-build-system-modules) + #:modules '(((guix build cargo-build-system) + #:prefix cargo:) + (guix build pyproject-build-system) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'prepare-cargo-build-system + (lambda args + (for-each + (lambda (phase) + (format #t "Running cargo phase: ~a~%" phase) + (apply (assoc-ref cargo:%standard-phases phase) + #:cargo-target #$(cargo-triplet) args)) + '(unpack-rust-crates + configure + check-for-pregenerated-files + patch-cargo-checksums)))) + (add-before 'check 'pre-check + (lambda _ + ;; Delete the source directory to avoid interference. + (delete-file-recursively "rustworkx") + ;; Matplotlib needs to be able to write its configuration file + ;; somewhere. + (setenv "MPLCONFIGDIR" "/tmp") + ;; For fontconfig. + (setenv "XDG_CACHE_HOME" "/tmp")))))) + (propagated-inputs (list python-numpy)) + (native-inputs + (append (list graphviz + python-matplotlib + python-networkx + python-pillow + python-setuptools + python-setuptools-rust + python-stestr + rust + `(,rust "cargo")) + (or (and=> (%current-target-system) + (compose list make-rust-sysroot)) + '()))) + (inputs (cargo-inputs 'python-rustworkx)) + (home-page "https://www.rustworkx.org") + (synopsis "High performance graph library for Python") + (description + "@code{rustworkx} is a Python package for working with graphs and complex +networks. It enables the creation, interaction with, and study of graphs and +networks.") + (license license:asl2.0))) + (define-public python-safety-schemas (package (name "python-safety-schemas") diff --git a/gnu/packages/rust-crates.scm b/gnu/packages/rust-crates.scm index c5c5ef6092c..3d128982998 100644 --- a/gnu/packages/rust-crates.scm +++ b/gnu/packages/rust-crates.scm @@ -21583,6 +21583,10 @@ (crate-source "ndarray-rand" "0.15.0" "1n15dm0x9g6s69vwqgsfj2pdw5wlha6bv9pfrn6p356idzdv74zh")) +(define rust-ndarray-stats-0.6.0 + (crate-source "ndarray-stats" "0.6.0" + "1z9x037d0nzb9wmvhncva6rg8h89gjld8k7dxdmd0lnfmjbvxsqp")) + (define rust-ndk-0.8.0 (crate-source "ndk" "0.8.0" "1dx5yyqh32bi161mipg4br4i33syjidw81qrq0w7mc8hf0ds6xi0")) @@ -21910,6 +21914,10 @@ (crate-source "noise-framework" "0.4.0" "1bhvnpcbgza5hc6gf97n2czac2494fr5n3jxfmcdr6fm2gkrczmm")) +(define rust-noisy-float-0.2.1 + (crate-source "noisy_float" "0.2.1" + "1ck4m30cxzg0sp24dxr5ay6fxlyi1p54w71529m0qhfxhnz46s61")) + (define rust-nokhwa-0.10.10 (crate-source "nokhwa" "0.10.10" "1apgnda6d8ydd59vzr59maws2755pvfqmya1si7238dzhq3ybjn4")) @@ -22571,6 +22579,10 @@ (crate-source "numpy" "0.22.1" "0kpii5mvz4ag29qw4zrqzfmi3m2kmbg882kcxn2ls6m91ny2kfgd")) +(define rust-numpy-0.24.0 + (crate-source "numpy" "0.24.0" + "0f9yzfs1mc3gpbs7g8dmqn2rwr83kc3y77r89nmdrppf1wzvzkx7")) + (define rust-numpy-0.27.1 (crate-source "numpy" "0.27.1" "05xs7gz5wsaz12s8sfvppg19d4f7h6dw6hxdjahgys24drm2xb3s")) @@ -26476,6 +26488,10 @@ (crate-source "quickcheck_macros" "1.1.0" "0jn17bziphar3kmn2kw445a2vba1p3wycarnsf49ligq8a5y67pp")) +(define rust-quickcheck-macros-1.2.0 + (crate-source "quickcheck_macros" "1.2.0" + "192vdkh1z3kk6srbyadqavagfcyrhbd49n8x2y5lqrnxjf28p8m9")) + (define rust-quickxml-to-serde-0.6.0 (crate-source "quickxml_to_serde" "0.6.0" "0zj07hy3av98lxy0czbp5vh3n2lfc86y262jmkv6yd8bl33hasr8")) @@ -27256,6 +27272,10 @@ (crate-source "rayon-cond" "0.3.0" "1ybxppq84p3q60h9rng9j3dm79f6970hn4wljyf31lpgan5m77q5")) +(define rust-rayon-cond-0.4.0 + (crate-source "rayon-cond" "0.4.0" + "13s38wvsmmb2ak6ljdcqnw3cg5biaa5lmlc3h5pa1rx3az7x0r19")) + (define rust-rayon-core-1.11.0 (crate-source "rayon-core" "1.11.0" "13dymrhhdilzpbfh3aylv6ariayqdfk614b3frvwixb6d6yrb3sb")) @@ -31441,6 +31461,10 @@ (crate-source "sprintf" "0.4.3" "1sv4wylcq0wkxhfkdm237ck6fp8fwq1bn6x13s8cgidaqd19irdh")) +(define rust-sprs-0.11.4 + (crate-source "sprs" "0.11.4" + "0mbf1lzl5qqvyd3irji8rj3yf9m8my5lylvivi78s6727fimijkd")) + (define rust-sptr-0.3.2 (crate-source "sptr" "0.3.2" "0shddkys046nnrng929mrnjjrh31mlxl95ky7dgxd6i4kclkk6rv")) @@ -77647,6 +77671,129 @@ rust-windows-x86-64-gnu-0.52.6 rust-windows-x86-64-gnullvm-0.52.6 rust-windows-x86-64-msvc-0.52.6)) + (python-rustworkx => + (list rust-adler2-2.0.1 + rust-aho-corasick-1.1.4 + rust-allocator-api2-0.2.21 + rust-anyhow-1.0.102 + rust-arbitrary-1.4.2 + rust-autocfg-1.5.0 + rust-bitflags-2.11.1 + rust-cc-1.2.61 + rust-cfg-if-1.0.4 + rust-crc32fast-1.5.0 + rust-crossbeam-deque-0.8.6 + rust-crossbeam-epoch-0.9.18 + rust-crossbeam-utils-0.8.21 + rust-derive-arbitrary-1.4.2 + rust-either-1.15.0 + rust-env-filter-1.0.1 + rust-env-logger-0.11.10 + rust-equivalent-1.0.2 + rust-find-msvc-tools-0.1.9 + rust-fixedbitset-0.5.7 + rust-flate2-1.1.9 + rust-foldhash-0.1.5 + rust-getrandom-0.2.17 + rust-getrandom-0.3.4 + rust-getrandom-0.4.2 + rust-hashbrown-0.15.5 + rust-hashbrown-0.17.0 + rust-heck-0.5.0 + rust-hermit-abi-0.5.2 + rust-id-arena-2.3.0 + rust-indexmap-2.14.0 + rust-indoc-2.0.7 + rust-itertools-0.13.0 + rust-itertools-0.14.0 + rust-itoa-1.0.18 + rust-jobserver-0.1.34 + rust-leb128fmt-0.1.0 + rust-libc-0.2.186 + rust-libfuzzer-sys-0.4.12 + rust-libm-0.2.16 + rust-log-0.4.29 + rust-matrixmultiply-0.3.10 + rust-memchr-2.8.0 + rust-memoffset-0.9.1 + rust-miniz-oxide-0.8.9 + rust-ndarray-0.16.1 + rust-ndarray-stats-0.6.0 + rust-noisy-float-0.2.1 + rust-num-bigint-0.4.6 + rust-num-complex-0.4.6 + rust-num-integer-0.1.46 + rust-num-traits-0.2.19 + rust-num-cpus-1.17.0 + rust-numpy-0.24.0 + rust-once-cell-1.21.4 + rust-petgraph-0.8.3 + rust-portable-atomic-1.13.1 + rust-portable-atomic-util-0.2.7 + rust-ppv-lite86-0.2.21 + rust-prettyplease-0.2.37 + rust-priority-queue-2.7.0 + rust-proc-macro2-1.0.106 + rust-pyo3-0.24.2 + rust-pyo3-build-config-0.24.2 + rust-pyo3-ffi-0.24.2 + rust-pyo3-macros-0.24.2 + rust-pyo3-macros-backend-0.24.2 + rust-quick-xml-0.37.5 + rust-quickcheck-1.1.0 + rust-quickcheck-macros-1.2.0 + rust-quote-1.0.45 + rust-r-efi-5.3.0 + rust-r-efi-6.0.0 + rust-rand-0.8.6 + rust-rand-0.9.4 + rust-rand-0.10.1 + rust-rand-chacha-0.3.1 + rust-rand-chacha-0.9.0 + rust-rand-core-0.6.4 + rust-rand-core-0.9.5 + rust-rand-core-0.10.1 + rust-rand-distr-0.5.1 + rust-rand-pcg-0.9.0 + rust-rawpointer-0.2.1 + rust-rayon-1.12.0 + rust-rayon-cond-0.4.0 + rust-rayon-core-1.13.0 + rust-regex-1.12.3 + rust-regex-automata-0.4.14 + rust-regex-syntax-0.8.10 + rust-rustc-hash-2.1.2 + rust-rustversion-1.0.22 + rust-semver-1.0.28 + rust-serde-1.0.228 + rust-serde-core-1.0.228 + rust-serde-derive-1.0.228 + rust-serde-json-1.0.149 + rust-shlex-1.3.0 + rust-simd-adler32-0.3.9 + rust-smallvec-1.15.1 + rust-sprs-0.11.4 + rust-syn-2.0.117 + rust-target-lexicon-0.13.5 + rust-unicode-ident-1.0.24 + rust-unicode-xid-0.2.6 + rust-unindent-0.2.4 + rust-wasi-0.11.1+wasi-snapshot-preview1 + rust-wasip2-1.0.3+wasi-0.2.9 + rust-wasip3-0.4.0+wasi-0.3.0-rc-2026-01-06 + rust-wasm-encoder-0.244.0 + rust-wasm-metadata-0.244.0 + rust-wasmparser-0.244.0 + rust-wit-bindgen-0.51.0 + rust-wit-bindgen-0.57.1 + rust-wit-bindgen-core-0.51.0 + rust-wit-bindgen-rust-0.51.0 + rust-wit-bindgen-rust-macro-0.51.0 + rust-wit-component-0.244.0 + rust-wit-parser-0.244.0 + rust-zerocopy-0.8.48 + rust-zerocopy-derive-0.8.48 + rust-zmij-1.0.21)) (python-safetensors => (list rust-autocfg-1.4.0 rust-bitflags-2.9.0