1{
2 lib,
3 arrow,
4 buildPythonPackage,
5 fetchFromGitHub,
6 fetchpatch,
7 pythonOlder,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "python-datemath";
13 version = "1.5.5";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "nickmaccarthy";
20 repo = pname;
21 rev = "v${version}";
22 hash = "sha256-WVWGhyBguE1+KEMQu0N5QxO7IC4rPEJ/2L3VWUCQNi4=";
23 };
24
25 patches = [
26 (fetchpatch {
27 name = "remove-unittest2.patch";
28 url = "https://github.com/nickmaccarthy/python-datemath/commit/781daa0241ed327d5f211f3b62f553f3ee3d86e0.patch";
29 hash = "sha256-WD6fuDaSSNXgYWoaUexiWnofCzEZzercEUlqTvOUT5I=";
30 })
31 ];
32
33 propagatedBuildInputs = [ arrow ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 pytestFlagsArray = [ "tests.py" ];
38
39 pythonImportsCheck = [ "datemath" ];
40
41 meta = with lib; {
42 description = "Python module to emulate the date math used in SOLR and Elasticsearch";
43 homepage = "https://github.com/nickmaccarthy/python-datemath";
44 license = with licenses; [ asl20 ];
45 maintainers = with maintainers; [ fab ];
46 };
47}