summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/maya/default.nix
blob: 82a064973683310e6821b653613bf6ecf67d5dd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  lib,
  buildPythonPackage,
  dateparser,
  fetchFromGitHub,
  freezegun,
  humanize,
  pendulum,
  pytest-mock,
  pytestCheckHook,
  pytz,
  setuptools,
  snaptime,
  tzlocal,
}:

buildPythonPackage rec {
  pname = "maya";
  version = "0.6.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "timofurrer";
    repo = "maya";
    tag = "v${version}";
    hash = "sha256-4fUyUqVQk/AcQL3xMnU1cQlF5yiD/N9NPAsUPuDTTNY=";
  };

  postPatch = ''
    # function was made private in humanize
    substituteInPlace maya/core.py \
      --replace-fail "humanize.time.abs_timedelta" "humanize.time._abs_timedelta"
  '';

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    dateparser
    humanize
    pendulum
    pytz
    snaptime
    tzlocal
  ];

  nativeCheckInputs = [
    freezegun
    pytest-mock
    pytestCheckHook
  ];

  pythonImportsCheck = [ "maya" ];

  disabledTests = [
    # https://github.com/timofurrer/maya/issues/202
    "test_parse_iso8601"
  ];

  meta = {
    description = "Datetimes for Humans";
    homepage = "https://github.com/timofurrer/maya";
    changelog = "https://github.com/timofurrer/maya/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
}