2024-02-29 20:09:43 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, poetry-core
|
|
|
|
, backports-zoneinfo
|
|
|
|
, tzdata
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-mypy-plugins
|
|
|
|
, hypothesis
|
|
|
|
, freezegun
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "whenever";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.5.2";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ariebovenberg";
|
|
|
|
repo = "whenever";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-bG8LV+r5MjA1JwBHWy9/Io4daldAlyEGYNLW+5ITuOw=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# unrecognized arguments since we don't use pytest-benchmark in nixpkgs
|
|
|
|
substituteInPlace pytest.ini \
|
|
|
|
--replace-fail '--benchmark-disable' '#--benchmark-disable'
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2024-02-29 20:09:43 +00:00
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2024-02-29 20:09:43 +00:00
|
|
|
tzdata
|
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
backports-zoneinfo
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-mypy-plugins
|
|
|
|
hypothesis
|
|
|
|
freezegun
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"whenever"
|
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
# early TDD, many tests are failing
|
|
|
|
# TODO: try enabling on bump
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Strict, predictable, and typed datetimes";
|
|
|
|
homepage = "https://github.com/ariebovenberg/whenever";
|
|
|
|
changelog = "https://github.com/ariebovenberg/whenever/blob/${src.rev}/CHANGELOG.rst";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ pbsds ];
|
|
|
|
};
|
|
|
|
}
|