aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/python.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-02-20 17:36:56 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-02-20 17:36:56 +0100
commit7f69459aca16756f35f08049c64a1bd77d23f33e (patch)
tree1d267fb62feab89de5d97582672540cbaa37392c /gnu/packages/python.scm
parent4a82722a658220ec1e10f9f2d5d77407d38db90e (diff)
parentb1989c12501e880afab62d3ff961791906fef350 (diff)
downloadpatches-7f69459aca16756f35f08049c64a1bd77d23f33e.tar
patches-7f69459aca16756f35f08049c64a1bd77d23f33e.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r--gnu/packages/python.scm839
1 files changed, 675 insertions, 164 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 99e5bd9e0b..5bbe472da6 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -19,14 +19,14 @@
;;; Copyright © 2015, 2016 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
-;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2016, 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2016 Daniel Pimentel <d4n1@d4n1.org>
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016, 2017 Troy Sankey <sankeytms@gmail.com>
;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
;;; Copyright © 2016 David Craven <david@craven.ch>
-;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2016, 2017 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
;;; Copyright © 2016, 2017 Alex Vong <alexvong1995@gmail.com>
@@ -36,15 +36,17 @@
;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
-;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
+;;; Copyright © 2017, 2018 Adriano Peluso <catonano@gmail.com>
;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
-;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
+;;; Copyright © 2017, 2018 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2017 Muriithi Frederick Muriuki <fredmanglis@gmail.com>
;;; Copyright © 2017 Brendan Tildesley <brendan.tildesley@openmailbox.org>
+;;; Copyright © 2018 Ethan R. Jones <ethanrjones97@gmail.com
+;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -76,6 +78,7 @@
#:use-module (gnu packages file)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gcc)
+ #:use-module (gnu packages geo)
#:use-module (gnu packages ghostscript)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
@@ -109,6 +112,7 @@
#:use-module (gnu packages shells)
#:use-module (gnu packages ssh)
#:use-module (gnu packages statistics)
+ #:use-module (gnu packages terminals)
#:use-module (gnu packages tex)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages time)
@@ -471,6 +475,52 @@ pidof, tty, taskset, pmap.")
(define-public python2-psutil
(package-with-python2 python-psutil))
+(define-public python-shapely
+ (package
+ (name "python-shapely")
+ (version "1.6.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "Shapely" version))
+ (sha256
+ (base32
+ "0svc58dzcw9gj92b4sgq35sdxkf85z0qwlzxarkzq4bp3h8jy58l"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-cython" ,python-cython)
+ ("python-matplotlib" ,python-matplotlib)
+ ("python-pytest" ,python-pytest)
+ ("python-pytest-cov" ,python-pytest-cov)))
+ (inputs
+ `(("geos" ,geos)))
+ (propagated-inputs
+ `(("python-numpy" ,python-numpy)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-geos-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((geos (assoc-ref inputs "geos"))
+ (glibc (assoc-ref inputs ,(if (%current-target-system)
+ "cross-libc" "libc"))))
+ (substitute* "shapely/geos.py"
+ (("_lgeos = load_dll\\('geos_c', fallbacks=.*\\)")
+ (string-append "_lgeos = load_dll('geos_c', fallbacks=['"
+ geos "/lib/libgeos_c.so'])"))
+ (("free = load_dll\\('c'\\)\\.free")
+ (string-append "free = load_dll('c', fallbacks=['"
+ glibc "/lib/libc.so.6']).free"))))
+ #t)))))
+ (home-page "https://github.com/Toblerity/Shapely")
+ (synopsis "Library for the manipulation and analysis of geometric objects")
+ (description "Shapely is a Python package for manipulation and analysis of
+planar geometric objects. It is based on the @code{GEOS} library.")
+ (license license:bsd-3)))
+
+(define-public python2-shapely
+ (package-with-python2 python-shapely))
+
(define-public python-clyent
(package
(name "python-clyent")
@@ -774,15 +824,15 @@ Python 3 support.")
(source
(origin
(method url-fetch)
- (uri (string-append "https://bitbucket.org/emptypage/uniseg-python/"
- "get/rel-" version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (uri (pypi-uri "uniseg" version ".zip"))
(sha256
(base32
- "1df4gddnj2a0v8z35wb2ra5vvh1f1qyxs8fgd25c8g64031mna6x"))))
+ "05jsazvz6nbmh6l3v1rph5ydkqn1hzx1pyggdyvgp2qgmgrnmiz2"))))
(build-system python-build-system)
(arguments
'(#:tests? #f)) ; The test suite requires network access.
+ (native-inputs
+ `(("unzip" ,unzip)))
(home-page
"https://bitbucket.org/emptypage/uniseg-python")
(synopsis
@@ -1017,24 +1067,48 @@ human-friendly syntax.")
(define-public python-pandas
(package
(name "python-pandas")
- (version "0.19.2")
+ (version "0.22.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "pandas" version))
(sha256
- (base32 "0540cnbwy2hc4hv2sxfs8i47xi91qzvzxfn80dl785ibiicly3vg"))
- (patches
- (search-patches "python-pandas-skip-failing-tests.patch"))))
+ (base32 "0v0fi2i10kwnmlpsl6f1fgajcpx3q6766qf6xqi5kw3ivn8l1aa4"))))
(build-system python-build-system)
+ (arguments
+ `(#:modules ((guix build utils)
+ (guix build python-build-system)
+ (ice-9 ftw)
+ (srfi srfi-26))
+ #:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (let ((build-directory
+ (string-append
+ (getcwd) "/build/"
+ (car (scandir "build"
+ (cut string-prefix? "lib." <>))))))
+ (with-directory-excursion build-directory
+ ;; Delete tests that require "moto" which is not yet in Guix.
+ (for-each delete-file
+ '("pandas/tests/io/conftest.py"
+ "pandas/tests/io/json/test_compression.py"
+ "pandas/tests/io/test_excel.py"))
+ (invoke "pytest" "-v" "pandas" "-k"
+ (string-append
+ "not network and not disabled"
+ ;; XXX: Due to the deleted tests above.
+ " and not test_read_s3_jsonl")))))))))
(propagated-inputs
`(("python-numpy" ,python-numpy)
("python-pytz" ,python-pytz)
("python-dateutil" ,python-dateutil)))
(native-inputs
- `(("python-nose" ,python-nose)
- ("python-cython" ,python-cython)))
- (home-page "http://pandas.pydata.org")
+ `(("python-cython" ,python-cython)
+ ("python-lxml" ,python-lxml)
+ ("python-nose" ,python-nose)
+ ("python-pytest" ,python-pytest)))
+ (home-page "https://pandas.pydata.org")
(synopsis "Data structures for data analysis, time series, and statistics")
(description
"Pandas is a Python package providing fast, flexible, and expressive data
@@ -2661,16 +2735,16 @@ between language specification and implementation aspects.")
(define-public python-numpy
(package
(name "python-numpy")
- (version "1.13.3")
+ (version "1.14.0")
(source
(origin
(method url-fetch)
(uri (string-append
- "https://github.com/numpy/numpy/archive/v" version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ "https://github.com/numpy/numpy/releases/download/v"
+ version "/numpy-" version ".tar.gz"))
(sha256
(base32
- "1f25rbn6n4ia87spy18iwc76g36d9mimyl27p2lfaalgx897pf8x"))))
+ "1kh7y2ay21s9mcc11mq59g2f1yc75v152z2k2vlh0xmh9c9rjpf4"))))
(build-system python-build-system)
(inputs
`(("openblas" ,openblas)
@@ -2804,14 +2878,14 @@ objects.")
(define-public python-colormath
(package
(name "python-colormath")
- (version "2.1.1")
+ (version "3.0.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "colormath" version))
(sha256
(base32
- "01wp5xwm0a89wdm1dc9rr1ij90idzdiiipxdj1yslhqzkhnjnfh0"))))
+ "05qjycgxp3p2f9n6lmic68sxmsyvgnnlyl4z9w7dl9s56jphaiix"))))
(build-system python-build-system)
(propagated-inputs
`(("python-networkx" ,python-networkx)
@@ -2828,14 +2902,14 @@ objects.")
(define-public python-spectra
(package
(name "python-spectra")
- (version "0.0.8")
+ (version "0.0.11")
(source
(origin
(method url-fetch)
(uri (pypi-uri "spectra" version))
(sha256
(base32
- "0n87kzhpkml2s2q91rdkl8wz2kkv5b0bkrgww45lxa5vq34qh6w5"))))
+ "1f322x914bhkg6r5gv1vmnir3iy0k5kih0fd2gp3rdkw32jn5cwf"))))
(build-system python-build-system)
(arguments
`(#:phases
@@ -3255,6 +3329,7 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
;; object. For this reason we need to import both libraries.
;; https://pythonhosted.org/cairocffi/cffi_api.html#converting-pycairo
("python-pycairo" ,python-pycairo)
+ ("python-pyqt" ,python-pyqt)
("python-cairocffi" ,python-cairocffi)))
(inputs
`(("libpng" ,libpng)
@@ -3264,7 +3339,6 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
("glib" ,glib)
;; FIXME: Add backends when available.
;("python-wxpython" ,python-wxpython)
- ("python-pyqt" ,python-pyqt)
("tcl" ,tcl)
("tk" ,tk)))
(native-inputs
@@ -3484,14 +3558,14 @@ functions.")
(define-public python-scipy
(package
(name "python-scipy")
- (version "0.19.1")
+ (version "1.0.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "scipy" version))
(sha256
(base32
- "1rl411bvla6q7qfdb47fpdnyjhfgzl6smpha33n9ar1klykjr6m1"))))
+ "043djb3vyk6qripmyw30jhl0g8qza0fmar6wck10iv79l08izsl7"))))
(build-system python-build-system)
(propagated-inputs
`(("python-numpy" ,python-numpy)
@@ -3502,11 +3576,12 @@ functions.")
("openblas" ,openblas)))
(native-inputs
`(("python-cython" ,python-cython)
- ("python-nose" ,python-nose)
+ ("python-pytest" ,python-pytest)
("python-sphinx" ,python-sphinx)
("python-numpydoc" ,python-numpydoc)
("gfortran" ,gfortran)
- ("perl" ,perl)))
+ ("perl" ,perl)
+ ("which" ,which)))
(outputs '("out" "doc"))
(arguments
`(#:phases
@@ -3535,7 +3610,11 @@ atlas_libs = openblas
(let* ((data (string-append (assoc-ref outputs "doc") "/share"))
(doc (string-append data "/doc/" ,name "-" ,version))
(html (string-append doc "/html"))
- (pyver ,(string-append "PYVER=")))
+ (pyver ,(string-append "PYVER=" (version-major+minor
+ (package-version python))))
+ ;; By default it tries to run sphinx-build through the Python
+ ;; interpreter which won't work with our shell wrapper.
+ (sphinxbuild "SPHINXBUILD=LANG=C sphinx-build"))
;; Make installed package available for building the
;; documentation
(add-installed-pythonpath inputs outputs)
@@ -3545,7 +3624,7 @@ atlas_libs = openblas
(("pngmath_use_preview = True")
"pngmath_use_preview = False"))
(mkdir-p html)
- (system* "make" "html" pyver)
+ (invoke "make" "html" pyver sphinxbuild)
(with-directory-excursion "build/html"
(for-each (lambda (file)
(let* ((dir (dirname file))
@@ -3553,21 +3632,15 @@ atlas_libs = openblas
(install-file file html)))
(find-files "." ".*")))))
#t))
- (add-after 'unpack 'fix-tests
- (lambda _
- (substitute* "scipy/integrate/tests/test_quadpack.py"
- (("libm.so") "libm.so.6"))
- #t))
- ;; Tests can only be run after the library has been installed and not
- ;; within the source directory.
+ ;; Tests can only be run after the library has been installed and not
+ ;; within the source directory.
(delete 'check)
(add-after 'install 'check
(lambda* (#:key inputs outputs #:allow-other-keys)
(add-installed-pythonpath inputs outputs)
(with-directory-excursion "/tmp"
- (zero? (system* "python" "-c"
- "import scipy; scipy.test('full')")))
- #t)))))
+ (invoke "python" "-c"
+ "import scipy; scipy.test('full', verbose=2)")))))))
(home-page "https://www.scipy.org/")
(synopsis "The Scipy library provides efficient numerical routines")
(description "The SciPy library is one of the core packages that make up
@@ -4297,7 +4370,7 @@ standard library.")
(base32 "19l2pp1c64ansr89l3cqh19jdi2ixhssdzx0vz4n6r52a6i281is"))))
(build-system python-build-system)
(arguments `(#:tests? #f)) ; no tests
- (home-page "http://ipython.org")
+ (home-page "https://ipython.org")
(synopsis "Vestigial utilities from IPython")
(description
"This package provides retired utilities from IPython. No packages
@@ -4334,7 +4407,7 @@ away.")
(native-inputs
`(("python-mock" ,python-mock)
("python-nose" ,python-nose)))
- (home-page "http://ipython.org")
+ (home-page "https://ipython.org")
(synopsis "Configuration system for Python applications")
(description
"Traitlets is a framework that lets Python classes have attributes with
@@ -4422,7 +4495,7 @@ installing @code{kernelspec}s for use with Jupyter frontends.")
(propagated-inputs
;; imported at runtime during connect
`(("python-jupyter-client" ,python-jupyter-client)))
- (home-page "http://ipython.org")
+ (home-page "https://ipython.org")
(synopsis "IPython Kernel for Jupyter")
(description
"This package provides the IPython kernel for Jupyter.")
@@ -4568,7 +4641,7 @@ installing @code{kernelspec}s for use with Jupyter frontends.")
(substitute* "./IPython/core/tests/test_magic.py"
(("def test_dirops\\(\\):" all)
(string-append "@dec.skipif(True)\n" all))))))))
- (home-page "http://ipython.org")
+ (home-page "https://ipython.org")
(synopsis "IPython is a tool for interactive computing in Python")
(description
"IPython provides a rich architecture for interactive computing with:
@@ -4813,19 +4886,20 @@ interfaces in an easy and portable manner.")
(define-public python-networkx
(package
(name "python-networkx")
- (version "1.11")
+ (version "2.1")
(source
(origin
(method url-fetch)
- (uri (pypi-uri "networkx" version))
+ (uri (pypi-uri "networkx" version ".zip"))
(sha256
- (base32 "1f74s56xb4ggixiq0vxyfxsfk8p20c7a099lpcf60izv1php03hd"))))
+ (base32 "1ccb8mfz4m821k9y0cigkbq42q2sbb4dj5fbjshp0awp32j2q9v4"))))
(build-system python-build-system)
;; python-decorator is needed at runtime
(propagated-inputs
`(("python-decorator" ,python-decorator)))
(native-inputs
- `(("python-nose" ,python-nose)))
+ `(("python-nose" ,python-nose)
+ ("unzip" ,unzip)))
(home-page "http://networkx.github.io/")
(synopsis "Python module for creating and manipulating graphs and networks")
(description
@@ -5394,17 +5468,43 @@ complexity of Python source code.")
("python2-enum" ,python2-enum)
,@(package-propagated-inputs base))))))
+;; python-hacking requires flake8 <2.6.0.
+(define-public python-flake8-2.5
+ (package
+ (inherit python-flake8)
+ (version "2.5.5")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "flake8" version))
+ (sha256
+ (base32
+ "1snylqwbmrylbx3r1wpz8ggk98f6bcag4441ag8mm2l7wyn58sij"))))
+ (propagated-inputs
+ `(("python-pep8" ,python-pep8)
+ ,@(package-propagated-inputs python-flake8)))
+ (properties `((python2-variant . ,(delay python2-flake8-2.5))))))
+
+(define-public python2-flake8-2.5
+ (package
+ (inherit python2-flake8)
+ (version (package-version python-flake8-2.5))
+ (source (origin
+ (inherit (package-source python-flake8-2.5))))
+ (propagated-inputs
+ `(("python2-pep8" ,python2-pep8)
+ ,@(package-propagated-inputs python2-flake8)))))
+
(define-public python-flake8-polyfill
(package
(name "python-flake8-polyfill")
- (version "1.0.1")
+ (version "1.0.2")
(source
(origin
(method url-fetch)
(uri (pypi-uri "flake8-polyfill" version))
(sha256
(base32
- "02gn2wxvh9vnf7m7dld7ca4l60mg5c370hv3swwppkngwaqmcw67"))))
+ "1nlf1mkqw856vi6782qcglqhaacb23khk9wkcgn55npnjxshhjz4"))))
(build-system python-build-system)
(arguments
'(#:phases
@@ -5418,6 +5518,7 @@ complexity of Python source code.")
(native-inputs
`(("python-flake8" ,python-flake8)
("python-mock" ,python-mock)
+ ("python-pep8" ,python-pep8)
("python-pycodestyle" ,python-pycodestyle)
("python-pytest" ,python-pytest)))
(home-page "https://gitlab.com/pycqa/flake8-polyfill")
@@ -5690,15 +5791,13 @@ should be stored on various operating systems.")
(define-public python-llfuse
(package
(name "python-llfuse")
- (version "1.2")
+ (version "1.3.2")
(source (origin
(method url-fetch)
- (uri (string-append
- "https://bitbucket.org/nikratio/python-llfuse/downloads/"
- "llfuse-" version ".tar.bz2"))
+ (uri (pypi-uri "llfuse" version ".tar.bz2"))
(sha256
(base32
- "11hms1x68bf1bqbqy7w3wpffqsd3jkgricmzrc1hrnwkswfzzlr4"))))
+ "0qxvnbz41bpvpc1vbi8qkhmpr9gj1qrrp5jdj085iqibd8l2l9cn"))))
(build-system python-build-system)
(inputs
`(("fuse" ,fuse)
@@ -6488,7 +6587,7 @@ interactive computing.")
(native-inputs
`(("python-certifi" ,python-certifi)
("python-nose" ,python-nose)))
- (home-page "http://ipython.org")
+ (home-page "https://ipython.org")
(synopsis "IPython HTML widgets for Jupyter")
(description "This package provides interactive HTML widgets for Jupyter
notebooks.")
@@ -6516,7 +6615,7 @@ notebooks.")
("python-ipython" ,python-ipython)
("python-traitlets" ,python-traitlets)
("python-widgetsnbextension" ,python-widgetsnbextension)))
- (home-page "http://ipython.org")
+ (home-page "https://ipython.org")
(synopsis "IPython HTML widgets for Jupyter")
(description "Ipywidgets are interactive HTML widgets for Jupyter
notebooks and the IPython kernel. Notebooks come alive when interactive
@@ -6958,13 +7057,13 @@ minimal and fast API targeting the following uses:
(define-public python-icalendar
(package
(name "python-icalendar")
- (version "4.0.0")
+ (version "4.0.1")
(source (origin
(method url-fetch)
(uri (pypi-uri "icalendar" version))
(sha256
(base32
- "0jfp93x2pnpsbck92zw22dq7sl4pk0avv0gnb4x9vldrg6vlhyin"))))
+ "139y79y6ijl39m5bj771r43vpah9s4ly7d1k76la6hrx7l144ak8"))))
(build-system python-build-system)
(propagated-inputs
`(("python-dateutil" ,python-dateutil)
@@ -7374,14 +7473,14 @@ document.")
(define-public python-botocore
(package
(name "python-botocore")
- (version "1.7.9")
+ (version "1.8.43")
(source
(origin
(method url-fetch)
(uri (pypi-uri "botocore" version))
(sha256
(base32
- "02b1bw25r1wdjs5yppb1h9igf11wj092biriv2yg8hzp5r0wrkmg"))))
+ "12cqpbnz3vfv41mp9admvciw7bc7hz57sjpqs2bxaw9wnfmbw5lg"))))
(build-system python-build-system)
(arguments
;; FIXME: Many tests are failing.
@@ -7477,14 +7576,15 @@ templates into Python modules.")
(define-public python-waitress
(package
(name "python-waitress")
- (version "0.8.10")
+ (version "1.1.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "waitress" version))
+ (patches (search-patches "python-waitress-fix-tests.patch"))
(sha256
(base32
- "017n9ra6vvmq9d5sfhdzyzr1mg15x2hj2dhm4pdlw98c1ypw2h3w"))))
+ "1a85gyji0kajc3p0s1pwwfm06w4wfxjkvvl4rnrz3h164kbd6g6k"))))
(build-system python-build-system)
(home-page "https://github.com/Pylons/waitress")
(synopsis "Waitress WSGI server")
@@ -7598,6 +7698,35 @@ alternative when librabbitmq is not available.")
#:tests? #f
,@(package-arguments amqp))))))
+(define-public python-txamqp
+ (package
+ (name "python-txamqp")
+ (version "0.8.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "txAMQP" version))
+ (sha256
+ (base32
+ "1r43a66dd547mz40ikymm8y3d480cidy560fj81qc0jk4lncgmmr"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-six" ,python-six)
+ ("python-twisted" ,python-twisted)))
+ (home-page "https://github.com/txamqp/txamqp")
+ (synopsis "Communicate with AMQP peers and brokers using Twisted")
+ (description
+ "This package provides a Python library for communicating with AMQP peers
+and brokers using the asynchronous networking framework Twisted. It contains
+all the necessary code to connect, send and receive messages to/from an
+AMQP-compliant peer or broker (Qpid, OpenAMQ, RabbitMQ) using Twisted. It
+also includes support for using Thrift RPC over AMQP in Twisted
+applications.")
+ (license license:asl2.0)))
+
+(define-public python2-txamqp
+ (package-with-python2 python-txamqp))
+
(define-public python-kombu
(package
(name "python-kombu")
@@ -8064,15 +8193,14 @@ is made as zipfile like as possible.")
(define-public python-magic
(package
(name "python-magic")
- (version "0.4.3")
+ (version "0.4.15")
(source
(origin
(method url-fetch)
- (uri (string-append "https://github.com/ahupp/python-magic/archive/"
- version ".tar.gz"))
+ (uri (pypi-uri "python-magic" version))
(sha256
(base32
- "17bgy92i7sb021f2s4mw1dcvpm6p1mi9jihridwy1pyn8mzvpjgk"))
+ "1mgwig9pnzgkf86q9ji9pnc99bngms15lfszq5rgqb9db07mqxpk"))
(file-name (string-append name "-" version "-checkout"))))
(build-system python-build-system)
(arguments
@@ -8090,31 +8218,33 @@ is made as zipfile like as possible.")
;; expected.
'(#:tests? #f
#:phases (modify-phases %standard-phases
- ;; Replace a specific method call with a hard-coded
- ;; path to the necessary libmagic.so file in the
- ;; store. If we don't do this, then the method call
- ;; will fail to find the libmagic.so file, which in
- ;; turn will cause any application using
- ;; python-magic to fail.
- (add-before 'build 'hard-code-path-to-libmagic
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((file (assoc-ref inputs "file")))
- (substitute* "magic.py"
- (("ctypes.util.find_library\\('magic'\\)")
- (string-append "'" file "/lib/libmagic.so'")))
- #t)))
- (add-before 'install 'disable-egg-compression
- (lambda _
- (let ((port (open-file "setup.cfg" "a")))
- (display "\n[easy_install]\nzip_ok = 0\n"
- port)
- (close-port port)
- #t))))))
+ ;; Replace a specific method call with a hard-coded
+ ;; path to the necessary libmagic.so file in the
+ ;; store. If we don't do this, then the method call
+ ;; will fail to find the libmagic.so file, which in
+ ;; turn will cause any application using
+ ;; python-magic to fail.
+ (add-before 'build 'hard-code-path-to-libmagic
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((file (assoc-ref inputs "file")))
+ (substitute* "magic.py"
+ (("ctypes.util.find_library\\('magic'\\)")
+ (string-append "'" file "/lib/libmagic.so'")))
+ #t)))
+ (add-before 'install 'disable-egg-compression
+ (lambda _
+ (let ((port (open-file "setup.cfg" "a")))
+ (display "\n[easy_install]\nzip_ok = 0\n"
+ port)
+ (close-port port)
+ #t))))))
(inputs
;; python-magic needs to be able to find libmagic.so.
`(("file" ,file)))
- (home-page "https://github.com/ahupp/python-magic")
- (synopsis "File type identification using libmagic")
+ (home-page
+ "https://github.com/ahupp/python-magic")
+ (synopsis
+ "File type identification using libmagic")
(description
"This module uses ctypes to access the libmagic file type
identification library. It makes use of the local magic database and
@@ -8482,28 +8612,73 @@ are synchronized with data exchanges on \"channels\".")
(define-public python-gevent
(package
(name "python-gevent")
- (version "1.1.1")
+ (version "1.2.2")
(source (origin
(method url-fetch)
(uri (pypi-uri "gevent" version))
(sha256
(base32
- "1smf3kvidpdiyi2c81alal74p2zm0clrm6xbyy6y1k9a3f2vkrbf"))
+ "0bbbjvi423y9k9xagrcsimnayaqymg6f2dj76m9z3mjpkjpci4a7"))
(modules '((guix build utils)))
(snippet
'(begin
;; unbunding libev and c-ares
- (for-each delete-file-recursively '("libev" "c-ares"))
- ;; fixing testsuite
- (call-with-output-file "greentest/__init__.py" noop)
- (substitute* "greentest/testrunner.py"
- (("import util") "from . import util")
- (("from util import log") "from .util import log"))))))
+ (delete-file-recursively "deps")
+ #t))))
(build-system python-build-system)
+ (arguments
+ `(#:modules ((ice-9 ftw)
+ (srfi srfi-26)
+ (guix build utils)
+ (guix build python-build-system))
+ #:phases (modify-phases %standard-phases
+ (add-after 'unpack 'unpack-libev
+ (lambda* (#:key inputs #:allow-other-keys)
+ (mkdir-p "deps/libev")
+ ;; FIXME: gevent requires building libev, even though
+ ;; it only links against the proper one.
+ (invoke "tar" "-xf" (assoc-ref inputs "libev-source")
+ "--strip-components=1" "-C" "deps/libev")))
+ (add-before 'patch-source-shebangs 'patch-hard-coded-paths
+ (lambda _
+ (substitute* "src/gevent/subprocess.py"
+ (("/bin/sh") (which "sh")))
+ (for-each (lambda (file)
+ (substitute* file
+ (("/bin/sh") (which "sh"))
+ (("/bin/true") (which "true"))))
+ (find-files "src/greentest" "\\.py$"))
+ #t))
+ (add-before 'build 'do-not-use-bundled-sources
+ (lambda _
+ (setenv "CONFIG_SHELL" (which "bash"))
+ (setenv "LIBEV_EMBED" "false")
+ (setenv "CARES_EMBED" "false")
+ (setenv "EMBED" "false")
+ #t))
+ (replace 'check
+ (lambda _
+ ;; Make sure the build directory is on PYTHONPATH.
+ (setenv "PYTHONPATH"
+ (string-append
+ (getenv "PYTHONPATH") ":"
+ (getcwd) "/build/"
+ (car (scandir "build" (cut string-prefix? "lib." <>)))))
+ (with-directory-excursion "src/greentest"
+ ;; XXX: Many tests require network access. Instead we only
+ ;; run known-good tests. Unfortunately we cannot use
+ ;; recursion here since this directory also contains
+ ;; Python-version-specific subfolders.
+ (apply invoke "python" "testrunner.py" "--config"
+ "known_failures.py"
+ (scandir "." (cut regexp-exec
+ (make-regexp "test_+(subprocess|core)")
+ <>)))))))))
(propagated-inputs
`(("python-greenlet" ,python-greenlet)))
(native-inputs
- `(("python-six" ,python-six)))
+ `(("libev-source" ,(package-source libev))
+ ("python-six" ,python-six)))
(inputs
`(("c-ares" ,c-ares)
("libev" ,libev)))
@@ -9203,21 +9378,20 @@ and/or Xon/Xoff. The port is accessed in RAW mode.")
(define-public python-kivy
(package
(name "python-kivy")
- (version "1.9.1")
+ (version "1.10.0")
(source
(origin
(method url-fetch)
- (uri (pypi-uri "kivy" version))
+ (uri (pypi-uri "Kivy" version))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "0zk3g1j1z0lzcm9d0k1lprrs95zr8n8k5pdg3p5qlsn26jz4bg19"))))
+ "1394zh6kvf7k5d8vlzxcsfcailr3q59xwg9b1n7qaf25bvyq1h98"))))
(build-system python-build-system)
(arguments
`(#:tests? #f ; Tests require many optional packages
#:phases
(modify-phases %standard-phases
- (replace 'build (lambda _ (zero? (system* "make" "force"))))
(add-after 'patch-generated-file-shebangs 'set-sdl-paths
(lambda* (#:key inputs #:allow-other-keys)
(setenv "KIVY_SDL2_PATH"
@@ -9225,7 +9399,8 @@ and/or Xon/Xoff. The port is accessed in RAW mode.")
"/include/SDL2"))
#t)))))
(native-inputs
- `(("pkg-config" ,pkg-config)
+ `(("git" ,git)
+ ("pkg-config" ,pkg-config)
("python-cython" ,python-cython)))
(inputs
`(("gstreamer" ,gstreamer)
@@ -9373,8 +9548,8 @@ interface for programs.")
(base32
"0rfyxcy4cr3x848vhx876ifalxd5ghq6l5x813m49h4vq2d4jiq8"))))
(build-system python-build-system)
- (native-inputs
- `(("python-pytest" ,python-pytest)))
+ (arguments
+ '(#:tests? #f)) ; The tests are not distributed
(propagated-inputs
`(("python-requests" ,python-requests)
("python-six" ,python-six)))
@@ -9578,8 +9753,8 @@ to Python.")
(base32
"1nv5dxcj59zv31qvl8bd142njmxcmymny2dz3br1l2cpbljbf5i7"))))
(build-system python-build-system)
- (native-inputs
- `(("python-pytest" ,python-pytest)))
+ (arguments
+ '(#:tests? #f)) ; The tests are not distributed
(propagated-inputs
`(("python-graphql-core" ,python-graphql-core)
("python-promise" ,python-promise)
@@ -10701,49 +10876,31 @@ in other versions.")
(define-public python-mando
(package
- (name "python-mando")
- (version "0.5")
- (source
- (origin
- (method url-fetch)
- (uri (pypi-uri "mando" version))
- (sha256
- (base32
- "0q05h66439gqdmlk4jqm6xrwrzfdgs4mwk70barxhr2y83qbbdc0"))))
- (build-system python-build-system)
- (propagated-inputs
- `(("python-rst2ansi" ,python-rst2ansi)))
- (native-inputs
- `(("python-sphinx" ,python-sphinx-1.5.3)
- ("python-paramunittest" ,python-paramunittest)))
- (home-page "https://mando.readthedocs.org/")
- (synopsis
- "Wrapper around argparse, allowing creation of complete CLI applications")
- (description
- "This package is a wrapper around argparse, allowing you to write complete CLI
- applications in seconds while maintaining all the flexibility.")
- (license license:expat)))
+ (name "python-mando")
+ (version "0.6.4")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "mando" version))
+ (sha256
+ (base32
+ "0q6rl085q1hw1wic52pqfndr0x3nirbxnhqj9akdm5zhq2fv3zkr"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-rst2ansi" ,python-rst2ansi)
+ ("python-six" ,python-six)))
+ (native-inputs
+ `(("python-pytest" ,python-pytest)))
+ (home-page "https://mando.readthedocs.org/")
+ (synopsis
+ "Wrapper around argparse, allowing creation of complete CLI applications")
+ (description
+ "This package is a wrapper around argparse, allowing you to write complete CLI
+applications in seconds while maintaining all the flexibility.")
+ (license license:expat)))
(define-public python2-mando
(package-with-python2 python-mando))
-(define-public python-mando-0.3.1
- ;; python-radon (version 1.5.0) has a requirement
- ;; for mando<0.4,>=0.3
- (package
- (inherit python-mando)
- (name "python-mando")
- (version "0.3.1")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "https://github.com/rubik/mando/archive/v"
- version
- ".tar.gz"))
- (sha256
- (base32
- "17jlkdpqw22z1nyml5ybslilqkzmnk0dxxjml8bfghav1l5hbwd2"))))))
-
(define-public python-fudge
(package
(name "python-fudge")
@@ -11087,18 +11244,20 @@ information.")
(define-public python-relatorio
(package
(name "python-relatorio")
- (version "0.6.4")
+ (version "0.8.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "relatorio" version))
(sha256
(base32
- "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
+ "1na6hlhz1awi1hbjg1gyclq0khz42iz90wvdjw7mmj655788bpxx"))))
(build-system python-build-system)
(propagated-inputs
`(("python-lxml" ,python-lxml)
("python-genshi" ,python-genshi)))
+ (native-inputs
+ `(("python-magic" ,python-magic)))
(home-page "https://relatorio.tryton.org/")
(synopsis "Templating library able to output ODT and PDF files")
(description "Relatorio is a templating library which provides a way to
@@ -11112,24 +11271,27 @@ for more filetypes can be easily added by creating plugins for them.")
(define-public python-radon
(package
(name "python-radon")
- (version "1.5.0")
+ (version "2.2.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "radon" version))
(sha256
(base32
- "1h6jv36am0i827182a04ki6291lyx4kp957xfr5njgprj4nd0qsl"))))
+ "07gq5hq4nrffxnlnksws9hrx7fd001gam63j62i82gyfr23gvdym"))))
(build-system python-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda _
+ (invoke "python" "radon/tests/run.py"))))))
(propagated-inputs
`(("python-colorama" ,python-colorama)
("python-flake8-polyfill" ,python-flake8-polyfill)
- ("python-mando" ,python-mando-0.3.1)))
+ ("python-mando" ,python-mando)))
(native-inputs
- `(("python-flake8" ,python-flake8)
- ("python-tox" ,python-tox)
- ("python-pytest" ,python-pytest)
- ("python-paramunittest" ,python-paramunittest)))
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-mock" ,python-pytest-mock)))
(home-page "https://radon.readthedocs.org/")
(synopsis "Code Metrics in Python")
(description "Radon is a Python tool which computes various code metrics.
@@ -11798,31 +11960,37 @@ ignoring formatting changes.")
(define-public python-tqdm
(package
(name "python-tqdm")
- (version "4.15.0")
+ (version "4.19.5")
(source
(origin
(method url-fetch)
(uri (pypi-uri "tqdm" version))
(sha256
(base32
- "0lwrmby8qz23gvqwkpivfrv4q8nfh90cz9ml6slwvwmcxxsdrhbf"))))
+ "0xvkffm77nqckk29xjy5fkqvig5b97vk7nzafp3cn36w4zqyccnz"))))
(build-system python-build-system)
(native-inputs
`(("python-flake8" ,python-flake8)
("python-nose" ,python-nose)
- ("python-nose-timer" ,python-nose-timer)
- ("python-coverage" ,python-coverage)
- ("python-virtualenv" ,python-virtualenv)))
+ ("python-coverage" ,python-coverage)))
(home-page "https://github.com/tqdm/tqdm")
(synopsis "Fast, extensible progress meter")
(description
"Make loops show a progress bar on the console by just wrapping any
iterable with @code{|tqdm(iterable)|}. Offers many options to define
design and layout.")
- (license (list license:mpl2.0 license:expat))))
+ (license (list license:mpl2.0 license:expat))
+ (properties `((python2-variant . ,(delay python2-tqdm))))))
(define-public python2-tqdm
- (package-with-python2 python-tqdm))
+ (let ((tqdm (package-with-python2
+ (strip-python2-variant python-tqdm))))
+ (package
+ (inherit tqdm)
+ (native-inputs
+ ;; FIXME: This should be propagated from python2-flake8 instead.
+ `(("python2-enum34" ,python2-enum34)
+ ,@(package-native-inputs tqdm))))))
(define-public python-pkginfo
(package
@@ -12301,7 +12469,7 @@ not actively maintained and works only with Python 2 and NumPy < 1.9.")
(define-public python2-mmtk
(package
(name "python2-mmtk")
- (version "2.7.10")
+ (version "2.7.11")
(source
(origin
(method url-fetch)
@@ -12310,7 +12478,7 @@ not actively maintained and works only with Python 2 and NumPy < 1.9.")
(file-name (string-append "MMTK-" version ".tar.gz"))
(sha256
(base32
- "1k4gsd50zja89dbzgy3aji7h4zpvbvdfrds7rxr3whqrsgcffnir"))))
+ "1d0nnjx4lwsvh8f99vv1r6gi50d93yba0adkz8b4zgv4za4c5862"))))
(build-system python-build-system)
(native-inputs
`(("netcdf" ,netcdf)))
@@ -12338,3 +12506,346 @@ and normal mode analysis, but also basic routines for implementing new methods
for simulation and analysis. The library is currently not actively maintained
and works only with Python 2 and NumPy < 1.9.")
(license license:cecill-c)))
+
+(define-public python-phonenumbers
+ (package
+ (name "python-phonenumbers")
+ (version "8.8.9")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "phonenumbers" version))
+ (sha256
+ (base32
+ "1lhhxmx3hk0b5891nc0p82dl5bq2w9cqbawmh8j5zy587af2j6fq"))))
+ (build-system python-build-system)
+ (home-page
+ "https://github.com/daviddrysdale/python-phonenumbers")
+ (synopsis
+ "Python library for dealing with international phone numbers")
+ (description
+ "This package provides a Python port of Google's libphonenumber library.")
+ (license license:asl2.0)))
+
+(define-public python2-phonenumbers
+ (package-with-python2 python-phonenumbers))
+
+(define-public python-yapf
+ (package
+ (name "python-yapf")
+ (version "0.20.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "yapf" version))
+ (sha256
+ (base32
+ "0s7l6afzxvpx39kzd0lwshlaxw8m4fwh4iy0rlmav4vipr3g46dx"))))
+ (build-system python-build-system)
+ (home-page "https://github.com/google/yapf")
+ (synopsis "Formatter for Python code")
+ (description "YAPF is a formatter for Python code. It's based off of
+@dfn{clang-format}, developed by Daniel Jasper. In essence, the algorithm
+takes the code and reformats it to the best formatting that conforms to the
+style guide, even if the original code didn't violate the style guide.")
+ (license license:asl2.0)))
+
+(define-public python2-yapf
+ (package-with-python2 python-yapf))
+
+(define-public python-gyp
+ (let ((commit "5e2b3ddde7cda5eb6bc09a5546a76b00e49d888f")
+ (revision "0"))
+ (package
+ (name "python-gyp")
+ ;; Google does not release versions,
+ ;; based on second most recent commit date.
+ (version (git-version "0.0.0" revision commit))
+ (source
+ (origin
+ ;; Google does not release tarballs,
+ ;; git checkout is needed.
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://chromium.googlesource.com/external/gyp")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0fr7nxcrk292djmxzpcjaphnsd123k31gp8jnd91vwknhq6snmv9"))))
+ (build-system python-build-system)
+ (home-page "https://gyp.gsrc.io/")
+ (synopsis "GYP is a Meta-Build system")
+ (description
+ "GYP builds build systems for large, cross platform applications.
+It can be used to generate XCode projects, Visual Studio projects, Ninja build
+files, and Makefiles.")
+ (license license:bsd-3))))
+
+(define-public python2-gyp
+ (package-with-python2 python-gyp))
+
+(define-public python-whatever
+ (package
+ (name "python-whatever")
+ (version "0.5")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/Suor/whatever/archive/" version
+ ".tar.gz"))
+ (sha256
+ (base32
+ "1iqvnaf0zpc6b4rvbqq4xy45mszcscyzpzknv8wg6j84pbp22sap"))
+ (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" ,python-pytest)))
+ (home-page "http://github.com/Suor/whatever")
+ (synopsis "Make anonymous functions by partial application of operators")
+ (description "@code{whatever} provides an easy way to make anonymous
+functions by partial application of operators.")
+ (license license:bsd-3)))
+
+(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" ,python-pytest)
+ ("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))
+
+(define-public python-isoweek
+ (package
+ (name "python-isoweek")
+ (version "1.3.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "isoweek" version))
+ (sha256
+ (base32
+ "1s7zsf0pab0l9gn6456qadnz5i5h90hafcjwnhx5mq23qjxggwvk"))))
+ (build-system python-build-system)
+ (home-page "https://github.com/gisle/isoweek")
+ (synopsis "Objects representing a week")
+ (description "The @code{isoweek} module provide the class Week that
+implements the week definition of ISO 8601. This standard also defines
+a notation for identifying weeks; yyyyWww (where the W is a literal).
+Week instances stringify to this form.")
+ (license license:bsd-3)))
+
+(define-public python2-isoweek
+ (package-with-python2 python-isoweek))
+
+(define-public python-tokenize-rt
+ (package
+ (name "python-tokenize-rt")
+ (version "2.0.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "tokenize-rt" version))
+ (sha256
+ (base32
+ "1yjvbz7rvrz31zjyax1cgy3xhf4wb3j18jwnj4bnl77ca4gliyiw"))))
+ (build-system python-build-system)
+ (home-page "https://github.com/asottile/tokenize-rt")
+ (synopsis "Wrapper around the stdlib tokenize which roundtrips.")
+ (description
+ "This Python library is a wrapper around @code{tokenize} from the Python
+standard library. It provides two additional tokens @code{ESCAPED_NL} and
+@code{UNIMPORTANT_WS}, and a @code{Token} data type. Use @code{src_to_tokens}
+and @code{tokens_to_src} to roundtrip.")
+ (license license:expat)))
+
+(define-public python-future-fstrings
+ (package
+ (name "python-future-fstrings")
+ (version "0.4.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "future_fstrings" version))
+ (sha256
+ (base32
+ "0ydxqz2dvns44g55p8ix2x18qkfk3aaz0m0dc70f3g6n8js35h47"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-tokenize-rt" ,python-tokenize-rt)))
+ (home-page "https://github.com/asottile/future-fstrings")
+ (synopsis "Backport of fstrings to Python < 3.6")
+ (description
+ "This package provides a UTF-8 compatible encoding
+@code{future_fstrings}, which performs source manipulation. It decodes the
+source bytes using the UTF-8 encoding and then rewrites Python 3.6 style
+@code{f} strings.")
+ (license license:expat)))
+
+(define-public python-typing
+ (package
+ (name "python-typing")
+ (version "3.6.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "typing" version))
+ (sha256
+ (base32
+ "1wmk9nkh30n37cbrqwkbggmj2390lhrlagjkd0ikm02l88saj06l"))))
+ (build-system python-build-system)
+ (home-page "https://docs.python.org/3/library/typing.html")
+ (synopsis "Type hints for Python")
+ (description "This is a backport of the standard library @code{typing}
+module to Python versions older than 3.5. Typing defines a standard notation
+for Python function and variable type annotations. The notation can be used
+for documenting code in a concise, standard format, and it has been designed
+to also be used by static and runtime type checkers, static analyzers, IDEs
+and other tools.")
+ (license license:psfl)))
+
+(define-public python2-typing
+ (package-with-python2 python-typing))
+
+(define-public bpython
+ (package
+ (name "bpython")
+ (version "0.17")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "bpython" version))
+ (sha256
+ (base32
+ "1mbah208jhd7bsfaa17fwpi55f7fvif0ghjwgrjmpmx8w1vqab9l"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'remove-failing-test
+ (lambda _
+ ;; Remove failing test. FIXME: make it pass
+ (delete-file "bpython/test/test_args.py")
+ #t))
+ (add-after 'wrap 'add-aliases
+ ;; for symmetry 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 old (string-append out "/bin/" new)))
+ '("bpython" "bpython-curses" "bpython-urwid" "bpdb")
+ '("bpython3" "bpython3-curses" "bpython3-urwid" "bpdb3")))
+ #t)))))
+ (propagated-inputs
+ `(("python-pygments" ,python-pygments)
+ ("python-requests", python-requests)
+ ("python-babel" ,python-babel) ; optional, for internationalization
+ ("python-curtsies" ,python-curtsies) ; >= 0.1.18
+ ("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
+
+@enumerate
+@item in-line syntax highlighting,
+@item readline-like autocomplete with suggestions displayed as you type,
+@item expected parameter list for any Python function,
+@item \"rewind\" function to pop the last line of code from memory and
+ re-evaluate,
+@item send the code you've entered off to a pastebin,
+@item save the code you've entered to a file, and
+@item auto-indentation.
+@end enumerate")
+ (license license:expat)))
+
+(define-public bpython2
+ (let ((base (package-with-python2
+ (strip-python2-variant bpython))))
+ (package (inherit base)
+ (name "bpython2")
+ (arguments
+ `(#:python ,python-2
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'remove-failing-test
+ (lambda _
+ ;; Remove failing test. FIXME: make it pass
+ (delete-file "bpython/test/test_args.py")
+ ;; Disable failing test-cases (renaming inhibits they are
+ ;; discovered)
+ (substitute* "bpython/test/test_curtsies_repl.py"
+ (("^(\\s*def )(test_get_last_word_with_prev_line\\W)" _ a b)
+ (string-append a "xxx_off_" b))
+ (("^(\\s*def )(test_complex\\W)" _ a b)
+ (string-append a "xxx_off_" b)))
+ #t))
+ (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))))))))