1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4
5# build-system
6, setuptools
7
8# dependencies
9, dateparser
10, humanize
11, tzlocal
12, pendulum
13, snaptime
14, pytz
15
16# tests
17, freezegun
18, pytestCheckHook
19}:
20
21buildPythonPackage rec {
22 pname = "maya";
23 version = "0.6.1";
24 format = "pyproject";
25
26 src = fetchFromGitHub {
27 owner = "kennethreitz";
28 repo = "maya";
29 rev = "refs/tags/v${version}";
30 hash = "sha256-4fUyUqVQk/AcQL3xMnU1cQlF5yiD/N9NPAsUPuDTTNY=";
31 };
32
33 postPatch = ''
34 # function was made private in humanize
35 substituteInPlace maya/core.py \
36 --replace "humanize.time.abs_timedelta" "humanize.time._abs_timedelta"
37 '';
38
39 nativeBuildInputs = [
40 setuptools
41 ];
42
43 propagatedBuildInputs = [
44 dateparser
45 humanize
46 pendulum
47 pytz
48 snaptime
49 tzlocal
50 ];
51
52 nativeCheckInputs = [
53 freezegun
54 pytestCheckHook
55 ];
56
57 meta = with lib; {
58 description = "Datetimes for Humans";
59 homepage = "https://github.com/kennethreitz/maya";
60 license = licenses.mit;
61 };
62}