1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 setuptools,
7 mock,
8 pytestCheckHook,
9}:
10
11buildPythonPackage {
12 pname = "contexttimer";
13 version = "unstable-2024-09-05";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "brouberol";
18 repo = "contexttimer";
19 rev = "8e77927b8b75365f8e2bc456d2457b3e47c67815";
20 hash = "sha256-LCyXJa+7XkfxzcLGonv1yfOW+gZhLFBAbBT+5IP39qA=";
21 };
22
23 disabled = pythonOlder "3.12";
24
25 build-system = [ setuptools ];
26
27 preCheck = ''
28 substituteInPlace tests/test_timer.py \
29 --replace-fail "assertRegexpMatches" "assertRegex"
30 '';
31
32 nativeCheckInputs = [
33 mock
34 pytestCheckHook
35 ];
36
37 pythonImportsCheck = [ "contexttimer" ];
38
39 meta = {
40 homepage = "https://github.com/brouberol/contexttimer";
41 description = "Timer as a context manager";
42 license = lib.licenses.gpl3Only;
43 maintainers = with lib.maintainers; [ atila ];
44 };
45}