gnu: python-pep8-1.5.7: Use PYPI-URI.
[jackhill/guix/guix.git] / gnu / packages / python-xyz.scm
index c01afdd..ddd7eef 100644 (file)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages qt)
@@ -320,10 +321,7 @@ etc. ")
     (source
      (origin
       (method url-fetch)
-      (uri (string-append
-            "https://pypi.python.org/packages/source/b/"
-            "backports.ssl_match_hostname/backports.ssl_match_hostname-"
-            version ".tar.gz"))
+      (uri (pypi-uri "backports.ssl_match_hostname" version))
       (sha256
        (base32
         "1wndipik52cyqy0677zdgp90i435pmvwd89cz98lm7ri0y3xjajh"))))
@@ -452,42 +450,62 @@ concepts.")
 @code{subprocess} feature.")
     (license license:expat)))
 
+(define-public python-cftime
+  (package
+    (name "python-cftime")
+    (version "1.0.3.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cftime" version))
+       (sha256
+        (base32
+         "0362dhxbzk593walyjz30dll6y2y79wialik647cbwdsf3ad0x6x"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)))
+    (native-inputs
+     `(("python-coveralls" ,python-coveralls)
+       ("python-cython" ,python-cython)
+       ("python-pytest-cov" ,python-pytest-cov)))
+    (home-page "https://github.com/Unidata/cftime")
+    (synopsis "Library for time handling")
+    (description
+     "This package provides time-handling functionality that used to be part
+of the netcdf4 package before.")
+    ;; This package claims to include code under the GPLv3 but is released
+    ;; under ISC.
+    (license (list license:isc license:gpl3+))))
+
 (define-public python-netcdf4
   (package
     (name "python-netcdf4")
-    (version "1.2.9")
+    (version "1.4.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "netCDF4" version))
        (sha256
         (base32
-         "1h6jq338amlbk0ilzvjyl7cck80i0bah9a5spn9in71vy2qxm7i5"))))
+         "0c0sklgrmv15ygliin8qq0hp7vanmbi74m6zpi0r1ksr0hssyd5r"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'configure-locations
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "HDF5_DIR" (assoc-ref inputs "hdf5"))
+             #t)))))
     (native-inputs
      `(("python-cython" ,python-cython)))
     (propagated-inputs
-     `(("python-numpy" ,python-numpy)))
+     `(("python-numpy" ,python-numpy)
+       ("python-cftime" ,python-cftime)))
     (inputs
      `(("netcdf" ,netcdf)
        ("hdf4" ,hdf4)
        ("hdf5" ,hdf5)))
-    (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (setenv "NO_NET" "1") ; disable opendap tests
-             (with-directory-excursion "test"
-               (setenv "PYTHONPATH" ; find and add the library we just built
-                       (string-append
-                        (car (find-files "../build" "lib.*"
-                                         #:directories? #:t
-                                         #:fail-on-error? #:t))
-                        ":" (getenv "PYTHONPATH")))
-               (zero? (system* "python" "run_all.py"))))))))
-    (home-page
-     "https://github.com/Unidata/netcdf4-python")
+    (home-page "https://github.com/Unidata/netcdf4-python")
     (synopsis "Python/numpy interface to the netCDF library")
     (description "Netcdf4-python is a Python interface to the netCDF C
 library.  netCDF version 4 has many features not found in earlier
@@ -510,8 +528,7 @@ to users of that module.")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append "https://pypi.python.org/packages/source/l/lockfile/"
-                           "lockfile-" version ".tar.gz"))
+       (uri (pypi-uri "lockfile" version))
        (sha256
         (base32
          "16gpx5hm73ah5n1079ng0vy381hl802v606npkx4x8nb0gg05vba"))))
@@ -981,8 +998,7 @@ doing practical, real world data analysis in Python.")
     (source
      (origin
       (method url-fetch)
-      (uri (string-append "https://pypi.python.org/packages/source/m/mechanize/mechanize-"
-                          version ".tar.gz"))
+      (uri (pypi-uri "mechanize" version))
       (sha256
        (base32
         "0rj7r166i1dyrq0ihm5rijfmvhs8a04im28lv05c0c3v206v4rrf"))))
@@ -1379,9 +1395,7 @@ software.")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/p/python-mimeparse/python-mimeparse-"
-             version ".tar.gz"))
+       (uri (pypi-uri "python-mimeparse" version))
        (sha256
         (base32
          "0y2g6cl660bpz11srgqyvvm8gmywpgyx8g0xfvbiyr0af0yv1r3n"))))
@@ -1617,20 +1631,17 @@ files.")
 (define-public python-click
   (package
     (name "python-click")
-    (version "6.7")
+    (version "7.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "click" version))
        (sha256
         (base32
-         "02qkfpykbq35id8glfgwc38yc430427yd05z1wc5cnld8zgicmgi"))))
+         "1mzjixd4vjbjvzb6vylki9w1556a9qmdh35kzmq6cign46av952v"))))
     (build-system python-build-system)
     (arguments
-     `(;; The tests are fragile, depending on a specific version of pytest:
-       ;; <https://github.com/pallets/click/issues/823>
-       #:tests? #f
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-paths
            (lambda* (#:key inputs #:allow-other-keys)
@@ -1639,10 +1650,13 @@ files.")
                (substitute* "click/_unicodefun.py"
                  (("'locale'")
                   (string-append "'" glibc "/bin/locale'"))))
-             #t)))))
+             #t))
+         (replace 'check
+           (lambda _
+             (invoke "python" "-m" "pytest"))))))
     (native-inputs
      `(("python-pytest" ,python-pytest)))
-    (home-page "http://click.pocoo.org")
+    (home-page "https://palletsprojects.com/p/click/")
     (synopsis "Command line library for Python")
     (description
      "Click is a Python package for creating command line interfaces in a
@@ -1717,10 +1731,7 @@ version numbers.")
     (version "2.6.0")
     (source (origin
              (method url-fetch)
-             (uri
-              (string-append
-               "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-"
-               version ".tar.gz"))
+             (uri (pypi-uri "jsonschema" version))
              (sha256
               (base32
                "00kf3zmpp9ya4sydffpifn0j0mzm342a2vzh82p6r0vh10cg7xbg"))))
@@ -1728,7 +1739,7 @@ version numbers.")
     (arguments
      '(#:phases
        (modify-phases %standard-phases
-         (replace 'check (lambda _ (zero? (system* "nosetests")))))))
+         (replace 'check (lambda _ (invoke "nosetests"))))))
     (native-inputs
      `(("python-nose" ,python-nose)
        ("python-vcversioner" ,python-vcversioner)))
