about summary refs log tree commit diff
path: root/pkgs/development/python-modules/python-datemath/default.nix
blob: 0dc6b6034532ee212e6eec266fbf7ff331aea34e (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
{ lib
, arrow
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pythonOlder
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "python-datemath";
  version = "1.5.5";
  format = "setuptools";

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "nickmaccarthy";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-WVWGhyBguE1+KEMQu0N5QxO7IC4rPEJ/2L3VWUCQNi4=";
  };

  patches = [
    (fetchpatch {
      name = "remove-unittest2.patch";
      url = "https://github.com/nickmaccarthy/python-datemath/commit/781daa0241ed327d5f211f3b62f553f3ee3d86e0.patch";
      hash = "sha256-WD6fuDaSSNXgYWoaUexiWnofCzEZzercEUlqTvOUT5I=";
    })
  ];

  propagatedBuildInputs = [
    arrow
  ];

  checkInputs = [
    pytestCheckHook
  ];

  pytestFlagsArray = [
    "tests.py"
  ];

  pythonImportsCheck = [
    "datemath"
  ];

  meta = with lib; {
    description = "Python module to emulate the date math used in SOLR and Elasticsearch";
    homepage = "https://github.com/nickmaccarthy/python-datemath";
    license = with licenses; [ asl20 ];
    maintainers = with maintainers; [ fab ];
  };
}