unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#29784] [PATCH 2/2] gnu: Add python-activepapers
@ 2017-12-19 11:50 Konrad Hinsen
  2017-12-21  9:57 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Konrad Hinsen @ 2017-12-19 11:50 UTC (permalink / raw)
  To: 29784

 gnu/packages/python.scm | 68 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 5580b7d50..1a376e04d 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12000,3 +12000,71 @@ particularly convenient for use in tests.")
 (define-public python2-tempdir
   (package-with-python2 python-tempdir))
 
+(define-public python-activepapers
+  (package
+    (name "python-activepapers")
+    (version "0.2.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ActivePapers.Py" version))
+       (sha256
+        (base32
+         "02bpx36ixwag1g958plgjwpxaiadsj4669gsnxc8hb5aw2jplnr5"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'delete-python2-code
+           (lambda _
+             (for-each delete-file
+                       '("lib/activepapers/builtins2.py"
+                         "lib/activepapers/standardlib2.py"
+                         "lib/activepapers/utility2.py"))))
+         (replace 'check
+           (lambda _
+             (use-modules (srfi srfi-1)
+                          (ice-9 ftw))
+             ;; Deactivate the test cases that download files
+             (setenv "NO_NETWORK_ACCESS" "1")
+             ;; For some strange reason, some tests fail if nosetests runs all
+             ;; test modules in a single execution. They pass if each test
+             ;; module is run individually.
+             (every zero?
+                    (map (lambda (filename)
+                           (system* "nosetests"
+                                    (string-append "tests/" filename)))
+                         (scandir "tests"
+                                  (lambda (filename)
+                                    (string-suffix? ".py" filename))))))))))
+    (native-inputs
+     `(("python-tempdir" ,python-tempdir)
+       ("python-nose" ,python-nose)))
+    (propagated-inputs
+     `(("python-h5py" ,python-h5py)))
+    (home-page "http://www.activepapers.org/")
+    (synopsis "Executable papers for scientific computing")
+    (description
+     "ActivePapers is a tool for working with executable papers, which
+combine data, code, and documentation in single-file packages,
+suitable for publication as supplementary material or on repositories
+such as figshare or Zenodo.")
+    (properties `((python2-variant . ,(delay python2-activepapers))))
+    (license license:bsd-3)))
+
+(define-public python2-activepapers
+  (let ((base (package-with-python2
+               (strip-python2-variant python-activepapers))))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (delete 'delete-python2-code)
+             (add-after 'unpack 'delete-python3-code
+               (lambda _
+                 (for-each delete-file
+                           '("lib/activepapers/builtins3.py"
+                             "lib/activepapers/standardlib3.py"
+                             "lib/activepapers/utility3.py")))))))))))
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-12-22  8:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-19 11:50 [bug#29784] [PATCH 2/2] gnu: Add python-activepapers Konrad Hinsen
2017-12-21  9:57 ` Ludovic Courtès
2017-12-21 11:52   ` Konrad Hinsen
2017-12-21 12:09     ` Konrad Hinsen
2017-12-21 15:47       ` Ludovic Courtès
2017-12-21 17:00         ` Konrad Hinsen
2017-12-22  8:47           ` bug#29784: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).