about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/maya/default.nix
blob: e96d66826583365e8e204822c2fa5be07163efee (plain) (blame)
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
{ lib
, fetchFromGitHub
, buildPythonPackage

# build-system
, setuptools

# dependencies
, dateparser
, humanize
, tzlocal
, pendulum
, snaptime
, pytz

# tests
, freezegun
, pytestCheckHook
}:

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

  src = fetchFromGitHub {
    owner = "kennethreitz";
    repo = "maya";
    rev = "refs/tags/v${version}";
    hash = "sha256-4fUyUqVQk/AcQL3xMnU1cQlF5yiD/N9NPAsUPuDTTNY=";
  };

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

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    dateparser
    humanize
    pendulum
    pytz
    snaptime
    tzlocal
  ];

  nativeCheckInputs = [
    freezegun
    pytestCheckHook
  ];

  meta = with lib; {
    description = "Datetimes for Humans";
    homepage = "https://github.com/kennethreitz/maya";
    license = licenses.mit;
  };
}