Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / contexttimer / default.nix
blobe61178daaaaf7b757b749036c38fb0c5ef852a06
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , mock
5 , fetchpatch
6 , python
7 }:
9 buildPythonPackage rec {
10   pname = "contexttimer";
11   version = "unstable-2019-03-30";
13   src = fetchFromGitHub {
14     owner = "brouberol";
15     repo = "contexttimer";
16     rev = "a866f420ed4c10f29abf252c58b11f9db6706100";
17     hash = "sha256-Fc1vK1KSZWgBPtBf5dVydF6dLHEGAOslWMV0FLRdj8w=";
18   };
20   patches = [
21   # https://github.com/brouberol/contexttimer/pull/16
22     (fetchpatch {
23       url = "https://github.com/brouberol/contexttimer/commit/dd65871f3f25a523a47a74f2f5306c57048592b0.patch";
24       hash = "sha256-vNBuFXvuvb6hWPzg4W4iyKbd4N+vofhxsKydEkc25E4=";
25     })
26   ];
28   pythonImportsCheck = [ "contexttimer" ];
30   nativeCheckInputs = [ mock ];
32   checkPhase = ''
33     ${python.interpreter} -m unittest tests/test_timer.py
34   '';
36   meta = with lib; {
37     homepage = "https://github.com/brouberol/contexttimer";
38     description = "A timer as a context manager";
39     license = licenses.gpl3Only;
40     maintainers = with maintainers; [ atila ];
41   };