1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2015, 2017 Cyril Roelandt <tipecaml@gmail.com>
8 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
10 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
11 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
12 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
14 ;;; Copyright © 2017 ng0 <ng0@n0.is>
15 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
16 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
17 ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
18 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
20 ;;; This file is part of GNU Guix.
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 (define-module (gnu packages time)
36 #:use-module (guix licenses)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system python)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages python-xyz))
55 (uri (string-append "mirror://gnu/time/time-"
59 "07jj7cz6lc13iqrpgn81ivqh8rkm73p4rnivwgrrshk23v4g1b7v"))))
60 (build-system gnu-build-system)
61 (home-page "https://www.gnu.org/software/time/")
62 (synopsis "Run a command, then display its resource usage")
64 "Time is a command that displays information about the resources that a
65 program uses. The display output of the program can be customized or saved
69 (define-public python-pytimeparse
71 (name "python-pytimeparse")
76 (uri (pypi-uri "pytimeparse" version))
79 "02kaambsgpjx3zi42j6l11rwms2p35b9hsk4f3kdf979gd3kcqg8"))))
81 `(("python-nose" ,python-nose)))
82 (build-system python-build-system)
83 (home-page "https://github.com/wroberts/pytimeparse")
84 (synopsis "Time expression parser")
85 (description "This small Python module parses various kinds of time
89 (define-public python-pytzdata
91 (name "python-pytzdata")
96 (uri (pypi-uri "pytzdata" version))
99 "1wi3jh39zsa9iiyyhynhj7w5b2p9wdyd0ppavpsrmf3wxvr7cwz8"))))
100 (build-system python-build-system)
102 `(("python-pytest" ,python-pytest)
103 ("python-nose" ,python-nose)))
104 (home-page "https://github.com/sdispater/pytzdata")
105 (synopsis "Timezone database for Python")
107 "This library provides a timezone database for Python.")
110 (define-public python2-tzdata
111 (package-with-python2 python-pytzdata))
113 (define-public python-pytz
120 (uri (pypi-uri "pytz" version))
123 "0hg1r2c41gnmljdsdmdgy6kb1zkfmxsf49imd96g8znp4cyxsiyp"))))
124 (build-system python-build-system)
125 (home-page "http://pythonhosted.org/pytz")
126 (synopsis "Python timezone library")
127 (description "This library brings the Olson tz database into Python. It
128 allows accurate and cross platform timezone calculations using Python 2.4 or
129 higher. It also solves the issue of ambiguous times at the end of daylight
130 saving time. Almost all of the Olson timezones are supported.")
133 (define-public python2-pytz
134 (package-with-python2 python-pytz))
136 (define-public python-pendulum
138 (name "python-pendulum")
143 (uri (pypi-uri "pendulum" version))
146 "1fj36yxi2f4lzchzd8ny1qjl67dbypnk0gn8qwad2w78579m8m8z"))))
147 (build-system python-build-system)
149 `(("python-pytest" ,python-pytest)
150 ("python-nose" ,python-nose)))
152 `(("python-dateutil" ,python-dateutil)
153 ("python-pytzdata" ,python-pytzdata)
154 ("python-tzlocal" ,python-tzlocal)))
155 (home-page "https://github.com/sdispater/pendulum")
156 (synopsis "Alternate API for Python datetimes")
157 (description "Pendulum is a drop-in replacement for the standard
158 @{datetime} class, providing an alternative API. As it inherits from the
159 standard @code{datetime} all @code{datetime} instances can be replaced by
160 Pendulum instances.")
163 (define-public python2-pendulum
164 (package-with-python2 python-pendulum))
166 (define-public python-dateutil
168 (name "python-dateutil")
173 (uri (pypi-uri "python-dateutil" version))
176 "17nsfhy4xdz1khrfxa61vd7pmvd5z0wa3zb6v4gb4kfnykv0b668"))))
177 (build-system python-build-system)
179 `(#:phases (modify-phases %standard-phases
182 ;; Delete tests that depend on "freezegun" to avoid a
183 ;; circular dependency.
184 (delete-file "dateutil/test/test_utils.py")
185 (delete-file "dateutil/test/test_rrule.py")
187 ;; XXX: Fails to get timezone from /etc/localtime.
188 (delete-file "dateutil/test/test_tz.py")
190 (invoke "pytest" "-vv"))))))
192 `(("python-pytest" ,python-pytest)
193 ("python-setuptools-scm" ,python-setuptools-scm)))
195 `(("python-six" ,python-six)))
196 (home-page "https://dateutil.readthedocs.io/en/stable/")
197 (synopsis "Extensions to the standard datetime module")
199 "The dateutil module provides powerful extensions to the standard
200 datetime module, available in Python 2.3+.")
201 ;; The license was changed from the three-clause BSD license to a dual
202 ;; Apache 2.0/BSD-3 variant at 2017-12-01. Some code is only available as
203 ;; BSD-3 still; but all new code is dual licensed (the user can choose).
204 (license (list bsd-3 asl2.0))))
206 (define-public python2-dateutil
207 (package-with-python2 python-dateutil))
209 (define-public python-parsedatetime
211 (name "python-parsedatetime")
216 (uri (pypi-uri "parsedatetime" version))
219 "0jxqkjks7z9dn222cqgvskp4wr6d92aglinxq7pd2w4mzdc7r09x"))))
220 (build-system python-build-system)
222 `(("python-nose" ,python-nose)
223 ("python-pyicu" ,python-pyicu)
224 ("python-pytest" ,python-pytest)
225 ("python-pytest-runner" ,python-pytest-runner)))
227 `(("python-future" ,python-future)))
228 (home-page "https://github.com/bear/parsedatetime/")
229 (synopsis "Parse human-readable date/time text")
231 "Parse human-readable date/time text.")
234 (define-public python2-parsedatetime
235 (package-with-python2 python-parsedatetime))
237 (define-public python-tzlocal
239 (name "python-tzlocal")
244 (uri (pypi-uri "tzlocal" version))
247 "0kiciwiqx0bv0fbc913idxibc4ygg4cb7f8rcpd9ij2shi4bigjf"))))
248 (build-system python-build-system)
251 (modify-phases %standard-phases
252 (add-before 'check 'fix-symlink-test
253 ;; see: https://github.com/regebro/tzlocal/issues/53
255 (delete-file "tzlocal/test_data/symlink_localtime/etc/localtime")
256 (symlink "../usr/share/zoneinfo/Africa/Harare"
257 "tzlocal/test_data/symlink_localtime/etc/localtime")
260 `(("python-pytz" ,python-pytz)))
262 `(("python-mock" ,python-mock)))
263 (home-page "https://github.com/regebro/tzlocal")
264 (synopsis "Local timezone information for Python")
266 "Tzlocal returns a tzinfo object with the local timezone information.
267 This module attempts to fix a glaring hole in pytz, that there is no way to
268 get the local timezone information, unless you know the zoneinfo name, and
269 under several distributions that's hard or impossible to figure out.")
272 (define-public python-isodate
274 (name "python-isodate")
279 (uri (pypi-uri "isodate" version))
282 "1n7jkz68kk5pwni540pr5zdh99bf6ywydk1p5pdrqisrawylldif"))))
283 (build-system python-build-system)
285 `(("python-six" ,python-six)))
286 (home-page "https://github.com/gweis/isodate/")
287 (synopsis "Python date parser and formatter")
289 "Python-isodate is a python module for parsing and formatting
290 ISO 8601 dates, time and duration.")
293 (define-public python2-isodate
294 (package-with-python2 python-isodate))
296 (define-public python-iso8601
298 (name "python-iso8601")
303 (uri (pypi-uri "iso8601" version))
306 "10nyvvnrhw2w3p09v1ica4lgj6f4g9j3kkfx17qmraiq3w7b5i29"))))
307 (build-system python-build-system)
309 `(("python-pytest" ,python-pytest)))
310 (home-page "https://bitbucket.org/micktwomey/pyiso8601")
311 (synopsis "Module to parse ISO 8601 dates")
313 "This module parses the most common forms of ISO 8601 date strings (e.g.
314 @code{2007-01-14T20:34:22+00:00}) into @code{datetime} objects.")
317 (define-public python2-iso8601
318 (package-with-python2 python-iso8601))
320 (define-public python-monotonic
322 (name "python-monotonic")
327 (uri (pypi-uri "monotonic" version))
330 "1c6z46yb600klbfhqadyl7vq0jdjdxkm72k43ra3iw3d0xakv593"))))
331 (build-system python-build-system)
332 (arguments '(#:tests? #f)) ; no tests
333 (home-page "https://github.com/atdt/monotonic")
334 (synopsis "Implementation of time.monotonic() for Python 2 & < 3.3")
336 "This module provides a @code{monotonic()} function which returns the
337 value (in fractional seconds) of a clock which never goes backwards.")
340 (define-public python2-monotonic
341 (package-with-python2 python-monotonic))
343 (define-public python-pyrfc3339
345 (name "python-pyrfc3339")
350 (uri (pypi-uri "pyRFC3339" version))
353 "06jv7ar7lpvvk0dixzwdr3wgm0g1lipxs429s2z7knwwa7hwpf41"))))
354 (build-system python-build-system)
356 `(("python-pytz" ,python-pytz)))
358 `(("python-nose" ,python-nose)))
359 (home-page "https://github.com/kurtraschke/pyRFC3339")
360 (synopsis "Python timestamp library")
361 (description "Python library for generating and parsing RFC 3339-compliant
365 (define-public python2-pyrfc3339
366 (package-with-python2 python-pyrfc3339))
368 (define-public python-arrow
370 (name "python-arrow")
374 (uri (pypi-uri "arrow" version))
377 "08n7q2l69hlainds1byd4lxhwrq7zsw7s640zkqc3bs5jkq0cnc0"))))
378 (build-system python-build-system)
381 ("python-chai" ,python-chai)
382 ("python-simplejson" ,python-simplejson)))
384 `(("python-dateutil" ,python-dateutil)))
385 (home-page "https://github.com/crsmithdev/arrow/")
386 (synopsis "Dates and times for Python")
388 "Arrow is a Python library to creating, manipulating, formatting and
389 converting dates, times, and timestamps. It implements and updates the
393 (define-public python2-arrow
394 (package-with-python2 python-arrow))
396 (define-public python-aniso8601
398 (name "python-aniso8601")
403 (uri (pypi-uri "aniso8601" version))
406 "1waj54iv3n3lw1fapbz8a93yjgrybgpc86wif5baxdh1arpj9df3"))))
407 (build-system python-build-system)
409 `(("python-dateutil" ,python-dateutil)))
410 (home-page "https://bitbucket.org/nielsenb/aniso8601")
411 (synopsis "Python library for parsing ISO 8601 strings")
413 "This package contains a library for parsing ISO 8601 datetime strings.")
416 (define-public python2-aniso8601
417 (package-with-python2 python-aniso8601))
419 (define-public datefudge
426 (url "https://salsa.debian.org/debian/datefudge.git")
427 (commit (string-append "debian/" version))))
428 (file-name (git-file-name name version))
431 "1fmd05r00wx4zc90lbi804jl7xwdl11jq2a1kp5lqimk3yyvfw4c"))))
432 (build-system gnu-build-system)
434 `(#:test-target "test"
435 #:make-flags (list "CC=gcc"
436 (string-append "prefix=" (assoc-ref %outputs "out")))
438 (modify-phases %standard-phases
439 (add-after 'unpack 'patch-makefile
441 (substitute* "Makefile"
442 ((" -o root -g root") "")
443 (("VERSION := \\$\\(shell dpkg-parsechangelog .*")
444 (string-append "VERSION = " ,version)))
446 (delete 'configure))))
449 (home-page "https://salsa.debian.org/debian/datefudge")
450 (synopsis "Pretend the system date is different")
452 "Utility that fakes the system time by pre-loading a small library that
453 modifies the @code{time}, @code{gettimeofday} and @code{clock_gettime} system