Patchwork [1/4] gnu: Add python-avro.

login
register
mail settings
Submitter Marius Bakke
Date Sept. 26, 2016, 7:56 p.m.
Message ID <871t06o2ot.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me>
Download mbox | patch
Permalink /patch/16024/
State New
Headers show

Comments

Marius Bakke - Sept. 26, 2016, 7:56 p.m.
Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 25.09.2016 um 23:17 schrieb Marius Bakke:
>> +;;; Avro uses a single source repository for all implementations. The individual
>> +;;; released versions often have missing or incomplete test data, so we define
>> +;;; the common source here for use in all avro packages.
>> +(define (avro-version) "1.8.1")
>> +(define (avro-source version)
>
> With "Avro uses a single source repository for all implementations " you
> mean for both Python 2 and Python 3? Well, this is the common case :-)
> Any other packages do have this and we never use a separate definition
> for source or version. Please have a look at e.g. python-graphql-relay
> (picked as example at random).

This is a rather special case. I've updated the comment to make it more
clear. The Avro repository contains one folder for each language
implementation, and py2 and py3 are developed separately:

https://www-eu.apache.org/dist/avro/avro-1.8.1/

The source in this case contains all those subfolders. I'm only building
the two different Python implementations for now, but expect the other
interfaces to be able to use the same source when packaged.

There are release tarballs for the subdirectories, but at least the py3
version was missing tests, which was also the case on PyPi:

https://pypi.python.org/pypi/avro
https://pypi.python.org/pypi/avro-python3

> Am 25.09.2016 um 23:17 schrieb Marius Bakke:
>> +     `(#:configure-flags '("--single-version-externally-managed" "--root=/")
>
> Same here, please add a comment,
>
> BTW: What should --root=/ be goof for? AFAIK this is the default?!

When using --single-version-externally-managed without --root, the
install phase fails with:

error: You must specify --record or --root when building system packages

As to why it is needed, there is another side effect in
python-build-system that is not mentioned in the bug report, but the
same fix works. When not specified, "bin" inputs may end up in the "bin"
output of the package! E.g. for pbcommand, $out/bin contains
"jsonschema" from the python-jsonschema package, whereas
sphinx-bootstrap-theme has "easy_install" in $out/bin and
sphinx-argparse/bin contains various executables from python-sphinx.

I've updated the patch series addressing these and your other comments.

Thanks for the feedback!
Ludovic Courtès - Oct. 4, 2016, 9:35 a.m.
Hi,

Marius Bakke <mbakke@fastmail.com> skribis:

> I've updated the patch series addressing these and your other comments.

If this addresses Hartmut’s comments, and you can also address the
comment I just made for patch #1, then go ahead and push these changes
once your account is ready.  :-)

Ludo’.

Patch

From 4d49796615cfbd8c34890835689eea74ddcfca60 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Sun, 25 Sep 2016 21:11:58 +0100
Subject: [PATCH 4/4] gnu: Add python2-pbcommand.

* gnu/packages/bioinformatics.scm (python2-pbcommand): New variable.
---
 gnu/packages/bioinformatics.scm | 52 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 1bf91a9..f5a5756 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -3373,6 +3373,58 @@  interrupted by stop codons.  OrfM finds and prints these ORFs.")
     (home-page "https://github.com/wwood/OrfM")
     (license license:lgpl3+)))
 
+(define-public python2-pbcommand
+  ;; Upstream does not tag git releases and PyPi is out of date.
+  ;; See https://github.com/PacificBiosciences/pbcommand/issues/116
+  (let ((revision "1")
+        (commit "e83a3443a1cd42b4da0d210201d711ede789917f"))
+    (package
+      (name "python2-pbcommand")
+      (version (string-append "0.4.11-" revision "." (string-take commit 7)))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/PacificBiosciences/pbcommand.git")
+                      (commit commit)))
+                (file-name (string-append name "-" version "-checkout"))
+                (sha256
+                 (base32
+                  "1kwg84f23l7ik65qy7cxa6g5nipc2y23mppigd4j3vlzam18v52h"))))
+      (build-system python-build-system)
+      (arguments
+       `(#:python ,python-2
+         ;; Without this flag, various artifacts from the build inputs may end up
+         ;; in the final output. It also works around https://bugs.gnu.org/20765 .
+         #:configure-flags '("--single-version-externally-managed" "--root=/")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'substitute-/bin/bash
+             (lambda _
+               ;; Fully qualify /bin/bash for running external commands.
+               (substitute* "pbcommand/engine/runner.py"
+                 (("/bin/bash") (which "bash")))
+               #t))
+           (replace 'check
+             (lambda _ (zero? (system* "nosetests" "-v")))))))
+      (native-inputs
+       `(("python-nose" ,python2-nose)
+         ("python-sphinx-bootstrap-theme" ,python2-sphinx-bootstrap-theme)
+         ("python-sphinx-argparse" ,python2-sphinx-argparse)
+         ("python-tox" ,python2-tox)
+         ("python-setuptools" ,python2-setuptools)))
+      (propagated-inputs
+       `(("python-functools32" ,python2-functools32)
+         ("python-jsonschema" ,python2-jsonschema)
+         ("python-numpy" ,python2-numpy "out")
+         ("python-avro" ,python2-avro)
+         ("python-requests" ,python2-requests)
+         ("python-iso8601" ,python2-iso8601)))
+      (home-page "https://github.com/PacificBiosciences/pbcommand")
+      (synopsis "PacBio common models and CLI tool contract interface")
+      (description "PacBio library for common utils, models, and tools
+to interface with pbsmrtpipe workflow engine.")
+      (license license:bsd-3))))
+
 (define-public python2-pbcore
   (package
     (name "python2-pbcore")
-- 
2.10.0