From 7e2dd00bfb2d1a5522bb35d876f2a0344034df48 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Tue, 6 Feb 2018 10:55:24 +0100 Subject: gnu: Add python-funcy. * gnu/packages/python.scm (python-funcy, python2-funcy): New variables. --- gnu/packages/python.scm | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 7838207762..a6de4550fd 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -12479,3 +12479,56 @@ functions by partial application of operators.") (define-public python2-whatever (package-with-python2 python-whatever)) + +(define-public python-funcy + (package + (name "python-funcy") + (version "1.10") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/Suor/funcy/archive/" version + ".tar.gz")) + (sha256 + (base32 + "1fanxivsip29vgarw6dn39xym3q4pbxcpa11plpp548lvxajpahz")) + (file-name (string-append name "-" version ".tar.gz")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "py.test")))))) + (native-inputs + `(("python-pytest-3.0" ,python-pytest-3.0) + ("python-pytest-warnings" ,python-pytest-warnings) + ("python-whatever" ,python-whatever))) + (home-page "http://github.com/Suor/funcy") + (synopsis "Functional tools") + (description "@code{funcy} is a library that provides functional tools. +Examples are: +@enumerate +@item merge - Merges collections of the same type +@item walk - Type-preserving map +@item select - Selects a part of a collection +@item take - Takes the first n items of a collection +@item first - Takes the first item of a collection +@item remove - Predicated-removes items of a collection +@item concat - Concatenates two collections +@item flatten - Flattens a collection with subcollections +@item distinct - Returns only distinct items +@item split - Predicated-splits a collection +@item split_at - Splits a collection at a given item +@item group_by - Groups items by group +@item pairwise - Pairs off adjacent items +@item partial - Partially-applies a function +@item curry - Curries a function +@item compose - Composes functions +@item complement - Complements a predicate +@item all_fn - \"all\" with predicate +@end enumerate") + (license license:bsd-3))) + +(define-public python2-funcy + (package-with-python2 python-funcy)) -- cgit v1.2.3