aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/python.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r--gnu/packages/python.scm274
1 files changed, 195 insertions, 79 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 3f1328ddf0..c555d8072a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -22,8 +22,8 @@
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2016 Daniel Pimentel <d4n1@d4n1.org>
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
-;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
-;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
+;;; 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>
@@ -4512,7 +4512,8 @@ operators such as union, intersection, and difference.")
(scandir (string-append cwd "/build")))
":"
(getenv "PYTHONPATH"))))
- (zero? (system* "python" "-m" "rpy2.tests" "-v")))))))
+ ;; FIXME: Even when all tests pass, the check phase will fail.
+ (system* "python" "-m" "rpy2.tests" "-v"))))))
(propagated-inputs
`(("python-six" ,python-six)
("python-jinja2" ,python-jinja2)
@@ -5133,72 +5134,6 @@ a front-end for C compilers or analysis tools.")
(define-public python2-pycparser
(package-with-python2 python-pycparser))
-(define-public python-cffi
- (package
- (name "python-cffi")
- (version "1.10.0")
- (source
- (origin
- (method url-fetch)
- (uri (pypi-uri "cffi" version))
- (sha256
- (base32 "1mffyilq4qycm8gs4wkgb18rnqil8a9blqq77chdlshzxc8jkc5k"))))
- (build-system python-build-system)
- (outputs '("out" "doc"))
- (inputs
- `(("libffi" ,libffi)))
- (propagated-inputs ; required at run-time
- `(("python-pycparser" ,python-pycparser)))
- (native-inputs
- `(("pkg-config" ,pkg-config)
- ("python-sphinx" ,python-sphinx)
- ("python-pytest" ,python-pytest)))
- (arguments
- `(#:modules ((ice-9 ftw)
- (srfi srfi-26)
- (guix build utils)
- (guix build python-build-system))
- #:phases
- (modify-phases %standard-phases
- (replace 'check
- (lambda _
- (setenv "PYTHONPATH"
- (string-append
- (getenv "PYTHONPATH")
- ":" (getcwd) "/build/"
- (car (scandir "build" (cut string-prefix? "lib." <>)))))
-
- ;; XXX The "normal" approach of setting CC and friends does
- ;; not work here. Is this the correct way of doing things?
- (substitute* "testing/embedding/test_basic.py"
- (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
- (string-append "c = distutils.ccompiler.new_compiler();"
- "c.set_executables(compiler='gcc',"
- "compiler_so='gcc',linker_exe='gcc',"
- "linker_so='gcc -shared')")))
- (substitute* "testing/cffi0/test_ownlib.py"
- (("'cc testownlib") "'gcc testownlib"))
- (zero? (system* "py.test" "-v" "c/" "testing/"))))
- (add-after 'install 'install-doc
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
- (doc (string-append data "/doc/" ,name "-" ,version))
- (html (string-append doc "/html")))
- (with-directory-excursion "doc"
- (system* "make" "html")
- (mkdir-p html)
- (copy-recursively "build/html" html))
- (copy-file "LICENSE" (string-append doc "/LICENSE"))
- #t))))))
- (home-page "http://cffi.readthedocs.org")
- (synopsis "Foreign function interface for Python")
- (description
- "Foreign Function Interface for Python calling C code.")
- (license license:expat)))
-
-(define-public python2-cffi
- (package-with-python2 python-cffi))
-
(define-public python-xcffib
(package
(name "python-xcffib")
@@ -5854,6 +5789,12 @@ tools for mocking system commands and recording calls to those.")
("python-numpy" ,python-numpy)
("python-numpydoc" ,python-numpydoc)
("python-jinja2" ,python-jinja2)
+ ("python-jupyter-console"
+ ;; The python-ipython and python-jupyter-console require each
+ ;; other. To get the functionality in both packages working, strip
+ ;; down the python-jupyter-console package when using it as an input
+ ;; to python-ipython.
+ ,python-jupyter-console-minimal)
("python-mistune" ,python-mistune)
("python-pexpect" ,python-pexpect)
("python-pickleshare" ,python-pickleshare)
@@ -6607,6 +6548,26 @@ providing a clean and modern domain specific specification language (DSL) in
Python style, together with a fast and comfortable execution environment.")
(license license:expat)))
+(define-public python-pyqrcode
+ (package
+ (name "python-pyqrcode")
+ (version "1.2.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "PyQRCode" version))
+ (sha256
+ (base32
+ "1m9ln8k9v7dfbh1i81225hx5mdsh8mpf9g7r4wpbfmiyfcs7dgzx"))))
+ (build-system python-build-system)
+ (home-page
+ "https://github.com/mnooner256/pyqrcode")
+ (synopsis "QR code generator")
+ (description
+ "Pyqrcode is a QR code generator written purely in Python with
+SVG, EPS, PNG and terminal output.")
+ (license license:bsd-3)))
+
(define-public python-seaborn
(package
(name "python-seaborn")
@@ -7415,15 +7376,13 @@ add functionality and customization to your projects with their own plugins.")
(define-public python-fonttools
(package
(name "python-fonttools")
- (version "2.5")
+ (version "3.15.1")
(source (origin
(method url-fetch)
- (uri (string-append
- "https://pypi.python.org/packages/source/F/FontTools/"
- "fonttools-" version ".tar.gz"))
+ (uri (pypi-uri "fonttools" version ".zip"))
(sha256
(base32
- "08ay3x4ijarwhl60gqx2i9jzq6pxs20p4snc2d1q5jagh4rn39lb"))))
+ "1hhj97izwliy0vybmza72d90l5d4mcn50y8akq7kyccfl82vdx4d"))))
(build-system python-build-system)
(arguments
'(#:test-target "check"
@@ -7437,6 +7396,8 @@ add functionality and customization to your projects with their own plugins.")
(substitute* "setup.py"
(("^[ \t]*extra_path *= *'FontTools',") ""))
#t)))))
+ (native-inputs
+ `(("unzip" ,unzip)))
(home-page "https://github.com/behdad/fonttools")
(synopsis "Tools to manipulate font files")
(description
@@ -8560,6 +8521,31 @@ Jupyter kernels such as IJulia and IRKernel.")
(define-public python2-jupyter-console
(package-with-python2 python-jupyter-console))
+;; The python-ipython and python-jupyter-console require each other. To get
+;; the functionality in both packages working, strip down the
+;; python-jupyter-console package when using it as an input to python-ipython.
+(define python-jupyter-console-minimal
+ (package
+ (inherit python-jupyter-console)
+ (arguments
+ (substitute-keyword-arguments
+ (package-arguments python-jupyter-console)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'install 'delete-bin
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Delete the bin files, to avoid conflicts in profiles
+ ;; where python-ipython and python-jupyter-console are
+ ;; both present.
+ (delete-file-recursively
+ (string-append
+ (assoc-ref outputs "out") "/bin"))))))))
+ ;; Remove the python-ipython propagated input, to avoid the cycle
+ (propagated-inputs
+ (alist-delete
+ "python-ipython"
+ (package-propagated-inputs python-jupyter-console)))))
+
(define-public jupyter
(package
(name "jupyter")
@@ -10784,14 +10770,14 @@ introspection of @code{zope.interface} instances in code.")
(define-public python-psycopg2
(package
(name "python-psycopg2")
- (version "2.6.2")
+ (version "2.7.3.1")
(source
(origin
(method url-fetch)
(uri (pypi-uri "psycopg2" version))
(sha256
(base32
- "0p60z2gwfcal30y2w8gprflchp1kcg9qblc5rn782p4wxl90wjbh"))))
+ "0rda1j02ds6s28752fhmpwg761sh6jsxi1gpczqkrd28cki1cywv"))))
(build-system python-build-system)
(arguments
;; Tests would require a postgresql database "psycopg2_test"
@@ -11746,13 +11732,13 @@ format.")
(define-public python-twisted
(package
(name "python-twisted")
- (version "16.2.0")
+ (version "17.1.0")
(source (origin
(method url-fetch)
(uri (pypi-uri "Twisted" version ".tar.bz2"))
(sha256
(base32
- "0ydxrp9myw1mvsz3qfzx5579y5llmqa82pxvqchgp5syczffi450"))))
+ "1p245mg15hkxp7hy5cyq2fgvlgjkb4cg0gwkwd148nzy1bbi3wnv"))))
(build-system python-build-system)
(arguments
'(#:tests? #f)) ; FIXME: Some tests are failing.
@@ -11762,7 +11748,10 @@ format.")
;; (lambda _
;; (zero? (system* "./bin/trial" "twisted")))))
(propagated-inputs
- `(("python-zope-interface" ,python-zope-interface)))
+ `(("python-zope-interface" ,python-zope-interface)
+ ("python-incremental" ,python-incremental)
+ ("python-constantly" ,python-constantly)
+ ("python-automat" ,python-automat)))
(home-page "https://twistedmatrix.com/")
(synopsis "Asynchronous networking framework written in Python")
(description
@@ -14229,6 +14218,133 @@ Python. It is based on Parsing Expression Grammars, PEG. With pyPEG you can
parse many formal languages.")
(license license:gpl2)))
+(define-public python-incremental
+ (package
+ (name "python-incremental")
+ (version "17.5.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "incremental" version))
+ (sha256
+ (base32
+ "1cylxdz1cnkm5g3pklna3h2n0i0rks95ir1pnpxfnvpkmab1cxbv"))))
+ (build-system python-build-system)
+ (home-page "https://github.com/hawkowl/incremental")
+ (synopsis "Library for versioning Python projects")
+ (description "Incremental is a small library that versions your Python
+projects.")
+ (license license:expat)))
+
+(define-public python2-incremental
+ (package-with-python2 python-incremental))
+
+(define-public python-automat
+ (package
+ (name "python-automat")
+ (version "0.6.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "Automat" version))
+ (sha256
+ (base32
+ "1a7nsrljysfmdqmpn2apfa1gg6rfah4y9sizvns8gb08rx7d07rw"))))
+ (build-system python-build-system)
+ ;; We disable the tests because they require python-twisted, while
+ ;; python-twisted depends on python-automat. Twisted is optional, but the
+ ;; tests fail if it is not available. Also see
+ ;; <https://github.com/glyph/automat/issues/71>.
+ (arguments '(#:tests? #f))
+ (native-inputs
+ `(("python-m2r" ,python-m2r)
+ ("python-setuptools-scm" ,python-setuptools-scm)
+ ("python-graphviz" ,python-graphviz)))
+ (propagated-inputs
+ `(("python-six" ,python-six)
+ ("python-attrs" ,python-attrs)))
+ (home-page "https://github.com/glyph/Automat")
+ (synopsis "Self-service finite-state machines")
+ (description "Automat is a library for concise, idiomatic Python
+expression of finite-state automata (particularly deterministic finite-state
+transducers).")
+ (license license:expat)))
+
+(define-public python2-automat
+ (package-with-python2 python-automat))
+
+(define-public python-m2r
+ (package
+ (name "python-m2r")
+ (version "0.1.12")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "m2r" version))
+ (sha256
+ (base32
+ "1axrwnf425sz4qz3c0qc7yhhki4myzb8rki7pczcsgzznzmqdyxd"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-docutils" ,python-docutils)
+ ("python-mistune" ,python-mistune)))
+ (native-inputs
+ `(("python-pygments" ,python-pygments)
+ ("python-mock" ,python-mock)))
+ (home-page "https://github.com/miyakogi/m2r")
+ (synopsis "Markdown to reStructuredText converter")
+ (description "M2R converts a markdown file including reST markups to valid
+reST format.")
+ (license license:expat)))
+
+(define-public python2-m2r
+ (package-with-python2 python-m2r))
+
+(define-public python-constantly
+ (package
+ (name "python-constantly")
+ (version "15.1.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "constantly" version))
+ (sha256
+ (base32
+ "0dgwdla5kfpqz83hfril716inm41hgn9skxskvi77605jbmp4qsq"))))
+ (build-system python-build-system)
+ (home-page "https://github.com/twisted/constantly")
+ (synopsis "Symbolic constants in Python")
+ (description "Constantly is a Python library that provides symbolic
+constant support. It includes collections and constants with text, numeric,
+and bit flag values.")
+ (license license:expat)))
+
+(define-public python2-constantly
+ (package-with-python2 python-constantly))
+
+(define-public python-attrs
+ (package
+ (name "python-attrs")
+ (version "17.2.0")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "attrs" version))
+ (sha256
+ (base32
+ "04gx08ikpk26wnq22f7l42gapcvk8iz1512r927k6sadz6cinkax"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-hypothesis" ,python-hypothesis)
+ ("python-zope-interface" ,python-zope-interface)
+ ("python-six" ,python-six)))
+ (home-page "https://github.com/python-attrs/attrs/")
+ (synopsis "Attributes without boilerplate")
+ (description "@code{attrs} is a Python package with class decorators that
+ease the chores of implementing the most common attribute-related object
+protocols.")
+ (license license:expat)))
+
+(define-public python2-attrs
+ (package-with-python2 python-attrs))
+
(define-public python2-cliapp
(package
(name "python2-cliapp")