[PATCH] gnu: Add pyre.

  • Done
  • quality assurance status badge
Details
2 participants
  • Maxim Cournoyer
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 28 Nov 08:55 +0100
(address . guix-patches@gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
ab8f63e2ad9217bbd5bdbbae75e0b9d36302d0ce.1732780548.git.maxim.cournoyer@gmail.com
* gnu/packages/python-science.scm (pyre): New variable.

Change-Id: I4a26d7a83f24210104cb0ab50b5392ab97d9bfc4
---
gnu/packages/python-science.scm | 82 +++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)

Toggle diff (114 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index ef6d529ffd..30d149dfb6 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -53,6 +53,7 @@ (define-module (gnu packages python-science)
#:use-module (gnu packages check)
#:use-module (gnu packages chemistry)
#:use-module (gnu packages cmake)
+ #:use-module (gnu packages compression)
#:use-module (gnu packages cpp)
#:use-module (gnu packages crates-io)
#:use-module (gnu packages crypto)
@@ -78,6 +79,7 @@ (define-module (gnu packages python-science)
#:use-module (gnu packages rust-apps)
#:use-module (gnu packages simulation)
#:use-module (gnu packages sphinx)
+ #:use-module (gnu packages ssh)
#:use-module (gnu packages statistics)
#:use-module (gnu packages time)
#:use-module (gnu packages xdisorg)
@@ -89,9 +91,89 @@ (define-module (gnu packages python-science)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system cargo)
+ #:use-module (guix build-system cmake)
#:use-module (guix build-system python)
#:use-module (guix build-system pyproject))
+(define-public pyre
+ (package
+ (name "pyre")
+ (version "1.12.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pyre/pyre")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0crmssga481q2ggwcmj40nj5n9975wri14p609jdr9hwg4vdyvj2"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:imported-modules (append %cmake-build-system-modules
+ %python-build-system-modules)
+ #:modules '((guix build cmake-build-system)
+ ((guix build python-build-system) #:prefix python:)
+ (guix build utils))
+ #:configure-flags
+ #~(list (string-append "-DPYRE_VERSION=" #$version)
+ (string-append "-DPYRE_DEST_PACKAGES="
+ (python:site-packages %build-inputs %outputs)))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'enable-bytecode-determinism
+ (assoc-ref python:%standard-phases 'enable-bytecode-determinism))
+ ;; Move the check phase after the Python 'pyre' module
+ ;; is installed and made available.
+ (delete 'check)
+ (add-after 'install 'add-to-pythonpath
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (python:add-installed-pythonpath inputs outputs)))
+ (add-after 'add-to-pythonpath 'wrap
+ (assoc-ref python:%standard-phases 'wrap))
+ (add-after 'add-to-pythonpath 'check
+ (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
+ (when tests?
+ (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
+ (let ((ignored-tests
+ (list
+ ;; The MPI tests are failing for unknown reasons (see:
+ ;; https://github.com/pyre/pyre/issues/126).
+ "tests.mpi"
+ ;; These tests have a cleanup phase that fails
+ ;; non-deterministically (see:
+ ;; https://github.com/pyre/pyre/issues/125).
+ "tests.pyre.lib.viz.flow"
+ ;; This test expects a TCP port 22 to be listening.
+ "tests.pyre.pkg.ipc.tcp.py"
+ ;; These postgres tests require a running postgresql
+ ;; daemon; they are also skipped in upstream CI.
+ "tests.postgres.ext"
+ ;; This test fails due to pre-1980 timestamps, not
+ ;; supported by ZIP.
+ "tests.pyre.pkg.filesystem.zip_open.py"
+ ;; This one trips on the patched python3 shebang.
+ "tests.pyre.pkg.filesystem.local_open.py")))
+ (invoke "ctest"
+ "-j" (if parallel-tests?
+ (number->string (parallel-job-count))
+ "1")
+ "-E" (string-join ignored-tests "|")))))))))
+ (native-inputs (list openssh-sans-x python python-numpy pybind11 zip))
+ (inputs (list gsl hdf5 openmpi postgresql))
+ (propagated-inputs (list python-pyyaml)) ;for the Python bindings
+ (home-page "http://pyre.orthologue.com/")
+ (synopsis "Framework for building Scientific applications")
+ (description
+ "This package provides a framework for building scientific applications.
+It aims to bring state of the art software design practices to scientific
+computing, with the goal of providing a strong skeleton on which to build
+scientific codes by steering the implementation towards usability and
+maintainability.")
+ (license license:bsd-3)))
+
(define-public python-cvxpy
(package
(name "python-cvxpy")

base-commit: 5ff9e51e2c4dae0dc74f5c85ec553e89fe1824fd
--
2.46.0
S
S
Sharlatan Hellseher wrote on 16 Dec 22:30 +0100
(address . 74581@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
87r067uxhh.fsf@gmail.com
Hi Maxim,

Did you try to import from PyPI? I've gave it a go and with some
adjustment it may be built with pyproject-build-system as a native python
library, WDYT?
From 95b59ea9f569bad1bdb17d0b1cbb79c69e3cc4df Mon Sep 17 00:00:00 2001
Message-ID: <95b59ea9f569bad1bdb17d0b1cbb79c69e3cc4df.1734384298.git.sharlatanus@gmail.com>
From: Sharlatan Hellseher <sharlatanus@gmail.com>
Date: Mon, 16 Dec 2024 21:24:28 +0000
Subject: [PATCH] gnu: Add python-pyre.

* gnu/packages/python-science.scm (python-pyre): New variable.

Change-Id: Iabdcfc2febd90cd002a86d7aec505be6de65d632
---
gnu/packages/python-science.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 05c6ac1fc1..869b97e37e 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -223,6 +223,36 @@ (define-public python-osqp
numerical optimization package.")
(license license:asl2.0)))
+(define-public python-pyre
+ (package
+ (name "python-pyre")
+ (version "1.12.5")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pyre" version))
+ (sha256
+ (base32 "1mlk4blh1q47jvwz9glkvnhg7hs5ax27s2jakcjsir8gbsvy1qcv"))))
+ (build-system pyproject-build-system)
+ (native-inputs
+ (list pybind11
+ python-numpy
+ python-scikit-build
+ python-setuptools
+ python-setuptools-scm
+ python-wheel))
+ (propagated-inputs
+ (list python-pyyaml))
+ (home-page "http://pyre.orthologue.com/")
+ (synopsis "Framework for building scientific applications")
+ (description
+ "This package provides a framework for building scientific applications.
+It aims to bring state of the art software design practices to scientific
+computing, with the goal of providing a strong skeleton on which to build
+scientific codes by steering the implementation towards usability and
+maintainability.")
+ (license license:bsd-3)))
+
(define-public python-qdldl
(package
(name "python-qdldl")

base-commit: a3ffb920f14cd0d31d1e7067e11dc523fe380996
--
2.46.0
--
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmdgm/oACgkQdtcnv/Ys
0rXyyQ//Su4ods/V67mIiBIODeJwEmQjXcXE/QXdM3OFhriapSv656odHUzmHYIj
FQj9cVrYDeXwpRbeuKDzs/krGeDUiaVZmM/G9Cyj+HXSVPLkT5qgZmLzhm/Rmvdo
CO06446/XlbaWK2dGjlc6SPwdKQ5lYFkILtoHlZbyF9c32mTxaCf/O+J4J14r+AX
XMf6F83UP38SyFTbrsESuQLG4fzeATJGgpuCngRwLYsCzM/k6P1bQLygvdEeahwJ
nY4vDqPzDuGOxXS3d0sMyB06KaG3aSJHYtHWCXISDKyX4XqBsmDnvg+pZzdgvPba
UTj8Hyg2iYKQicrSEy7Vif4Hx98wAuvE9GPEuymuobfgUArUKkPMqMmnwjVCn2NU
7C1tpuP2mXdU2dgzy0f+idMBi8swRidTY8nZpkPT45NAdJ3wCD7k4YQnSXPvaK4i
iPOGT88k0CCDW4EAczEPM17AzsaVY33vmkuAdl0hNpu6g193VnOcZRGMOApMTmCT
tVd2ba0YBBf/lnOYD8O9YcN/LHY63sRB4O6ZAdE3wb8QJL45ROU1Im3zB5AiNeZd
XyruQ4+6BVuqkWqZfiOSd7AoFWVxqHeUVbYftOgi7xIw7l8klFlg4peC+kzJC59M
e9blmr8kkJw3uXczA5MUt++90hE1v0u8SfF6UzSIYhYc5CnCUxM=
=a/fr
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 18 Dec 02:44 +0100
(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)(address . 74581@debbugs.gnu.org)
87seqlrci8.fsf@gmail.com
Hi Sharlatan,

Sharlatan Hellseher <sharlatanus@gmail.com> writes:

Toggle quote (6 lines)
> Hi Maxim,
>
> Did you try to import from PyPI? I've gave it a go and with some
> adjustment it may be built with pyproject-build-system as a native python
> library, WDYT?

Yes, that's what I had tried first. It results in this:

Toggle snippet (37 lines)
phase `install' failed after 0.1 seconds
Backtrace:
13 (primitive-load "/gnu/store/334plx7fz3sgknf9x56cn37h7v2…")
In guix/build/gnu-build-system.scm:
966:2 12 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
In ice-9/boot-9.scm:
1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
In srfi/srfi-1.scm:
634:9 10 (for-each #<procedure 7fffeef9e4e0 at guix/build/gnu-b…> …)
In ice-9/boot-9.scm:
1752:10 9 (with-exception-handler _ _ #:unwind? _ # _)
In guix/build/gnu-build-system.scm:
987:23 8 (_)
In srfi/srfi-1.scm:
634:9 7 (for-each #<procedure 7ffff790f510 at guix/build/pypro…> …)
In guix/build/pyproject-build-system.scm:
234:10 6 (_ "/gnu/store/7sd87yqcnl2nws6qa0lww9n8acgnizab-python-…")
200:6 5 (merge-directories "/gnu/store/7sd87yqcnl2nws6qa0lww9n…" …)
In srfi/srfi-1.scm:
634:9 4 (for-each #<procedure 7ffff790f420 at guix/build/pypro…> …)
In guix/build/pyproject-build-system.scm:
204:18 3 (_ "lib")
In unknown file:
2 (rename-file "/gnu/store/7sd87yqcnl2nws6qa0lww9n8acgni…" …)
In ice-9/boot-9.scm:
1685:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure rename-file: Directory not empty
build process 18 exited with status 256
builder for `/gnu/store/kxp5q1zbb4acyfz4v6igcddwl87y4av7-python-pyre-1.12.5.drv' failed with exit code 1
build of /gnu/store/kxp5q1zbb4acyfz4v6igcddwl87y4av7-python-pyre-1.12.5.drv failed
View build log at '/var/log/guix/drvs/kx/p5q1zbb4acyfz4v6igcddwl87y4av7-python-pyre-1.12.5.drv'.
guix build: error: build of `/gnu/store/kxp5q1zbb4acyfz4v6igcddwl87y4av7-python-pyre-1.12.5.drv' failed

And while that's fixable (see a patch I've sent in #74582), then it'd
fail the validate-runpath phase. Building from CMake directly appears
to me cleaner than going through the extra abstraction that is scikit,
and doesn't suffer from the previous problems (see the various issues
reported at https://github.com/pyre/pyre/issuesby Amtrak's -- that's
me).

I hope that answers the question :-).

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote 6 days ago
Re: [bug#74581] [PATCH] gnu: Add pyre.
(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)(address . 74581-done@debbugs.gnu.org)
87v7vgkyxm.fsf@gmail.com
Hi,

I've now applied this.

--
Thanks,
Maxim
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 74581@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74581
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch