From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: [PATCH v2 09/10] gnu: Add python-natsort. Date: Sun, 24 Apr 2016 23:06:23 +1000 Message-ID: <1461503184-8841-10-git-send-email-donttrustben@gmail.com> References: <1461244921-7412-1-git-send-email-donttrustben@gmail.com> <1461503184-8841-1-git-send-email-donttrustben@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auJkh-0002OZ-0d for Guix-devel@gnu.org; Sun, 24 Apr 2016 09:07:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auJkg-0007Kt-26 for Guix-devel@gnu.org; Sun, 24 Apr 2016 09:07:06 -0400 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]:35745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auJkf-0007KL-S6 for Guix-devel@gnu.org; Sun, 24 Apr 2016 09:07:06 -0400 Received: by mail-pa0-x244.google.com with SMTP id zy2so15298733pac.2 for ; Sun, 24 Apr 2016 06:07:05 -0700 (PDT) Received: from localhost.localdomain ([103.25.181.216]) by smtp.googlemail.com with ESMTPSA id a64sm2229285pfa.6.2016.04.24.06.07.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Apr 2016 06:07:04 -0700 (PDT) In-Reply-To: <1461503184-8841-1-git-send-email-donttrustben@gmail.com> 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 * gnu/packages/python.scm (python-natsort, python2-natsort): New variables. --- gnu/packages/python.scm | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 40d28b1..8ae7566 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -8874,6 +8874,47 @@ The same is true of requests in terms of caching.") (inherit base) (native-inputs `(("python2-setuptools" ,python2-setuptools)))))) +(define-public python-natsort + (package + (name "python-natsort") + (version "4.0.4") + (source + (origin + (method url-fetch) + (uri (pypi-uri "natsort" version)) + (sha256 + (base32 + "0f8q66pyczgy1cm3nh8rkh7hgl9h49zx9r06mivg4y5sbzla6sy7")))) + (build-system python-build-system) + (native-inputs + `(("python-pytest" ,python-pytest) + ("python-pytest-flakes" ,python-pytest-flakes) + ("python-pytest-cov" ,python-pytest-cov) + ("python-pytest-cache" ,python-pytest-cache) + ("python-hypothesis" ,python-hypothesis) + ("python-pytest-pep8", python-pytest-pep8))) + (home-page "https://github.com/SethMMorton/natsort") + (synopsis "Sort lists naturally") + (description "When you try to sort a list of strings that contain numbers, +the normal python sort algorithm sorts lexicographically, so you might not get +the results that you expect. @code{natsort} provides a function +@code{natsorted} that helps sort lists 'naturally', either as real +numbers (i.e. signed/unsigned floats or ints), or as versions.") + (license license:expat) + (properties `((python2-variant . ,(delay python2-natsort)))))) + +(define-public python2-natsort + (let ((base (package-with-python2 + (strip-python2-variant python-natsort)))) + (package + (inherit base) + (native-inputs + (append (package-native-inputs base) + `(("python2-mock" ,python2-mock) + ("python2-pathlib" ,python2-pathlib) + ("python2-enum34" ,python2-enum34) + ("python2-setuptools" ,python2-setuptools))))))) + (define-public python-cysignals (package (name "python-cysignals") -- 2.5.0