@@ -1940,18 +1951,16 @@ visualisation and class tracker statistics.")
 (define-public python-itsdangerous
   (package
     (name "python-itsdangerous")
-    (version "0.24")
+    (version "1.1.0")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/i/itsdangerous/itsdangerous-"
-             version ".tar.gz"))
+       (uri (pypi-uri "itsdangerous" version))
        (sha256
         (base32
-         "06856q6x675ly542ig0plbqcyab6ksfzijlyf1hzhgg3sgwgrcyb"))))
+         "068zpbksq5q2z4dckh2k1zbcq43ay74ylqn77rni797j0wyh66rj"))))
     (build-system python-build-system)
-    (home-page "https://github.com/mitsuhiko/itsdangerous")
+    (home-page "https://palletsprojects.com/p/itsdangerous/")
     (synopsis "Python library for passing data to/from untrusted environments")
     (description
      "Itsdangerous provides various helpers to pass trusted data to untrusted
@@ -2053,9 +2062,7 @@ e.g. filters, callbacks and errbacks can all be promises.")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-"
-             version ".tar.gz"))
+       (uri (pypi-uri "MarkupSafe" version))
        (sha256
         (base32
          "0rdn1s8x9ni7ss8rfiacj7x1085lx8mh2zdwqslnw8xc3l4nkgm6"))))
