(define-module (gnu packages python)
#:use-module ((guix licenses)
- #:select (asl2.0 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style
+ #:select (asl2.0 bsd-4 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style
gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+
psfl public-domain x11-style))
#:use-module ((guix licenses) #:select (expat zlib) #:prefix license:)
#:use-module (gnu packages libffi)
#:use-module (gnu packages maths)
#:use-module (gnu packages multiprecision)
+ #:use-module (gnu packages networking)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages openssl)
#:use-module (gnu packages perl)
(method url-fetch)
(uri (string-append "https://www.python.org/ftp/python/"
version "/Python-" version ".tar.xz"))
- (patches (list (search-patch "python-fix-tests.patch")))
+ (patches (list (search-patch "python-fix-tests.patch")
+ ;; XXX Try removing this patch for python > 3.4.3
+ (search-patch "python-disable-ssl-test.patch")))
(patch-flags '("-p0"))
(sha256
(base32
"Parse human-readable date/time text")
(license asl2.0)))
+(define-public python-pandas
+ (package
+ (name "python-pandas")
+ (version "0.16.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://pypi.python.org/packages/source/p/"
+ "pandas/pandas-" version ".tar.gz"))
+ (sha256
+ (base32 "1wfrp8dx1zcsry6f09ndza6qm1yr7f163211f4l9vjlnhxpxw4s0"))))
+ (build-system python-build-system)
+ (arguments
+ `(;; Three tests fail:
+ ;; - test_read_google
+ ;; - test_read_yahoo
+ ;; - test_month_range_union_tz_dateutil
+ #:tests? #f))
+ (propagated-inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-pytz" ,python-pytz)
+ ("python-dateutil" ,python-dateutil-2)))
+ (native-inputs
+ `(("python-nose" ,python-nose)
+ ("python-setuptools" ,python-setuptools)))
+ (home-page "http://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
+structures designed to make working with structured (tabular,
+multidimensional, potentially heterogeneous) and time series data both easy
+and intuitive. It aims to be the fundamental high-level building block for
+doing practical, real world data analysis in Python.")
+ (license bsd-3)))
+
+(define-public python2-pandas
+ (package-with-python2 python-pandas))
+
(define-public python-tzlocal
(package
(name "python-tzlocal")
(define-public python2-certifi
(package-with-python2 python-certifi))
+(define-public python-click
+ (package
+ (name "python-click")
+ (version "4.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/c/click/click-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "0294x9g28w6zgswl0rsygkwi0wf6n480gf7fiiw5f9az3xhh77pl"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-setuptools" ,python-setuptools)))
+ (home-page "http://click.pocoo.org")
+ (synopsis "Command line library for Python")
+ (description
+ "Click is a Python package for creating command line interfaces in a
+composable way with as little code as necessary. Its name stands for
+\"Command Line Interface Creation Kit\". It's highly configurable but comes
+with sensible defaults out of the box.")
+ (license bsd-3)))
+
+(define-public python2-click
+ (package-with-python2 python-click))
+
(define-public python-requests
(package
(name "python-requests")
(define-public python-scikit-learn
(package
(name "python-scikit-learn")
- (version "0.15.2")
+ (version "0.16.1")
(source
(origin
(method url-fetch)
version ".tar.gz"))
(sha256
(base32
- "1rb93h2q15f219sz60sczjb65rg70xjmnp0q4pkkaairx5s05q55"))))
+ "140skabifgc7lvvj873pnzlwx0ni6q8qkrsyad2ccjb3h8rxzkih"))))
(build-system python-build-system)
(arguments
`(#:phases
(alist-cons-before
- 'build 'set-environment-variables
- (lambda* (#:key inputs #:allow-other-keys)
- (let* ((atlas-threaded
- (string-append (assoc-ref inputs "atlas")
- "/lib/libtatlas.so"))
- ;; On single core CPUs only the serial library is created.
- (atlas-lib
- (if (file-exists? atlas-threaded)
- atlas-threaded
- (string-append (assoc-ref inputs "atlas")
- "/lib/libsatlas.so"))))
- (setenv "ATLAS" atlas-lib)))
- (alist-cons-before
- 'check 'set-HOME
- ;; some tests require access to "$HOME"
- (lambda _ (setenv "HOME" "/tmp"))
- ;; Tests can only be run after the library has been installed and not
- ;; within the source directory.
- (alist-cons-after
- 'install 'check
- (lambda _
- (with-directory-excursion "/tmp"
- ;; With Python 3 one test of 3334 fails
- ;; (sklearn.tests.test_common.test_transformers); see
- ;; https://github.com/scikit-learn/scikit-learn/issues/3693
- (system* "nosetests" "-v" "sklearn")))
- (alist-delete 'check %standard-phases))))))
+ 'check 'set-HOME
+ ;; some tests require access to "$HOME"
+ (lambda _ (setenv "HOME" "/tmp"))
+ ;; Tests can only be run after the library has been installed and not
+ ;; within the source directory.
+ (alist-cons-after
+ 'install 'check
+ (lambda _
+ (with-directory-excursion "/tmp"
+ ;; With Python 3 one test of 3334 fails
+ ;; (sklearn.tests.test_common.test_transformers); see
+ ;; https://github.com/scikit-learn/scikit-learn/issues/3693
+ (system* "nosetests" "-v" "sklearn")))
+ (alist-delete 'check %standard-phases)))))
(inputs
- `(("atlas" ,atlas)
+ `(("openblas" ,openblas)
("python-nose" ,python-nose)))
(propagated-inputs
`(("python-numpy" ,python-numpy)
(alist-delete
"python-scipy" (package-propagated-inputs scikit))))))))
+(define-public python-scikit-image
+ (package
+ (name "python-scikit-image")
+ (version "0.11.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/s/scikit-image/scikit-image-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "0jz416fqvpahqyffw8plmszzfj669w8wvf3y9clnr5lr6a7md3kn"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-matplotlib" ,python-matplotlib)
+ ("python-networkx" ,python-networkx)
+ ("python-numpy" ,python-numpy)
+ ("python-scipy" ,python-scipy)
+ ("python-six" ,python-six)
+ ("python-pillow" ,python-pillow)))
+ (native-inputs
+ `(("python-cython" ,python-cython)
+ ("python-setuptools" ,python-setuptools)))
+ (home-page "http://scikit-image.org/")
+ (synopsis "Image processing in Python")
+ (description
+ "scikit-image is a collection of algorithms for image processing.")
+ (license bsd-3)))
+
+(define-public python2-scikit-image
+ (let ((scikit-image (package-with-python2 python-scikit-image)))
+ (package (inherit scikit-image)
+ (native-inputs
+ `(("python2-mock" ,python2-mock)
+ ,@(package-native-inputs scikit-image)))
+ (propagated-inputs
+ `(("python2-pytz" ,python2-pytz)
+ ,@(package-propagated-inputs scikit-image))))))
+
+(define-public python-redis
+ (package
+ (name "python-redis")
+ (version "2.10.3")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/r/redis/redis-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "1701qjwn4n05q90fdg4bsg96s27xf5s4hsb4gxhv3xk052q3gyx4"))))
+ (build-system python-build-system)
+ ;; Tests require a running Redis server
+ (arguments '(#:tests? #f))
+ (native-inputs
+ `(("python-setuptools" ,python-setuptools)
+ ("python-pytest" ,python-pytest)))
+ (home-page "https://github.com/andymccurdy/redis-py")
+ (synopsis "Redis Python client")
+ (description
+ "This package provides a Python interface to the Redis key-value store.")
+ (license license:expat)))
+
+(define-public python2-redis
+ (package-with-python2 python-redis))
+
+(define-public python-rq
+ (package
+ (name "python-rq")
+ (version "0.5.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/r/rq/rq-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "0b0z5hn8wkfg300hx7816csgv3bcfamlr29fi3yzgqmpqxwj3fix"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-click" ,python-click)
+ ("python-redis" ,python-redis)))
+ (native-inputs
+ `(("python-setuptools" ,python-setuptools)))
+ (home-page "http://python-rq.org/")
+ (synopsis "Simple job queues for Python")
+ (description
+ "RQ (Redis Queue) is a simple Python library for queueing jobs and
+processing them in the background with workers. It is backed by Redis and it
+is designed to have a low barrier to entry.")
+ (license bsd-2)))
+
+(define-public python2-rq
+ (package-with-python2 python-rq))
+
(define-public python-cython
(package
(name "python-cython")
(build-system python-build-system)
(inputs
`(("python-nose" ,python-nose)
- ("atlas" ,atlas)))
+ ("openblas" ,openblas)
+ ("lapack" ,lapack)))
(native-inputs
- `(("gfortran" ,gfortran-4.8)))
+ `(("gfortran" ,gfortran)))
(arguments
`(#:phases
(alist-cons-before
'build 'set-environment-variables
(lambda* (#:key inputs #:allow-other-keys)
- (let* ((atlas-threaded
- (string-append (assoc-ref inputs "atlas")
- "/lib/libtatlas.so"))
- ;; On single core CPUs only the serial library is created.
- (atlas-lib
- (if (file-exists? atlas-threaded)
- atlas-threaded
- (string-append (assoc-ref inputs "atlas")
- "/lib/libsatlas.so"))))
- (setenv "ATLAS" atlas-lib)))
+ (call-with-output-file "site.cfg"
+ (lambda (port)
+ (format port
+ "[openblas]
+libraries = openblas
+library_dirs = ~a/lib
+include_dirs = ~a/include
+
+[lapack]
+lapack_libs = lapack
+library_dirs = ~a/lib
+include_dirs = ~a/include
+"
+ (assoc-ref inputs "openblas")
+ (assoc-ref inputs "openblas")
+ (assoc-ref inputs "lapack")
+ (assoc-ref inputs "lapack"))))
+ ;; Use "gcc" executable, not "cc".
+ (substitute* "numpy/distutils/system_info.py"
+ (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
+ "c = distutils.ccompiler.new_compiler(); c.set_executables(compiler='gcc',compiler_so='gcc',linker_exe='gcc',linker_so='gcc -shared')"))
+ #t)
;; Tests can only be run after the library has been installed and not
;; within the source directory.
(alist-cons-after
(package-propagated-inputs
matplotlib))))))))
+(define-public python2-pysnptools
+ (package
+ (name "python2-pysnptools")
+ (version "0.2.13")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/p/pysnptools"
+ "/pysnptools-" version ".zip"))
+ (sha256
+ (base32
+ "1rzf5qvwfvd2pp84b14pb2gdvxdk5avnj7rb41ac8gndpkr9g6ib"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:python ,python-2)) ; only Python 2.7 is supported
+ (propagated-inputs
+ `(("python2-numpy" ,python2-numpy)
+ ("python2-scipy" ,python2-scipy)
+ ("python2-pandas" ,python2-pandas)
+ ("python2-cython" ,python2-cython)))
+ (native-inputs
+ `(("unzip" ,unzip)
+ ("python2-setuptools" ,python2-setuptools)))
+ (home-page "http://research.microsoft.com/en-us/um/redmond/projects/mscompbio/")
+ (synopsis "Library for reading and manipulating genetic data")
+ (description
+ "PySnpTools is a library for reading and manipulating genetic data. It
+can, for example, efficiently read whole PLINK *.bed/bim/fam files or parts of
+those files. It can also efficiently manipulate ranges of integers using set
+operators such as union, intersection, and difference.")
+ (license asl2.0)))
+
(define-public python-scipy
(package
(name "python-scipy")
("python-pyparsing" ,python-pyparsing)
("python-nose" ,python-nose)
("python-sphinx" ,python-sphinx)
- ("atlas" ,atlas)))
+ ("lapack" ,lapack)
+ ("openblas" ,openblas)))
(native-inputs
- `(("gfortran" ,gfortran-4.8)
+ `(("gfortran" ,gfortran)
("texlive" ,texlive)
("perl" ,perl)))
(outputs '("out" "doc"))
(arguments
`(#:phases
(alist-cons-before
- 'build 'set-environment-variables
+ 'build 'configure-openblas
(lambda* (#:key inputs #:allow-other-keys)
- (let* ((atlas-threaded
- (string-append (assoc-ref inputs "atlas")
- "/lib/libtatlas.so"))
- ;; On single core CPUs only the serial library is created.
- (atlas-lib
- (if (file-exists? atlas-threaded)
- atlas-threaded
- (string-append (assoc-ref inputs "atlas")
- "/lib/libsatlas.so"))))
- (setenv "ATLAS" atlas-lib)))
+ (call-with-output-file "site.cfg"
+ (lambda (port)
+ (format port
+ "[blas]
+libraries = openblas
+library_dirs = ~a/lib
+include_dirs = ~a/include
+[atlas]
+library_dirs = ~a/lib
+atlas_libs = openblas
+"
+ (assoc-ref inputs "openblas")
+ (assoc-ref inputs "openblas")
+ (assoc-ref inputs "openblas"))))
+ #t)
(alist-cons-after
'install 'install-doc
(lambda* (#:key outputs #:allow-other-keys)
(define-public python-pillow
(package
(name "python-pillow")
- (version "2.6.1")
+ (version "2.8.1")
(source
(origin
(method url-fetch)
"Pillow/Pillow-" version ".tar.gz"))
(sha256
(base32
- "0iw36c73wkhz88wa78v6l43llsb080ihw8yq7adhfqxdib7l4hzr"))))
+ "15n92axxph2s3kvg68bki9gv3nzwgq7130kp7wbblpi1l0cc2q47"))))
(build-system python-build-system)
(native-inputs
`(("python-setuptools" ,python-setuptools)
("python-nose" ,python-nose)))
(inputs
- `(("lcms" ,lcms)
+ `(("freetype" ,freetype)
+ ("lcms" ,lcms)
("zlib" ,zlib)
("libjpeg" ,libjpeg)
("openjpeg" ,openjpeg)
- ("libtiff" ,libtiff)))
+ ("libtiff" ,libtiff)
+ ("libwebp" ,libwebp)))
(propagated-inputs
`(;; Used at runtime for pkg_resources
("python-setuptools" ,python-setuptools)))
`(("pkg-config" ,pkg-config)))
(inputs
`(("python" ,python)
- ("dbus" ,dbus)
- ("dbus-glib" ,dbus-glib)
- ("glib" ,glib)))
+ ("dbus-glib" ,dbus-glib)))
(synopsis "Python bindings for D-bus")
(description "python-dbus provides bindings for libdbus, the reference
implementation of D-Bus.")
(define-public python2-lxml
(package-with-python2 python-lxml))
-(define-public python-pillow
- (package
- (name "python-pillow")
- (version "2.7.0")
- (source
- (origin
- (method url-fetch)
- (uri (string-append
- "https://pypi.python.org/packages/source/P/Pillow/Pillow-"
- version
- ".tar.gz"))
- (sha256
- (base32
- "1y0rysgd7vqpl5lh0lsra7j2k30azwxqlh5jnqk1i0pmfc735s96"))))
- (build-system python-build-system)
- (inputs
- `(("freetype" ,freetype)
- ("lcms" ,lcms)
- ("libjpeg" ,libjpeg)
- ("libtiff" ,libtiff)
- ("openjpeg" ,openjpeg)
- ("python-setuptools" ,python-setuptools)
- ("zlib" ,zlib)))
- (arguments
- `(#:tests? #f)) ; no check target
- (home-page "http://python-pillow.github.io/")
- (synopsis "Pillow fork of Python Imaging Library")
- (description "Pillow is a fork of the Python Imaging Library (PIL).")
- ;; PIL license, see
- ;; http://www.pythonware.com/products/pil/license.htm
- (license (x11-style
- "file://PKG-INFO"
- "See http://www.pythonware.com/products/pil/license.htm"))))
-
-(define-public python2-pillow
- (package-with-python2 python-pillow))
-
(define-public python2-pil
(package
(name "python2-pil")
Python style, together with a fast and comfortable execution environment.")
(license license:expat)))
+(define-public python-seaborn
+ (package
+ (name "python-seaborn")
+ (version "0.5.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/s/seaborn/seaborn-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "1236abw18ijjglmv60q85ckqrvgf5qyy4zlq7nz5aqfg6q87z3wc"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ `(("python-pandas" ,python-pandas)
+ ("python-matplotlib" ,python-matplotlib)
+ ("python-scipy" ,python-scipy)))
+ (native-inputs
+ `(("python-setuptools" ,python-setuptools)))
+ (home-page "http://stanford.edu/~mwaskom/software/seaborn/")
+ (synopsis "Statistical data visualization")
+ (description
+ "Seaborn is a library for making attractive and informative statistical
+graphics in Python. It is built on top of matplotlib and tightly integrated
+with the PyData stack, including support for numpy and pandas data structures
+and statistical routines from scipy and statsmodels.")
+ (license bsd-3)))
+
+(define-public python2-seaborn
+ (let ((seaborn (package-with-python2 python-seaborn)))
+ (package (inherit seaborn)
+ (propagated-inputs
+ `(("python2-pytz" ,python2-pytz)
+ ,@(package-propagated-inputs seaborn))))))
+
(define-public python-sympy
(package
(name "python-sympy")
(define-public python2-waf
(package-with-python2 python-waf))
+
+(define-public python-pyzmq
+ (package
+ (name "python-pyzmq")
+ (version "14.6.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://pypi.python.org/packages/source/p/pyzmq/pyzmq-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "1frmbjykvhmdg64g7sn20c9fpamrsfxwci1nhhg8q7jgz5pq0ikp"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:configure-flags
+ (list (string-append "--zmq=" (assoc-ref %build-inputs "zeromq")))
+ ;; FIXME: You must build pyzmq with 'python setup.py build_ext
+ ;; --inplace' for 'python setup.py test' to work.
+ #:tests? #f))
+ (inputs
+ `(("zeromq" ,zeromq)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("python-nose" ,python-nose)
+ ("python-setuptools" ,python-setuptools)))
+ (home-page "http://github.com/zeromq/pyzmq")
+ (synopsis "Python bindings for 0MQ")
+ (description
+ "PyZMQ is the official Python binding for the ZeroMQ messaging library.")
+ (license bsd-4)))
+
+(define-public python2-pyzmq
+ (package-with-python2 python-pyzmq))