gnu: Add python-pythran.

* gnu/packages/python-science.scm (python-pythran): New variable.
This commit is contained in:
Marius Bakke 2022-02-18 21:39:36 +01:00
parent c4c45205a7
commit fb84285b7a
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -35,7 +35,9 @@ (define-module (gnu packages python-science)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
#:use-module (gnu packages cpp)
#:use-module (gnu packages databases)
#:use-module (gnu packages gcc)
#:use-module (gnu packages image-processing)
@ -58,6 +60,7 @@ (define-module (gnu packages python-science)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix utils)
@ -509,6 +512,63 @@ (define-public python2-pyflow
context of a task dependency graph. It has some similarities to make.")
(license license:bsd-2)))
(define-public python-pythran
(package
(name "python-pythran")
(version "0.11.0")
(home-page "https://github.com/serge-sans-paille/pythran")
(source (origin
(method git-fetch)
(uri (git-reference (url home-page) (commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "0cm7wfcyvkp1wmq7n1lyf2d3sj6158jf63bagjpjmfnjwij19n0p"))
(modules '((guix build utils)))
(snippet
'(begin
;; Remove bundled Boost and xsimd.
(delete-file-recursively "third_party")))))
(build-system python-build-system)
(arguments
(list #:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'do-not-install-third-parties
(lambda _
(substitute* "setup.py"
(("third_parties = .*")
"third_parties = []\n"))))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
;; Remove compiler flag that trips newer GCC:
;; https://github.com/serge-sans-paille/pythran/issues/908
(substitute* "pythran/tests/__init__.py"
(("'-Wno-absolute-value',")
""))
(setenv "HOME" (getcwd))
;; This setup is modelled after the upstream CI system.
(call-with-output-file ".pythranrc"
(lambda (port)
(format port "[compiler]\nblas=openblas~%")))
(invoke "pytest" "-vv"
(string-append "--numprocesses="
(number->string
(parallel-job-count)))
"pythran/tests/test_cases.py")))))))
(native-inputs
;; For tests.
(list openblas python-pytest python-pytest-xdist))
(propagated-inputs
(list boost xsimd ;headers need to be available
python-beniget python-gast python-numpy python-ply))
(synopsis "Ahead of Time compiler for numeric kernels")
(description
"Pythran is an ahead of time compiler for a subset of the Python
language, with a focus on scientific computing. It takes a Python module
annotated with a few interface descriptions and turns it into a native
Python module with the same interface, but (hopefully) faster.")
(license license:bsd-3)))
(define-public python-bottleneck
(package
(name "python-bottleneck")