evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / contexttimer / default.nix
blob1cba5807e96dec7ca9817de35cd2bc66dcbf6982
2   lib,
3   buildPythonPackage,
4   pythonAtLeast,
5   fetchFromGitHub,
6   mock,
7   fetchpatch,
8   python,
9 }:
11 buildPythonPackage rec {
12   pname = "contexttimer";
13   version = "unstable-2019-03-30";
14   format = "setuptools";
16   disabled = pythonAtLeast "3.12";
18   src = fetchFromGitHub {
19     owner = "brouberol";
20     repo = "contexttimer";
21     rev = "a866f420ed4c10f29abf252c58b11f9db6706100";
22     hash = "sha256-Fc1vK1KSZWgBPtBf5dVydF6dLHEGAOslWMV0FLRdj8w=";
23   };
25   patches = [
26     # https://github.com/brouberol/contexttimer/pull/16
27     (fetchpatch {
28       url = "https://github.com/brouberol/contexttimer/commit/dd65871f3f25a523a47a74f2f5306c57048592b0.patch";
29       hash = "sha256-vNBuFXvuvb6hWPzg4W4iyKbd4N+vofhxsKydEkc25E4=";
30     })
31   ];
33   pythonImportsCheck = [ "contexttimer" ];
35   nativeCheckInputs = [ mock ];
37   checkPhase = ''
38     ${python.interpreter} -m unittest tests/test_timer.py
39   '';
41   meta = with lib; {
42     homepage = "https://github.com/brouberol/contexttimer";
43     description = "Timer as a context manager";
44     license = licenses.gpl3Only;
45     maintainers = with maintainers; [ atila ];
46   };