gnu: sbcl-cl-cffi-gtk: Update to 20200417.
[jackhill/guix/guix.git] / gnu / packages / time.scm
index 895cf6a..14f44c8 100644 (file)
@@ -2,18 +2,21 @@
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
-;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
-;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2017 ng0 <ng0@n0.is>
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
+;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
+;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
-  #:use-module (gnu packages python))
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz))
 
 (define-public time
   (package
@@ -61,21 +67,43 @@ program uses.  The display output of the program can be customized or saved
 to a file.")
     (license gpl3+)))
 
+(define-public python-pytimeparse
+  (package
+    (name "python-pytimeparse")
+    (version "1.1.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytimeparse" version))
+       (sha256
+        (base32
+         "02kaambsgpjx3zi42j6l11rwms2p35b9hsk4f3kdf979gd3kcqg8"))))
+    (native-inputs
+     `(("python-nose" ,python-nose)))
+    (build-system python-build-system)
+    (home-page "https://github.com/wroberts/pytimeparse")
+    (synopsis "Time expression parser")
+    (description "This small Python module parses various kinds of time
+expressions.")
+    (license expat)))
+
 (define-public python-pytzdata
   (package
     (name "python-pytzdata")
-    (version "2017.3.1")
+    (version "2019.3")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pytzdata" version))
        (sha256
         (base32
-         "1wi3jh39zsa9iiyyhynhj7w5b2p9wdyd0ppavpsrmf3wxvr7cwz8"))))
+         "0ppfc6kz4p41mxyqxq1g1zp6gvns99g6b344qj6ih0x9vxy6zh7s"))))
     (build-system python-build-system)
-    (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ("python-nose" ,python-nose)))
+    ;; XXX: The PyPI distribution contains no tests, and the upstream
+    ;; repository lacks a setup.py!  How to build from git?
+    (arguments '(#:tests? #f))
+    (propagated-inputs
+     `(("python-cleo" ,python-cleo)))
     (home-page "https://github.com/sdispater/pytzdata")
     (synopsis "Timezone database for Python")
     (description
@@ -88,14 +116,14 @@ to a file.")
 (define-public python-pytz
   (package
     (name "python-pytz")
-    (version "2018.5")
+    (version "2019.1")
     (source
      (origin
       (method url-fetch)
-      (uri (pypi-uri "pytz" version ".tar.gz"))
+      (uri (pypi-uri "pytz" version))
       (sha256
        (base32
-        "0xzj5gkpdn2da8m6j47chlp6zrzcypv9m0fjv4236q3jw4fyzfgz"))))
+        "0hg1r2c41gnmljdsdmdgy6kb1zkfmxsf49imd96g8znp4cyxsiyp"))))
     (build-system python-build-system)
     (home-page "http://pythonhosted.org/pytz")
     (synopsis "Python timezone library")
@@ -111,22 +139,21 @@ saving time.  Almost all of the Olson timezones are supported.")
 (define-public python-pendulum
   (package
     (name "python-pendulum")
-    (version "1.2.4")
+    (version "2.1.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pendulum" version))
        (sha256
         (base32
-         "1fj36yxi2f4lzchzd8ny1qjl67dbypnk0gn8qwad2w78579m8m8z"))))
+         "1zhzk0ai8is8zclw4v73dllf0hx0l5nmm4sbwrh6cl8h5qsang09"))))
     (build-system python-build-system)
-    (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ("python-nose" ,python-nose)))
+    ;; XXX: The PyPI distribution lacks tests, and the upstream repository
+    ;; lacks a setup.py!
+    (arguments '(#:tests? #f))
     (propagated-inputs
      `(("python-dateutil" ,python-dateutil)
-       ("python-pytzdata" ,python-pytzdata)
-       ("python-tzlocal" ,python-tzlocal)))
+       ("python-pytzdata" ,python-pytzdata)))
     (home-page "https://github.com/sdispater/pendulum")
     (synopsis "Alternate API for Python datetimes")
     (description "Pendulum is a drop-in replacement for the standard
@@ -141,17 +168,31 @@ Pendulum instances.")
 (define-public python-dateutil
   (package
     (name "python-dateutil")
-    (version "2.7.3")
+    (version "2.8.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "python-dateutil" version))
        (sha256
         (base32
-         "1f7h54lg0w2ckch7592xpjkh8dg87k2br256h0iw49zn6bg02w72"))))
+         "17nsfhy4xdz1khrfxa61vd7pmvd5z0wa3zb6v4gb4kfnykv0b668"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      ;; Delete tests that depend on "freezegun" to avoid a
+                      ;; circular dependency.
+                      (delete-file "dateutil/test/test_utils.py")
+                      (delete-file "dateutil/test/test_rrule.py")
+
+                      ;; XXX: Fails to get timezone from /etc/localtime.
+                      (delete-file "dateutil/test/test_tz.py")
+
+                      (invoke "pytest" "-vv"))))))
     (native-inputs
-     `(("python-setuptools-scm" ,python-setuptools-scm)))
+     `(("python-pytest" ,python-pytest)
+       ("python-setuptools-scm" ,python-setuptools-scm)))
     (propagated-inputs
      `(("python-six" ,python-six)))
     (home-page "https://dateutil.readthedocs.io/en/stable/")
