2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
backports-zoneinfo,
|
|
|
|
python-dateutil,
|
|
|
|
pytestCheckHook,
|
2021-08-08 23:34:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "time-machine";
|
2024-07-31 10:19:44 +00:00
|
|
|
version = "2.14.2";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-08-08 23:34:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "adamchainz";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-07-31 10:19:44 +00:00
|
|
|
hash = "sha256-u5RxNv+hsL+0yxtiWeYHtmMQY7bvb8WY7ipouj+IZJ8=";
|
2021-08-08 23:34:03 +00:00
|
|
|
};
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
dependencies = [
|
2021-08-08 23:34:03 +00:00
|
|
|
python-dateutil
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [ backports-zoneinfo ];
|
2021-08-08 23:34:03 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-08-08 23:34:03 +00:00
|
|
|
|
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.9") [
|
2024-01-13 08:15:51 +00:00
|
|
|
# https://github.com/adamchainz/time-machine/issues/405
|
|
|
|
"test_destination_string_naive"
|
2021-08-08 23:34:03 +00:00
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "time_machine" ];
|
2021-08-08 23:34:03 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/adamchainz/time-machine/blob/${src.rev}/CHANGELOG.rst";
|
2021-08-08 23:34:03 +00:00
|
|
|
description = "Travel through time in your tests";
|
|
|
|
homepage = "https://github.com/adamchainz/time-machine";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|