From 3f2965dc575c4f030d9426b1629faa4fd3ff2608 Mon Sep 17 00:00:00 2001 From: huantian Date: Wed, 7 Jun 2023 09:30:08 +0000 Subject: [PATCH] takethetime: fetch from PyPI and disable checks (#233694) Co-authored-by: Sandro --- .../python-modules/takethetime/default.nix | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/takethetime/default.nix b/pkgs/development/python-modules/takethetime/default.nix index e6f5dd93b29f..7bc914ed85db 100644 --- a/pkgs/development/python-modules/takethetime/default.nix +++ b/pkgs/development/python-modules/takethetime/default.nix @@ -1,37 +1,26 @@ { lib , buildPythonPackage -, fetchFromGitHub +, fetchPypi , pythonOlder -, pytestCheckHook }: -buildPythonPackage { +buildPythonPackage rec { pname = "takethetime"; version = "0.3.1"; - # pypi distribution doesn't include tests, so build from source instead - src = fetchFromGitHub { - owner = "ErikBjare"; - repo = "TakeTheTime"; - rev = "b0042ac5b1cc9d3b70ef59167b094469ceb660dd"; - sha256 = "sha256-DwsMnP6G3BzOnINttaSC6QKkIKK5qyhUz+lN1DSvkw0="; + src = fetchPypi { + pname = "TakeTheTime"; + inherit version; + sha256 = "sha256-2+MEU6G1lqOPni4/qOGtxa8tv2RsoIN61cIFmhb+L/k="; }; disabled = pythonOlder "3.6"; - nativeCheckInputs = [ pytestCheckHook ]; - - pytestFlagsArray = [ "tests/tests.py" ]; + # all tests are timing dependent + doCheck = false; pythonImportsCheck = [ "takethetime" ]; - # Latest release is v0.3.1 on pypi, but this version was not bumped in - # the setup.py, causing packages that depend on v0.3.1 to fail to build. - postPatch = '' - substituteInPlace setup.py \ - --replace "version='0.3'" "version='0.3.1'" - ''; - meta = with lib; { description = "Simple time taking library using context managers"; homepage = "https://github.com/ErikBjare/TakeTheTime";