@@ -2124,7 +2131,7 @@ logic-free templating system Mustache.")
               (modify-phases %standard-phases
                 (replace 'check
                   (lambda _
-                    (zero? (system* "python" "test_pystache.py")))))))))
+                    (invoke "python" "test_pystache.py"))))))))
 
 (define-public python-joblib
   (package
@@ -2873,8 +2880,7 @@ objects.")
      `(#:phases
        (modify-phases %standard-phases
          (replace 'check
-           (lambda _
-             (zero? (system* "nosetests" "-v")))))))
+           (lambda _ (invoke "nosetests" "-v"))))))
     (propagated-inputs
      `(("python-colormath" ,python-colormath)))
     (native-inputs
@@ -2981,12 +2987,12 @@ color scales, and color space conversion easy.  It has support for:
                (with-directory-excursion "doc"
                  (copy-recursively sphinx-theme-checkout scipy-sphinx-theme)
                  (mkdir-p html)
-                 (system* "make" "html" pyver)
-                 (system* "make" "latex" "PAPER=a4" pyver)
-                 (system* "make" "-C" "build/latex"
+                 (invoke "make" "html" pyver)
+                 (invoke "make" "latex" "PAPER=a4" pyver)
+                 (invoke "make" "-C" "build/latex"
                           "all-pdf" "PAPER=a4" pyver)
                  ;; FIXME: Generation of the info file fails.
-                 ;; (system* "make" "info" pyver)
+                 ;; (invoke "make" "info" pyver)
                  ;; (mkdir-p info)
                  ;; (copy-file "build/texinfo/numpy.info"
                  ;;            (string-append info "/numpy.info"))
@@ -3211,7 +3217,7 @@ To address this and enable easy cycling over arbitrary @code{kwargs}, the
        (modify-phases %standard-phases
          (replace 'check
            (lambda _
-             (zero? (system* "nosetests" "--all-modules" "-v" "colorspacious")))))))
+             (invoke "nosetests" "--all-modules" "-v" "colorspacious"))))))
     (home-page "https://github.com/njsmith/colorspacious")
     (synopsis "Python library for colorspace conversions")
     (description "@code{colorspacious} is a Python library that lets you
@@ -4306,8 +4312,7 @@ common operations on files to be invoked on those path objects directly.")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append "https://pypi.python.org/packages/source/s/"
-                           "simplegeneric/simplegeneric-" version ".zip"))
+       (uri (pypi-uri "simplegeneric" version ".zip"))
        (sha256
         (base32 "0wwi1c6md4vkbcsfsf8dklf3vr4mcdj4mpxkanwgb6jb1432x5yw"))))
     (build-system python-build-system)
@@ -4335,9 +4340,7 @@ standard library.")
     (source
      (origin
       (method url-fetch)
-      (uri (string-append "https://pypi.python.org/packages/source/i/"
-                          "ipython_genutils/ipython_genutils-"
-                          version ".tar.gz"))
+      (uri (pypi-uri "ipython_genutils" version))
       (sha256
        (base32 "19l2pp1c64ansr89l3cqh19jdi2ixhssdzx0vz4n6r52a6i281is"))))
     (build-system python-build-system)
@@ -5517,15 +5520,12 @@ complexity of Python source code.")
   (package (inherit python-pep8)
     (version "1.5.7")
     (source
-      (origin
-        (method url-fetch)
-        (uri (string-append
-               "https://pypi.python.org/packages/source/p/pep8/pep8-"
-               version
-               ".tar.gz"))
-        (sha256
-          (base32
-           "12b9bbdbwnspxgak14xg58c130x2n0blxzlms5jn2dszn8qj3d0m"))))
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pep8" version))
+       (sha256
+        (base32
+         "12b9bbdbwnspxgak14xg58c130x2n0blxzlms5jn2dszn8qj3d0m"))))
     (arguments
      ;; XXX Tests not compatible with Python 3.5.
      '(#:tests? #f))))
@@ -6637,16 +6637,14 @@ Jupyter Notebook format and Python APIs for working with notebooks.")
 (define-public python-entrypoints
   (package
     (name "python-entrypoints")
-    (version "0.2.3")
+    (version "0.3")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append "https://github.com/takluyver/entrypoints/archive/"
-                           version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (uri (pypi-uri "entrypoints" version))
        (sha256
         (base32
-         "1pdvgfr5bxyvnfvxbsd3zi0dh3il71pc4k6rinx6zpps91b84a56"))))
+         "0lc4si3xb7hza424414rdqdc3vng3kcrph8jbvjqb32spqddf3f7"))))
     (build-system python-build-system)
     ;; The package does not come with a setup.py file, so we have to generate
     ;; one ourselves.
