2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-12-19 01:06:50 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2021-02-19 19:06:45 +00:00
|
|
|
, pytestCheckHook
|
2022-04-27 09:35:20 +00:00
|
|
|
, python-dateutil
|
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "freezegun";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "1.2.2";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-zSLRugaUE4RBDNln2KmdWuJEL1ffr+/y/aXejcXAVEY=";
|
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";
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-FNABqVN5DFqVUR88lYzwbfsZj3xcB9/MvQtm+I2VjnI=";
|
2021-12-19 01:06:50 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
python-dateutil
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"freezegun"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-04-27 09:35:20 +00:00
|
|
|
description = "Library that allows your Python tests to travel through time";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/spulec/freezegun";
|
|
|
|
license = licenses.asl20;
|
2022-04-27 09:35:20 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|