From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roel Janssen Subject: Re: [PATCH 09/16] gnu: Add python-entrypoints. Date: Tue, 01 Nov 2016 17:18:18 +0100 Message-ID: <874m3rmawl.fsf@gnu.org> References: <20161101122046.751-1-ricardo.wurmus@mdc-berlin.de> <20161101122046.751-10-ricardo.wurmus@mdc-berlin.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1bkE-0008Kd-HF for guix-devel@gnu.org; Tue, 01 Nov 2016 12:17:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1bkA-0002zN-FN for guix-devel@gnu.org; Tue, 01 Nov 2016 12:17:02 -0400 In-reply-to: <20161101122046.751-10-ricardo.wurmus@mdc-berlin.de> 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: Ricardo Wurmus Cc: guix-devel@gnu.org Ricardo Wurmus writes: > * gnu/packages/python.scm (python-entrypoints, python2-entrypoints): New > variables. > --- > gnu/packages/python.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > > diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm > index a2d3d3c..621c4d0 100644 > --- a/gnu/packages/python.scm > +++ b/gnu/packages/python.scm > @@ -6719,6 +6719,61 @@ Jupyter Notebook format and Python APIs for working with notebooks.") > (define-public python2-bleach > (package-with-python2 python-bleach)) > > +(define-public python-entrypoints > + (package > + (name "python-entrypoints") > + (version "0.2.2") > + (source > + (origin > + (method url-fetch) > + (uri (string-append "https://github.com/takluyver/entrypoints/archive/" > + version ".tar.gz")) > + (file-name (string-append name "-" version ".tar.gz")) > + (sha256 > + (base32 > + "0azqlkh3j0za080lsf5crnhaxx3c93k9dpv5ihkhf5cppgw5sjz5")))) > + (build-system python-build-system) > + ;; The package does not come with a setup.py file, so we have to install > + ;; the file along with a custom egg-info file. > + (arguments > + `(#:tests? #f > + #:phases > + (modify-phases %standard-phases > + (delete 'build) > + (replace 'install > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (python-version ((@@ (guix build python-build-system) > + get-python-version) > + (assoc-ref inputs "python"))) > + (target (string-append out "/lib/python" python-version > + "/site-packages/"))) > + (mkdir-p target) > + (call-with-output-file (string-append target "entrypoints.egg-info") > + (lambda (port) > + (format port "\ > +Metadata-Version: 1.1 > +Name: entrypoints > +Version: ~a > +Summary: Discover and load entry points from installed packages > +Author: Thomas Kluyver > +Author-email: thomas@kluyver.me.uk > +Classifier: License :: OSI Approved :: MIT License > +" ,version))) I wonder if this would be nicer to do in a separate patch.. > + (install-file "entrypoints.py" target) > + #t)))))) > + (home-page "https://github.com/takluyver/entrypoints") > + (synopsis "Discover and load entry points from installed Python packages") > + (description "Entry points are a way for Python packages to advertise > +objects with some common interface. The most common examples are > +@code{console_scripts} entry points, which define shell commands by > +identifying a Python function to run. The @code{entrypoints} module contains > +functions to find and load entry points.") > + (license license:expat))) > + > +(define-public python2-entrypoints > + (package-with-python2 python-entrypoints)) > + > (define-public python-chardet > (package > (name "python-chardet") LGTM! Kind regards, Roel Janssen