@@ -9651,17 +9649,17 @@ characters, mouse support, and auto suggestions.")
 (define-public python-jedi
   (package
     (name "python-jedi")
-    (version "0.13.1")
+    (version "0.13.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "jedi" version))
        (sha256
         (base32
-         "0j11q42g5vjkyhhjpyy8nb0gdxs78m3rpjai7p1hvgpyl9rkyjdp"))))
+         "1za944msp0f8x36qa8l309jhv0kzlsdh7r9nj3z12y8npnsh45sp"))))
     (build-system python-build-system)
     (arguments
-     `( ;; Many tests are failing with Python 3.7.x as of version 0.13.1 (see:
+     `( ;; Many tests are failing with Python 3.7.x as of version 0.13.2 (see:
         ;; https://github.com/davidhalter/jedi/issues/1263)
        #:tests? #f
        #:phases
@@ -10409,7 +10407,7 @@ is used by PostgreSQL and the OpenSSH Server for example.")
              (setenv "PYTHONPATH"
                      (string-append (getcwd) "/build/lib:"
                                     (getenv "PYTHONPATH")))
-             (zero? (system* "py.test" "-vv" )))))))
+             (invoke "py.test" "-vv" ))))))
     (native-inputs
      `(("python-pytest" ,python-pytest)))
     (home-page
@@ -10529,7 +10527,7 @@ PNG, JPEG, JPEG2000 and GIF files in pure Python.")
        (modify-phases %standard-phases
          (replace 'check
            (lambda _
-             (zero? (system* "python" "test3.py")))))))
+             (invoke "python" "test3.py"))))))
     (home-page "https://github.com/gfxmonk/termstyle")
     (synopsis "Console text coloring for Python")
     (description "This package provides console text coloring for Python.")
@@ -10737,7 +10735,7 @@ protocols written in pure Python.")
              (setenv "PYTHONPATH"
                      (string-append (getcwd) "/build/lib:"
                                     (getenv "PYTHONPATH")))
-             (zero? (system* "python" "test/test_pbkdf2.py")))))))
+             (invoke "python" "test/test_pbkdf2.py"))))))
     (propagated-inputs
      `(("python-pycrypto" ,python-pycrypto)))  ; optional
     (home-page "https://www.dlitz.net/software/python-pbkdf2/")
@@ -10945,7 +10943,7 @@ Problem} (SAT) solver.")
          (add-after 'install 'check
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (add-installed-pythonpath inputs outputs)
-             (zero? (system* "python" "test/testordereddict.py")))))))
+             (invoke "python" "test/testordereddict.py"))))))
     (home-page "https://bitbucket.org/ruamel/ordereddict")
     (synopsis "Version of dict that keeps keys in insertion order")
     (description
@@ -11202,7 +11200,7 @@ protocols.")
              ;; Disable python3 tests
              (substitute* "check"
                (("python3") "# python3"))
-             (zero? (system* "./check")))))))
+             (invoke "./check"))))))
     (native-inputs
      `(("python2-coverage-test-runner" ,python2-coverage-test-runner)
        ("python2-pep8" ,python2-pep8)))
@@ -11242,8 +11240,7 @@ iterating over input files.")
          ;; and fails.
          (delete 'check)
          (add-before 'build 'check
-           (lambda _
-             (zero? (system* "make" "check")))))))
+           (lambda _ (invoke "make" "check"))))))
     (home-page "https://liw.fi/ttystatus/")
     (synopsis "Python library for showing progress reporting and
 status updates on terminals")
@@ -11305,8 +11302,7 @@ happens using the @code{logging} library.")
          ;; and fails.
          (delete 'check)
          (add-before 'build 'check
-           (lambda _
-             (zero? (system* "make" "check")))))))
+           (lambda _ (invoke "make" "check"))))))
     (native-inputs
      `(("cmdtest" ,cmdtest)
        ("python2-coverage-test-runner" ,python2-coverage-test-runner)))
@@ -12320,7 +12316,7 @@ Swagger 2.0).")
              (setenv "PYTHONPATH" (string-append (getcwd)
                                                  ":"
                                                  (getenv "PYTHONPATH")))
-             (zero? (system* "py.test")))))))
+             (invoke "py.test"))))))
     (propagated-inputs
      `(("python-flask" ,python-flask)
        ("python-pyyaml" ,python-pyyaml)
@@ -13166,9 +13162,9 @@ is the new Pyro version that is actively developed.")
        (modify-phases %standard-phases
          (replace 'build
            (lambda* (#:key inputs #:allow-other-keys)
-             (zero? (system* "python" "setup.py" "build"
-                             (string-append "--netcdf_prefix="
-                                            (assoc-ref inputs "netcdf")))))))))
+             (invoke "python" "setup.py" "build"
+                     (string-append "--netcdf_prefix="
+                                    (assoc-ref inputs "netcdf"))))))))
     (home-page "https://bitbucket.org/khinsen/scientificpython")
     (synopsis "Python modules for scientific computing")
     (description "ScientificPython is a collection of Python modules that are