@@ -195,20 +236,60 @@ datetime module, available in Python 2.3+.")
 (define-public python2-parsedatetime
   (package-with-python2 python-parsedatetime))
 
+(define-public python-ciso8601
+  (package
+    (name "python-ciso8601")
+    (version "2.1.3")
+    (source
+     (origin
+       (method git-fetch)
+       ;; The PyPi distribution doesn't include the tests.
+       (uri (git-reference
+             (url "https://github.com/closeio/ciso8601.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0g1aiyc1ayh0rnibyy416m5mmck38ksgdm3jsy0z3rxgmgb24951"))))
+    (build-system python-build-system)
+    ;; Pytz should only be required for Python 2, but the test suite fails
+    ;; without it.
+    (native-inputs
+     `(("python-pytz" ,python-pytz)))
+    (home-page "https://github.com/closeio/ciso8601")
+    (synopsis
+     "Fast ISO8601 date time parser")
+    (description
+     "The package ciso8601 converts ISO 8601 or RFC 3339 date time strings into
+Python datetime objects.")
+    (license expat)))
+
 (define-public python-tzlocal
   (package
     (name "python-tzlocal")
-    (version "1.2.2")
+    (version "1.5.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "tzlocal" version))
        (sha256
         (base32
-         "0paj7vlsb0np8b5sp4bv64wxv7qk2piyp7xg29pkhdjwsbls9fnb"))))
+         "0kiciwiqx0bv0fbc913idxibc4ygg4cb7f8rcpd9ij2shi4bigjf"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'fix-symlink-test
+           ;; see: https://github.com/regebro/tzlocal/issues/53
+           (lambda _
+             (delete-file "tzlocal/test_data/symlink_localtime/etc/localtime")
+             (symlink "../usr/share/zoneinfo/Africa/Harare"
+                      "tzlocal/test_data/symlink_localtime/etc/localtime")
+             #t)))))
     (propagated-inputs
      `(("python-pytz" ,python-pytz)))
+    (native-inputs
+     `(("python-mock" ,python-mock)))
     (home-page "https://github.com/regebro/tzlocal")
     (synopsis "Local timezone information for Python")
     (description
@@ -216,21 +297,23 @@ datetime module, available in Python 2.3+.")
 This module attempts to fix a glaring hole in pytz, that there is no way to
 get the local timezone information, unless you know the zoneinfo name, and
 under several distributions that's hard or impossible to figure out.")
-    (license cc0)))
+    (license expat)))
 
 (define-public python-isodate
   (package
     (name "python-isodate")
-    (version "0.5.4")
+    (version "0.6.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "isodate" version))
        (sha256
         (base32
-         "0cafaiwixgpxwh9dsd28qb0dbzsj6xpxjdkyk30ns91ps10mq422"))))
+         "1n7jkz68kk5pwni540pr5zdh99bf6ywydk1p5pdrqisrawylldif"))))
     (build-system python-build-system)
-    (home-page "http://cheeseshop.python.org/pypi/isodate")
+    (native-inputs
+     `(("python-six" ,python-six)))
+    (home-page "https://github.com/gweis/isodate/")
     (synopsis "Python date parser and formatter")
     (description
      "Python-isodate is a python module for parsing and formatting
@@ -362,3 +445,41 @@ datetime type.")
 
 (define-public python2-aniso8601
   (package-with-python2 python-aniso8601))
+
+(define-public datefudge
+  (package
+    (name "datefudge")
+    (version "1.23")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://salsa.debian.org/debian/datefudge.git")
+                    (commit (string-append "debian/" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0r9g8v9xnv60hq3j20wqy34kyig3sc2pisjxl4irn7jjx85f1spv"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:make-flags (list "CC=gcc"
+                          (string-append "prefix=" (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-makefile
+           (lambda _
+             (substitute* "Makefile"
+               ((" -o root -g root") "")
+               (("VERSION := \\$\\(shell dpkg-parsechangelog .*")
+                (string-append "VERSION = " ,version)))
+             #t))
+         (delete 'configure))))
+    (native-inputs
+     `(("perl" ,perl)))
+    (home-page "https://salsa.debian.org/debian/datefudge")
+    (synopsis "Pretend the system date is different")
+    (description
+     "Utility that fakes the system time by pre-loading a small library that
+modifies the @code{time}, @code{gettimeofday} and @code{clock_gettime} system
+calls.")
+    (license gpl2)))