2021-08-08 23:34:03 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
|
|
|
, backports-zoneinfo
|
|
|
|
, python-dateutil
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "time-machine";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.12.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-08-08 23:34:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "adamchainz";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-vBww78/3vC3IA4Nh9Ne+rBo/CO9FggjP+TUUV2/ih9c=";
|
2021-08-08 23:34:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
python-dateutil
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
2021-08-08 23:34:03 +00:00
|
|
|
backports-zoneinfo
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-08-08 23:34:03 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.9") [
|
|
|
|
# Assertion Errors related to Africa/Addis_Ababa
|
|
|
|
"test_destination_datetime_tzinfo_zoneinfo_nested"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_destination_datetime_tzinfo_zoneinfo_no_orig_tz"
|
|
|
|
"test_destination_datetime_tzinfo_zoneinfo"
|
2021-08-08 23:34:03 +00:00
|
|
|
"test_move_to_datetime_with_tzinfo_zoneinfo"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"time_machine"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Travel through time in your tests";
|
|
|
|
homepage = "https://github.com/adamchainz/time-machine";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|