1{
2 lib,
3 fetchFromGitHub,
4 pythonOlder,
5 buildPythonPackage,
6 poetry-core,
7 backports-zoneinfo,
8 tzdata,
9 pytestCheckHook,
10 pytest-mypy-plugins,
11 hypothesis,
12 freezegun,
13}:
14
15buildPythonPackage rec {
16 pname = "whenever";
17 version = "0.5.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "ariebovenberg";
24 repo = "whenever";
25 rev = "refs/tags/${version}";
26 hash = "sha256-bG8LV+r5MjA1JwBHWy9/Io4daldAlyEGYNLW+5ITuOw=";
27 };
28
29 postPatch = ''
30 # unrecognized arguments since we don't use pytest-benchmark in nixpkgs
31 substituteInPlace pytest.ini \
32 --replace-fail '--benchmark-disable' '#--benchmark-disable'
33 '';
34
35 build-system = [ poetry-core ];
36
37 dependencies = [ tzdata ] ++ lib.optionals (pythonOlder "3.9") [ backports-zoneinfo ];
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 pytest-mypy-plugins
42 hypothesis
43 freezegun
44 ];
45
46 pythonImportsCheck = [ "whenever" ];
47
48 # early TDD, many tests are failing
49 # TODO: try enabling on bump
50 doCheck = false;
51
52 meta = with lib; {
53 description = "Strict, predictable, and typed datetimes";
54 homepage = "https://github.com/ariebovenberg/whenever";
55 changelog = "https://github.com/ariebovenberg/whenever/blob/${src.rev}/CHANGELOG.rst";
56 license = licenses.mit;
57 maintainers = with maintainers; [ pbsds ];
58 };
59}