From mboxrd@z Thu Jan 1 00:00:00 1970 From: contact.ng0@cryptolab.net Subject: [PATCH 4/7] gnu: Add python-distro. Date: Tue, 31 Jan 2017 12:53:36 +0000 Message-ID: <20170131125339.18500-5-contact.ng0@cryptolab.net> References: <20160925173931.GD9499@jasmine> <20170131125339.18500-1-contact.ng0@cryptolab.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYXvg-0006wL-FP for guix-devel@gnu.org; Tue, 31 Jan 2017 07:53:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYXve-0002xM-A7 for guix-devel@gnu.org; Tue, 31 Jan 2017 07:52:59 -0500 Received: from aibo.runbox.com ([91.220.196.211]:60914) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cYXve-0002wk-2I for guix-devel@gnu.org; Tue, 31 Jan 2017 07:52:58 -0500 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1cYXvc-0004LU-OG for guix-devel@gnu.org; Tue, 31 Jan 2017 13:52:56 +0100 In-Reply-To: <20170131125339.18500-1-contact.ng0@cryptolab.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Cc: ng0 From: ng0 * 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 ;;; Copyright © 2016 Sou Bunnbu ;;; Copyright © 2016 Troy Sankey -;;; Copyright © 2016 ng0 +;;; Copyright © 2016, 2017 ng0 ;;; Copyright © 2016 Dylan Jeffers ;;; Copyright © 2016 David Craven ;;; Copyright © 2016, 2017 Marius Bakke @@ -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