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