2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
, setuptools
|
|
|
|
|
|
|
|
# dependencies
|
2023-10-09 19:29:22 +00:00
|
|
|
, dateparser
|
|
|
|
, humanize
|
2023-11-16 04:20:00 +00:00
|
|
|
, tzlocal
|
2023-10-09 19:29:22 +00:00
|
|
|
, pendulum
|
|
|
|
, snaptime
|
2023-11-16 04:20:00 +00:00
|
|
|
, pytz
|
|
|
|
|
|
|
|
# tests
|
2023-10-09 19:29:22 +00:00
|
|
|
, freezegun
|
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
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "maya";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.6.1";
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kennethreitz";
|
|
|
|
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 \
|
2023-11-16 04:20:00 +00:00
|
|
|
--replace "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
|
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
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Datetimes for Humans";
|
|
|
|
homepage = "https://github.com/kennethreitz/maya";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|