Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, pythonOlder 5, pytestCheckHook 6}: 7 8buildPythonPackage { 9 pname = "takethetime"; 10 version = "0.3.1"; 11 12 # pypi distribution doesn't include tests, so build from source instead 13 src = fetchFromGitHub { 14 owner = "ErikBjare"; 15 repo = "TakeTheTime"; 16 rev = "b0042ac5b1cc9d3b70ef59167b094469ceb660dd"; 17 sha256 = "sha256-DwsMnP6G3BzOnINttaSC6QKkIKK5qyhUz+lN1DSvkw0="; 18 }; 19 20 disabled = pythonOlder "3.6"; 21 22 nativeCheckInputs = [ pytestCheckHook ]; 23 24 pytestFlagsArray = [ "tests/tests.py" ]; 25 26 pythonImportsCheck = [ "takethetime" ]; 27 28 # Latest release is v0.3.1 on pypi, but this version was not bumped in 29 # the setup.py, causing packages that depend on v0.3.1 to fail to build. 30 postPatch = '' 31 substituteInPlace setup.py \ 32 --replace "version='0.3'" "version='0.3.1'" 33 ''; 34 35 meta = with lib; { 36 description = "Simple time taking library using context managers"; 37 homepage = "https://github.com/ErikBjare/TakeTheTime"; 38 maintainers = with maintainers; [ huantian ]; 39 license = licenses.mit; 40 }; 41}