guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#47966] [PATCH] gnu: Add python-graph-tool.


From: Marius Bakke
Subject: [bug#47966] [PATCH] gnu: Add python-graph-tool.
Date: Thu, 13 May 2021 19:04:25 +0200

Hi Alexandre,

Alexandre Hannud Abdo <abdo@member.fsf.org> skriver:

> * gnu/packages/graph.scm (python-graph-tool): New variable.

Thanks for the patch.

[...]

> +(define-public python-graph-tool
> +  (package
> +    (name "python-graph-tool")
> +    (version "2.37")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "https://downloads.skewed.de/graph-tool/graph-tool-";
> +                    version
> +                    ".tar.bz2"))
> +              (sha256
> +               (base32
> +                "0w2i4d4zyk051zkykcg0ksngspajznwmp523hbsx50xnxc6jliyz"))))
> +    (build-system gnu-build-system)
> +    ;; (arguments '(#:configure-flags '("--disable-openmp")))

This comment can probably be removed?

> +    (arguments
> +     `(#:configure-flags
> +       (list (string-append "--with-boost="
> +                            (assoc-ref %build-inputs "boost"))
> +             (string-append "--with-python-module-path="
> +                            (assoc-ref %outputs "out")
> +                            "/lib/python"
> +                            ((lambda (version)
> +                               (substring version 0 (string-rindex version 
> #\.)))
> +                             ,(package-version
> +                               (car (assoc-ref
> +                                     (package-propagated-inputs this-package)
> +                                     "python"))))
> +                            "/site-packages/"))))

That's clever.  :-)

(guix utils) has a handy (version-major+minor ...) procedure that can be
accessed in the unquoted context.  Thus the expression above can be
simplified to:

  (string-append "--with-python-module-path="
                 (assoc-ref %outputs "out")
                 "/lib/python"
                 ,(version-major+minor
                   (package-version
                    (car (assoc-ref
                          (package-propagated-inputs this-package)
                          "python"))))
                 "/site-packages/")


> +    (native-inputs `(("pkg-config" ,pkg-config)
> +                     ("gcc-10" ,gcc-10)
> +                     ("ncurses" ,ncurses)))

The indentation here and below is unusual.  :-)

> +    (inputs `(("boost" ,boost)
> +              ("expat" ,expat)
> +              ("gmp" ,gmp)
> +              ("cgal" ,cgal)
> +              ("sparsehash" ,sparsehash)
> +              ("gtk+" ,gtk+)
> +              ("cairomm" ,cairomm)))
> +    (propagated-inputs `(("python" ,python-wrapper)

Python should be a regular input.  It will be available in just about
any context where this package is used, and propagating it can cause
conflicts if users have custom variants in their
profile/manifests/packages.

> +                         ("python-scipy" ,python-scipy)
> +                         ("python-numpy" ,python-numpy)
> +                         ("python-pycairo" ,python-pycairo)
> +                         ("python-matplotlib" ,python-matplotlib)))
> +    (synopsis "Efficient python module for analysis of graphs")

Perhaps just 'Analyze graphs with Python' to avoid overlapping with the
description which has more detail?

> +    (description "Graph-tool is an efficient Python module for
> +manipulation and statistical analysis of graphs (a.k.a. networks).
> +Contrary to most other Python modules with similar functionality, the
> +core data structures and algorithms are implemented in C++, making
> +extensive use of template metaprogramming, based heavily on the Boost
> +Graph Library.  This confers it a level of performance that is
> +comparable (both in memory usage and computation time) to that of a
> +pure C/C++ library.")
> +    (home-page "https://graph-tool.skewed.de/";)
> +    (license license:lgpl3+)))

Otherwise LGTM.  Can you send an updated patch?

TIA,
Marius

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]