From: ng0 <ngillm...@runbox.com>

* gnu/packages/python.scm (python-distro): New variable.
---
 gnu/packages/python.scm | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index cef9d2a8c..88762a412 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -23,7 +23,7 @@
 ;;; Copyright © 2016 Daniel Pimentel <d...@d4n1.org>
 ;;; Copyright © 2016 Sou Bunnbu <iyzs...@gmail.com>
 ;;; Copyright © 2016 Troy Sankey <sankey...@gmail.com>
-;;; Copyright © 2016 ng0 <n...@we.make.ritual.n0.is>
+;;; Copyright © 2016, 2017 ng0 <contact....@cryptolab.net>
 ;;; Copyright © 2016 Dylan Jeffers <sapientech@sapient...@openmailbox.org>
 ;;; Copyright © 2016 David Craven <da...@craven.ch>
 ;;; Copyright © 2016, 2017 Marius Bakke <mba...@fastmail.com>
@@ -846,6 +846,44 @@ NetCDF files can also be read and modified.  Python-HDF4 
is a fork of
 (define-public python2-hdf4
   (package-with-python2 python-hdf4))
 
+(define-public python-distro
+(package
+  (name "python-distro")
+  (version "0.6.0")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (pypi-uri "distro" version))
+      (sha256
+        (base32
+          "1xkj2id1b3b4ix3b4yrfy6pgcsp71n0fbq4475r17a4a8fj5f5v7"))))
+  (build-system python-build-system)
+  (inputs
+   `(("python-six" ,python-six)))
+  (home-page "https://github.com/nir0s/distro";)
+  (synopsis "alternative implementation for Python's 
platform.linux_distribution()")
+  (description
+   "The distro package provides information about the GNU-Linux distribution 
it runs on,
+such as a reliable machine-readable ID, or version information.
+It is a renewed alternative implementation for Python's original
+platform.linux_distribution function, which became necessary because Python 3.5
+deprecated this function, and Python 3.7 is expected to remove it altogether. 
+Its predecessor function platform.dist was already deprecated since Python 2.6 
and is
+also expected to be removed in Python 3.7.  The distro package implements a 
robust and
+inclusive way of retrieving the information about a GNU-Linux distribution 
based on new
+standards and old methods, namely from these data sources (from high to low 
precedence):
+@enumerate
+@item The os-release file /etc/os-release, if present.
+@item The output of the lsb_release command, if available.
+@item The distro release file (/etc/*(-|_)(release|version)), if present.")
+  (license license:asl2.0)))
+
+(define-public python2-distro
+  (let ((distro (package-with-python2 python-distro)))
+    (package (inherit distro)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools))))))
+
 (define-public python-h5py
   (package
     (name "python-h5py")
-- 
2.11.0


Reply via email to