diff mbox

New package: python-glances

Message ID 87lgyrr5ds.fsf@xsteve.at
State New
Headers show

Commit Message

Stefan Reichör Sept. 16, 2016, 7:50 p.m. UTC
Leo Famulari <leo@famulari.name> writes:

> On Tue, Sep 13, 2016 at 10:02:37PM +0200, Stefan Reichör wrote:
>> Subject: [PATCH] gnu: Add python-glances
>
> Thank you for this patch!
>
> For Python software, we like to add packages for both the Python 3 and
> Python 2 versions, if the software supports it. The PyPi page [0]
> suggests that Glances does work on both Python 2 and 3.
>
>> +  (native-inputs
>> +   `(("python-setuptools" ,python-setuptools)))
>
> I tried building without setuptools, and the build did succeed. However,
> setuptools is probably required for the Python 2 variant of the package.
>
> There is a recent example of how to do this in the commit "gnu: Add
> python-lit, python2-lit." (243db8245e6d8ee6aae80ce4606fb58cb8b23443).
>
> Can you send an updated patch that adds both python-glances and
> python2-glances using the method demonstrated there?

Thanks for your review.
You are correct the python2 version requires setuptools. I followed your
suggestion and added the python2-glances variant.

Stefan.

Comments

Leo Famulari Sept. 17, 2016, 11:19 p.m. UTC | #1
On Fri, Sep 16, 2016 at 09:50:23PM +0200, Stefan Reichör wrote:
> Leo Famulari <leo@famulari.name> writes:
> > Can you send an updated patch that adds both python-glances and
> > python2-glances using the method demonstrated there?
> 
> Thanks for your review.
> You are correct the python2 version requires setuptools. I followed your
> suggestion and added the python2-glances variant.
> 
> Stefan.
> 

> From 369f06a41dc76c9016d1ca0565af28becef4ae63 Mon Sep 17 00:00:00 2001
> From: Stefan Reichoer <stefan@xsteve.at>
> Date: Fri, 16 Sep 2016 21:43:32 +0200
> Subject: [PATCH] gnu: Add python-glances, python2-glances.

Thanks! Pushed as 4efb9c547870c61ef8971a28e6ccfaef38335ddb with some
minor edits to the commit message and the package description.
diff mbox

Patch

From 369f06a41dc76c9016d1ca0565af28becef4ae63 Mon Sep 17 00:00:00 2001
From: Stefan Reichoer <stefan@xsteve.at>
Date: Fri, 16 Sep 2016 21:43:32 +0200
Subject: [PATCH] gnu: Add python-glances, python2-glances.

---
 gnu/packages/python.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 2f349c8..5e4dad0 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -27,6 +27,7 @@ 
 ;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016 Stefan Reichoer <stefan@xsteve.at>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -420,6 +421,40 @@  pidof, tty, taskset, pmap.")
 (define-public python2-psutil
   (package-with-python2 python-psutil))
 
+(define-public python-glances
+  (package
+  (name "python-glances")
+  (version "2.7.1")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (pypi-uri "Glances" version))
+      (sha256
+        (base32
+          "11jbq40g8alsbirnd4kiagznqg270247i0m8qhi48ldf2i5xppxg"))))
+  (build-system python-build-system)
+  (inputs
+   `(("python-psutil" ,python-psutil)))
+  (home-page
+    "https://github.com/nicolargo/glances")
+  (synopsis
+    "A cross-platform curses-based monitoring tool")
+  (description
+    "Glances is a curses-based monitoring tool for GNU/Linux or BSD
+OS. Glances uses the PsUtil library to get information from your
+system. It monitors CPU, load, memory, network bandwidth, disk I/O,
+disk use, process.")
+  (license license:lgpl3+)
+  (properties `((python2-variant . ,(delay python2-glances))))))
+
+(define-public python2-glances
+  (let ((base (package-with-python2 (strip-python2-variant python-glances))))
+    (package
+      (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ,@(package-native-inputs base))))))
+
 (define-public python-passlib
   (package
     (name "python-passlib")
-- 
2.7.4