2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, dateparser
|
2024-04-21 15:54:59 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, freezegun
|
2023-10-09 19:29:22 +00:00
|
|
|
, humanize
|
|
|
|
, pendulum
|
2024-04-21 15:54:59 +00:00
|
|
|
, pytest-mock
|
2023-11-16 04:20:00 +00:00
|
|
|
, pytestCheckHook
|
2024-04-21 15:54:59 +00:00
|
|
|
, pythonOlder
|
|
|
|
, pytz
|
|
|
|
, setuptools
|
|
|
|
, snaptime
|
|
|
|
, tzlocal
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "maya";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.6.1";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
owner = "timofurrer";
|
2023-10-09 19:29:22 +00:00
|
|
|
repo = "maya";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-4fUyUqVQk/AcQL3xMnU1cQlF5yiD/N9NPAsUPuDTTNY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
# function was made private in humanize
|
2023-10-09 19:29:22 +00:00
|
|
|
substituteInPlace maya/core.py \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "humanize.time.abs_timedelta" "humanize.time._abs_timedelta"
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
dateparser
|
|
|
|
humanize
|
|
|
|
pendulum
|
|
|
|
pytz
|
|
|
|
snaptime
|
|
|
|
tzlocal
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
freezegun
|
2024-04-21 15:54:59 +00:00
|
|
|
pytest-mock
|
2023-11-16 04:20:00 +00:00
|
|
|
pytestCheckHook
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"maya"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# https://github.com/timofurrer/maya/issues/202
|
|
|
|
"test_parse_iso8601"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Datetimes for Humans";
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://github.com/timofurrer/maya";
|
|
|
|
changelog = "https://github.com/timofurrer/maya/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|