guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4 v2] gnu: Add bpython.


From: Hartmut Goebel
Subject: [PATCH 4/4 v2] gnu: Add bpython.
Date: Mon, 2 Jan 2017 17:33:58 +0100

* gnu/packages/python.scm (bpython, bpython2): New variables.
---
 gnu/packages/python.scm | 72 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 04f7a66..56ed7f8 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12392,3 +12392,75 @@ fullscreen terminal rendering, and keyboard input 
event reporting.")
 
 (define-public python2-curtsies-0.1
   (package-with-python2 python-curtsies-0.1))
+
+(define-public bpython
+  (package
+    (name "bpython")
+    (version "0.16")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "bpython" version))
+        (sha256
+          (base32
+           "0pv5dy84idh0l8kxy01ipkpxrf9kcfb7h5q16gqxg2mx0bvdvwzs"))
+        (file-name (string-append name "-" version ".tar.gz"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'add-aliases
+           ;; for symetry to bpython2, add symlinks bypthon3, bpdb3, etc.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (for-each
+                (lambda (old new)
+                  (symlink (string-append out "/bin/" old)
+                           (string-append out "/bin/" new)))
+                '("bpython" "bpython-curses" "bpython-urwid" "bpdb")
+                '("bpython3" "bpython3-curses" "bpython3-urwid" "bpdb3"))))))))
+    (propagated-inputs
+     `(("python-pygments" ,python-pygments)
+       ("python-requests", python-requests)
+       ("python-babel" ,python-babel) ;; optional, for internationalization
+       ("python-curtsies" ,python-curtsies-0.1) ;; >= 0.1.18,< 0.2
+       ("python-greenlet" ,python-greenlet)
+       ("python-urwid" ,python-urwid) ;; for bpython-urwid only
+       ("python-six" ,python-six)))
+    (native-inputs
+     `(("python-sphinx" ,python-sphinx)
+       ("python-mock" ,python-mock)))
+    (home-page "https://bpython-interpreter.org/";)
+    (synopsis "Fancy interface to the Python interpreter")
+    (description "Bpython is a fancy interface to the Python
+interpreter. bpython's main features are
+
address@hidden
address@hidden in-line syntax highlighting,
address@hidden readline-like autocomplete with suggestions displayed as you 
type,
address@hidden expected parameter list for any Python function,
address@hidden \"rewind\" function to pop the last line of code from memory and
+      re-evaluate,
address@hidden send the code you've entered off to a pastebin,
address@hidden save the code you've entered to a file, and
address@hidden auto-indentation.
address@hidden enumerate")
+    (license license:expat)))
+
+(define-public bpython2
+  (let ((base (package-with-python2
+               (strip-python2-variant bpython))))
+    (package (inherit base)
+      (name "bpython2")
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-before 'build 'rename-scripts
+             ;; rename the scripts to bypthon2, bpdb2, etc.
+             (lambda _
+               (substitute* "setup.py"
+                 (("^(\\s+'bpdb)(\\s+=.*',?)\\s*?$" _ name rest)
+                  (string-append name "2" rest "\n"))
+                 (("^(\\s+'bpython)(-\\S+)?(\\s+=.*',?)\\s*?$" _ name sub rest)
+                  (string-append name "2" (or sub "") rest "\n")))
+               #t))))))))
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]