Commit | Line | Data |
---|---|---|
233e7676 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> | |
33dc54b0 RW |
3 | ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org> |
4 | ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> | |
d1e75921 | 5 | ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il> |
33dc54b0 RW |
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> | |
33fdde8d | 12 | ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
5d20e1ec | 13 | ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com> |
4a78fd46 | 14 | ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is> |
33dc54b0 | 15 | ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> |
f8460d26 | 16 | ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com> |
3ef29c00 | 17 | ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com> |
b147f59f | 18 | ;;; |
233e7676 | 19 | ;;; This file is part of GNU Guix. |
b147f59f | 20 | ;;; |
233e7676 | 21 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
b147f59f NK |
22 | ;;; under the terms of the GNU General Public License as published by |
23 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
24 | ;;; your option) any later version. | |
25 | ;;; | |
233e7676 | 26 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
b147f59f NK |
27 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
28 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
29 | ;;; GNU General Public License for more details. | |
30 | ;;; | |
31 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 32 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
b147f59f | 33 | |
1ffa7090 | 34 | (define-module (gnu packages time) |
4a44e743 | 35 | #:use-module (guix licenses) |
b147f59f NK |
36 | #:use-module (guix packages) |
37 | #:use-module (guix download) | |
3ef29c00 | 38 | #:use-module (guix git-download) |
5d20e1ec BW |
39 | #:use-module (guix build-system gnu) |
40 | #:use-module (guix build-system python) | |
ac257f12 | 41 | #:use-module (gnu packages check) |
33dc54b0 | 42 | #:use-module (gnu packages compression) |
3ef29c00 | 43 | #:use-module (gnu packages perl) |
44d10b1f RW |
44 | #:use-module (gnu packages python) |
45 | #:use-module (gnu packages python-xyz)) | |
b147f59f NK |
46 | |
47 | (define-public time | |
48 | (package | |
49 | (name "time") | |
64f925cb | 50 | (version "1.9") |
b147f59f NK |
51 | (source |
52 | (origin | |
53 | (method url-fetch) | |
54 | (uri (string-append "mirror://gnu/time/time-" | |
55 | version ".tar.gz")) | |
56 | (sha256 | |
57 | (base32 | |
64f925cb | 58 | "07jj7cz6lc13iqrpgn81ivqh8rkm73p4rnivwgrrshk23v4g1b7v")))) |
b147f59f | 59 | (build-system gnu-build-system) |
6fd52309 | 60 | (home-page "https://www.gnu.org/software/time/") |
f50d2669 | 61 | (synopsis "Run a command, then display its resource usage") |
b147f59f | 62 | (description |
a22dc0c4 LC |
63 | "Time is a command that displays information about the resources that a |
64 | program uses. The display output of the program can be customized or saved | |
65 | to a file.") | |
c8b38f8e | 66 | (license gpl3+))) |
5d20e1ec BW |
67 | |
68 | (define-public python-pytzdata | |
69 | (package | |
70 | (name "python-pytzdata") | |
01e9bc46 | 71 | (version "2017.3.1") |
5d20e1ec BW |
72 | (source |
73 | (origin | |
74 | (method url-fetch) | |
75 | (uri (pypi-uri "pytzdata" version)) | |
76 | (sha256 | |
77 | (base32 | |
01e9bc46 | 78 | "1wi3jh39zsa9iiyyhynhj7w5b2p9wdyd0ppavpsrmf3wxvr7cwz8")))) |
5d20e1ec BW |
79 | (build-system python-build-system) |
80 | (native-inputs | |
81 | `(("python-pytest" ,python-pytest) | |
82 | ("python-nose" ,python-nose))) | |
83 | (home-page "https://github.com/sdispater/pytzdata") | |
84 | (synopsis "Timezone database for Python") | |
85 | (description | |
86 | "This library provides a timezone database for Python.") | |
87 | (license expat))) | |
88 | ||
89 | (define-public python2-tzdata | |
90 | (package-with-python2 python-pytzdata)) | |
89c3eaaa | 91 | |
33dc54b0 RW |
92 | (define-public python-pytz |
93 | (package | |
94 | (name "python-pytz") | |
cb5ba282 | 95 | (version "2018.5") |
33dc54b0 RW |
96 | (source |
97 | (origin | |
98 | (method url-fetch) | |
cb5ba282 | 99 | (uri (pypi-uri "pytz" version ".tar.gz")) |
33dc54b0 RW |
100 | (sha256 |
101 | (base32 | |
cb5ba282 | 102 | "0xzj5gkpdn2da8m6j47chlp6zrzcypv9m0fjv4236q3jw4fyzfgz")))) |
33dc54b0 | 103 | (build-system python-build-system) |
33dc54b0 RW |
104 | (home-page "http://pythonhosted.org/pytz") |
105 | (synopsis "Python timezone library") | |
106 | (description "This library brings the Olson tz database into Python. It | |
107 | allows accurate and cross platform timezone calculations using Python 2.4 or | |
108 | higher. It also solves the issue of ambiguous times at the end of daylight | |
109 | saving time. Almost all of the Olson timezones are supported.") | |
110 | (license expat))) | |
111 | ||
112 | (define-public python2-pytz | |
113 | (package-with-python2 python-pytz)) | |
114 | ||
89c3eaaa BW |
115 | (define-public python-pendulum |
116 | (package | |
117 | (name "python-pendulum") | |
118 | (version "1.2.4") | |
119 | (source | |
120 | (origin | |
121 | (method url-fetch) | |
122 | (uri (pypi-uri "pendulum" version)) | |
123 | (sha256 | |
124 | (base32 | |
125 | "1fj36yxi2f4lzchzd8ny1qjl67dbypnk0gn8qwad2w78579m8m8z")))) | |
126 | (build-system python-build-system) | |
127 | (native-inputs | |
128 | `(("python-pytest" ,python-pytest) | |
129 | ("python-nose" ,python-nose))) | |
130 | (propagated-inputs | |
131 | `(("python-dateutil" ,python-dateutil) | |
132 | ("python-pytzdata" ,python-pytzdata) | |
133 | ("python-tzlocal" ,python-tzlocal))) | |
134 | (home-page "https://github.com/sdispater/pendulum") | |
135 | (synopsis "Alternate API for Python datetimes") | |
136 | (description "Pendulum is a drop-in replacement for the standard | |
137 | @{datetime} class, providing an alternative API. As it inherits from the | |
138 | standard @code{datetime} all @code{datetime} instances can be replaced by | |
139 | Pendulum instances.") | |
140 | (license expat))) | |
141 | ||
142 | (define-public python2-pendulum | |
143 | (package-with-python2 python-pendulum)) | |
33dc54b0 RW |
144 | |
145 | (define-public python-dateutil | |
146 | (package | |
147 | (name "python-dateutil") | |
de92ab21 | 148 | (version "2.8.0") |
33dc54b0 RW |
149 | (source |
150 | (origin | |
151 | (method url-fetch) | |
152 | (uri (pypi-uri "python-dateutil" version)) | |
153 | (sha256 | |
154 | (base32 | |
de92ab21 | 155 | "17nsfhy4xdz1khrfxa61vd7pmvd5z0wa3zb6v4gb4kfnykv0b668")))) |
33dc54b0 | 156 | (build-system python-build-system) |
de92ab21 MB |
157 | (arguments |
158 | `(#:phases (modify-phases %standard-phases | |
159 | (replace 'check | |
160 | (lambda _ | |
161 | ;; Delete tests that depend on "freezegun" to avoid a | |
162 | ;; circular dependency. | |
163 | (delete-file "dateutil/test/test_utils.py") | |
164 | (delete-file "dateutil/test/test_rrule.py") | |
165 | ||
166 | ;; XXX: Fails to get timezone from /etc/localtime. | |
167 | (delete-file "dateutil/test/test_tz.py") | |
168 | ||
169 | (invoke "pytest" "-vv")))))) | |
e30fc546 | 170 | (native-inputs |
de92ab21 MB |
171 | `(("python-pytest" ,python-pytest) |
172 | ("python-setuptools-scm" ,python-setuptools-scm))) | |
33dc54b0 RW |
173 | (propagated-inputs |
174 | `(("python-six" ,python-six))) | |
175 | (home-page "https://dateutil.readthedocs.io/en/stable/") | |
176 | (synopsis "Extensions to the standard datetime module") | |
177 | (description | |
178 | "The dateutil module provides powerful extensions to the standard | |
179 | datetime module, available in Python 2.3+.") | |
e30fc546 MB |
180 | ;; The license was changed from the three-clause BSD license to a dual |
181 | ;; Apache 2.0/BSD-3 variant at 2017-12-01. Some code is only available as | |
182 | ;; BSD-3 still; but all new code is dual licensed (the user can choose). | |
183 | (license (list bsd-3 asl2.0)))) | |
33dc54b0 RW |
184 | |
185 | (define-public python2-dateutil | |
186 | (package-with-python2 python-dateutil)) | |
187 | ||
188 | (define-public python-parsedatetime | |
189 | (package | |
190 | (name "python-parsedatetime") | |
191 | (version "2.4") | |
192 | (source | |
193 | (origin | |
194 | (method url-fetch) | |
195 | (uri (pypi-uri "parsedatetime" version)) | |
196 | (sha256 | |
197 | (base32 | |
198 | "0jxqkjks7z9dn222cqgvskp4wr6d92aglinxq7pd2w4mzdc7r09x")))) | |
199 | (build-system python-build-system) | |
200 | (native-inputs | |
201 | `(("python-nose" ,python-nose) | |
202 | ("python-pyicu" ,python-pyicu) | |
203 | ("python-pytest" ,python-pytest) | |
204 | ("python-pytest-runner" ,python-pytest-runner))) | |
205 | (propagated-inputs | |
206 | `(("python-future" ,python-future))) | |
207 | (home-page "https://github.com/bear/parsedatetime/") | |
208 | (synopsis "Parse human-readable date/time text") | |
209 | (description | |
210 | "Parse human-readable date/time text.") | |
211 | (license asl2.0))) | |
212 | ||
213 | (define-public python2-parsedatetime | |
214 | (package-with-python2 python-parsedatetime)) | |
215 | ||
216 | (define-public python-tzlocal | |
217 | (package | |
218 | (name "python-tzlocal") | |
d1e75921 | 219 | (version "1.5.1") |
33dc54b0 RW |
220 | (source |
221 | (origin | |
222 | (method url-fetch) | |
223 | (uri (pypi-uri "tzlocal" version)) | |
224 | (sha256 | |
225 | (base32 | |
d1e75921 | 226 | "0kiciwiqx0bv0fbc913idxibc4ygg4cb7f8rcpd9ij2shi4bigjf")))) |
33dc54b0 | 227 | (build-system python-build-system) |
d1e75921 EF |
228 | (arguments |
229 | `(#:phases | |
230 | (modify-phases %standard-phases | |
231 | (add-before 'check 'fix-symlink-test | |
232 | ;; see: https://github.com/regebro/tzlocal/issues/53 | |
233 | (lambda _ | |
234 | (delete-file "tzlocal/test_data/symlink_localtime/etc/localtime") | |
235 | (symlink "../usr/share/zoneinfo/Africa/Harare" | |
236 | "tzlocal/test_data/symlink_localtime/etc/localtime") | |
237 | #t))))) | |
33dc54b0 RW |
238 | (propagated-inputs |
239 | `(("python-pytz" ,python-pytz))) | |
d1e75921 EF |
240 | (native-inputs |
241 | `(("python-mock" ,python-mock))) | |
33dc54b0 RW |
242 | (home-page "https://github.com/regebro/tzlocal") |
243 | (synopsis "Local timezone information for Python") | |
244 | (description | |
245 | "Tzlocal returns a tzinfo object with the local timezone information. | |
246 | This module attempts to fix a glaring hole in pytz, that there is no way to | |
247 | get the local timezone information, unless you know the zoneinfo name, and | |
248 | under several distributions that's hard or impossible to figure out.") | |
d1e75921 | 249 | (license expat))) |
33dc54b0 RW |
250 | |
251 | (define-public python-isodate | |
252 | (package | |
253 | (name "python-isodate") | |
e4be1faa | 254 | (version "0.6.0") |
33dc54b0 RW |
255 | (source |
256 | (origin | |
257 | (method url-fetch) | |
258 | (uri (pypi-uri "isodate" version)) | |
259 | (sha256 | |
260 | (base32 | |
e4be1faa | 261 | "1n7jkz68kk5pwni540pr5zdh99bf6ywydk1p5pdrqisrawylldif")))) |
33dc54b0 | 262 | (build-system python-build-system) |
e4be1faa EF |
263 | (native-inputs |
264 | `(("python-six" ,python-six))) | |
265 | (home-page "https://github.com/gweis/isodate/") | |
33dc54b0 RW |
266 | (synopsis "Python date parser and formatter") |
267 | (description | |
268 | "Python-isodate is a python module for parsing and formatting | |
269 | ISO 8601 dates, time and duration.") | |
270 | (license bsd-3))) | |
271 | ||
272 | (define-public python2-isodate | |
273 | (package-with-python2 python-isodate)) | |
274 | ||
275 | (define-public python-iso8601 | |
276 | (package | |
277 | (name "python-iso8601") | |
56f3b85b | 278 | (version "0.1.12") |
33dc54b0 RW |
279 | (source |
280 | (origin | |
281 | (method url-fetch) | |
282 | (uri (pypi-uri "iso8601" version)) | |
283 | (sha256 | |
284 | (base32 | |
56f3b85b | 285 | "10nyvvnrhw2w3p09v1ica4lgj6f4g9j3kkfx17qmraiq3w7b5i29")))) |
33dc54b0 RW |
286 | (build-system python-build-system) |
287 | (native-inputs | |
288 | `(("python-pytest" ,python-pytest))) | |
289 | (home-page "https://bitbucket.org/micktwomey/pyiso8601") | |
290 | (synopsis "Module to parse ISO 8601 dates") | |
291 | (description | |
292 | "This module parses the most common forms of ISO 8601 date strings (e.g. | |
293 | @code{2007-01-14T20:34:22+00:00}) into @code{datetime} objects.") | |
294 | (license expat))) | |
295 | ||
296 | (define-public python2-iso8601 | |
297 | (package-with-python2 python-iso8601)) | |
298 | ||
299 | (define-public python-monotonic | |
300 | (package | |
301 | (name "python-monotonic") | |
33fdde8d | 302 | (version "1.5") |
33dc54b0 RW |
303 | (source |
304 | (origin | |
305 | (method url-fetch) | |
db3e631d | 306 | (uri (pypi-uri "monotonic" version)) |
33dc54b0 RW |
307 | (sha256 |
308 | (base32 | |
33fdde8d | 309 | "1c6z46yb600klbfhqadyl7vq0jdjdxkm72k43ra3iw3d0xakv593")))) |
33dc54b0 | 310 | (build-system python-build-system) |
33fdde8d | 311 | (arguments '(#:tests? #f)) ; no tests |
33dc54b0 RW |
312 | (home-page "https://github.com/atdt/monotonic") |
313 | (synopsis "Implementation of time.monotonic() for Python 2 & < 3.3") | |
314 | (description | |
315 | "This module provides a @code{monotonic()} function which returns the | |
316 | value (in fractional seconds) of a clock which never goes backwards.") | |
317 | (license asl2.0))) | |
318 | ||
319 | (define-public python2-monotonic | |
320 | (package-with-python2 python-monotonic)) | |
321 | ||
322 | (define-public python-pyrfc3339 | |
323 | (package | |
324 | (name "python-pyrfc3339") | |
0ce92d74 | 325 | (version "1.1") |
33dc54b0 RW |
326 | (source |
327 | (origin | |
328 | (method url-fetch) | |
329 | (uri (pypi-uri "pyRFC3339" version)) | |
330 | (sha256 | |
331 | (base32 | |
0ce92d74 | 332 | "06jv7ar7lpvvk0dixzwdr3wgm0g1lipxs429s2z7knwwa7hwpf41")))) |
33dc54b0 RW |
333 | (build-system python-build-system) |
334 | (propagated-inputs | |
335 | `(("python-pytz" ,python-pytz))) | |
336 | (native-inputs | |
337 | `(("python-nose" ,python-nose))) | |
338 | (home-page "https://github.com/kurtraschke/pyRFC3339") | |
339 | (synopsis "Python timestamp library") | |
340 | (description "Python library for generating and parsing RFC 3339-compliant | |
341 | timestamps.") | |
342 | (license expat))) | |
343 | ||
344 | (define-public python2-pyrfc3339 | |
345 | (package-with-python2 python-pyrfc3339)) | |
346 | ||
347 | (define-public python-arrow | |
348 | (package | |
349 | (name "python-arrow") | |
350 | (version "0.10.0") | |
351 | (source (origin | |
352 | (method url-fetch) | |
353 | (uri (pypi-uri "arrow" version)) | |
354 | (sha256 | |
355 | (base32 | |
356 | "08n7q2l69hlainds1byd4lxhwrq7zsw7s640zkqc3bs5jkq0cnc0")))) | |
357 | (build-system python-build-system) | |
358 | (native-inputs | |
359 | `(;; For testing | |
360 | ("python-chai" ,python-chai) | |
361 | ("python-simplejson" ,python-simplejson))) | |
362 | (propagated-inputs | |
363 | `(("python-dateutil" ,python-dateutil))) | |
364 | (home-page "https://github.com/crsmithdev/arrow/") | |
365 | (synopsis "Dates and times for Python") | |
366 | (description | |
367 | "Arrow is a Python library to creating, manipulating, formatting and | |
368 | converting dates, times, and timestamps. It implements and updates the | |
369 | datetime type.") | |
370 | (license asl2.0))) | |
371 | ||
372 | (define-public python2-arrow | |
373 | (package-with-python2 python-arrow)) | |
374 | ||
375 | (define-public python-aniso8601 | |
376 | (package | |
377 | (name "python-aniso8601") | |
378 | (version "1.3.0") | |
379 | (source | |
380 | (origin | |
381 | (method url-fetch) | |
382 | (uri (pypi-uri "aniso8601" version)) | |
383 | (sha256 | |
384 | (base32 | |
385 | "1waj54iv3n3lw1fapbz8a93yjgrybgpc86wif5baxdh1arpj9df3")))) | |
386 | (build-system python-build-system) | |
387 | (propagated-inputs | |
388 | `(("python-dateutil" ,python-dateutil))) | |
389 | (home-page "https://bitbucket.org/nielsenb/aniso8601") | |
390 | (synopsis "Python library for parsing ISO 8601 strings") | |
391 | (description | |
392 | "This package contains a library for parsing ISO 8601 datetime strings.") | |
393 | (license bsd-3))) | |
394 | ||
395 | (define-public python2-aniso8601 | |
396 | (package-with-python2 python-aniso8601)) | |
3ef29c00 KM |
397 | |
398 | (define-public datefudge | |
399 | (package | |
400 | (name "datefudge") | |
401 | (version "1.22") | |
402 | (source (origin | |
403 | (method git-fetch) | |
404 | (uri (git-reference | |
405 | (url "https://salsa.debian.org/debian/datefudge.git") | |
406 | (commit (string-append "debian/" version)))) | |
407 | (file-name (git-file-name name version)) | |
408 | (sha256 | |
409 | (base32 | |
410 | "1fmd05r00wx4zc90lbi804jl7xwdl11jq2a1kp5lqimk3yyvfw4c")))) | |
411 | (build-system gnu-build-system) | |
412 | (arguments | |
413 | `(#:test-target "test" | |
414 | #:make-flags (list "CC=gcc" | |
415 | (string-append "prefix=" (assoc-ref %outputs "out"))) | |
416 | #:phases | |
417 | (modify-phases %standard-phases | |
418 | (add-after 'unpack 'patch-makefile | |
419 | (lambda _ | |
420 | (substitute* "Makefile" | |
421 | ((" -o root -g root") "") | |
422 | (("VERSION := \\$\\(shell dpkg-parsechangelog .*") | |
423 | (string-append "VERSION = " ,version))) | |
424 | #t)) | |
425 | (delete 'configure)))) | |
426 | (native-inputs | |
427 | `(("perl" ,perl))) | |
428 | (home-page "https://salsa.debian.org/debian/datefudge") | |
429 | (synopsis "Pretend the system date is different") | |
430 | (description | |
431 | "Utility that fakes the system time by pre-loading a small library that | |
432 | modifies the @code{time}, @code{gettimeofday} and @code{clock_gettime} system | |
433 | calls.") | |
434 | (license gpl2))) |