2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2020-12-07 07:45:13 +00:00
|
|
|
, pythonOlder
|
2021-12-19 01:06:50 +00:00
|
|
|
, pythonAtLeast
|
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2021-07-04 02:40:35 +00:00
|
|
|
, python-dateutil
|
2021-02-19 19:06:45 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "freezegun";
|
2021-02-19 19:06:45 +00:00
|
|
|
version = "1.1.0";
|
2020-12-07 07:45:13 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-02-19 19:06:45 +00:00
|
|
|
sha256 = "177f9dd59861d871e27a484c3332f35a6e3f5d14626f2bf91be37891f18927f3";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
patches = lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
# Staticmethods in 3.10+ are now callable, prevent freezegun to attempt to decorate them
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/spulec/freezegun/pull/397/commits/e63874ce75a74a1159390914045fe8e7955b24c4.patch";
|
|
|
|
sha256 = "sha256-FNABqVN5DFqVUR88lYzwbfsZj3xcB9/MvQtm+I2VjnI=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-07-04 02:40:35 +00:00
|
|
|
propagatedBuildInputs = [ python-dateutil ];
|
2021-02-19 19:06:45 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "FreezeGun: Let your Python tests travel through time";
|
|
|
|
homepage = "https://github.com/spulec/freezegun";
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|