python3Packages.maya: 0.3.3 -> 0.6.1

This commit is contained in:
Peder Bergebakken Sundt 2023-09-23 01:36:27 +02:00
parent 6226c4ac22
commit f95ce22df6

View File

@ -1,32 +1,58 @@
{ lib, fetchPypi, fetchpatch, buildPythonPackage
, dateparser, humanize, pendulum, ruamel-yaml, tzlocal }:
{ lib
, fetchFromGitHub
, fetchpatch
, buildPythonPackage
, dateparser
, humanize
, pendulum
, pytz
, snaptime
, tzlocal
, pytestCheckHook
, freezegun
, pytest-mock
}:
buildPythonPackage rec {
pname = "maya";
version = "0.3.3";
version = "0.6.1";
src = fetchPypi {
inherit pname version;
sha256 = "1x88k4irpckvd7jf2yvqjw1s52hjqbxym1r1d928yb3fkj7rvlxs";
src = fetchFromGitHub {
owner = "kennethreitz";
repo = "maya";
rev = "refs/tags/v${version}";
hash = "sha256-4fUyUqVQk/AcQL3xMnU1cQlF5yiD/N9NPAsUPuDTTNY=";
};
patches = [
(fetchpatch {
# https://github.com/kennethreitz/maya/issues/112
# Merged, so should be in next release.
url = "https://github.com/kennethreitz/maya/commit/f69a93b1103130139cdec30511777823957fb659.patch";
sha256 = "152ba7amv9dhhx1wcklfalsdzsxggik9f7rsrikms921lq9xqc8h";
})
# fix humanize incompatibility
# https://github.com/timofurrer/maya/commit/d9cd563d1b1ba16bcff4dacb4ef49edd4e32fd1d.patch
# ^ does not apply on 0.6.1
postPatch = ''
substituteInPlace maya/core.py \
--replace \
"humanize.time.abs_timedelta" \
"humanize.time._abs_timedelta"
'';
propagatedBuildInputs = [
dateparser
humanize
pendulum
pytz
snaptime
tzlocal
];
propagatedBuildInputs = [ dateparser humanize pendulum ruamel-yaml tzlocal ];
# No tests
doCheck = false;
nativeCheckInputs = [
pytestCheckHook
freezegun
pytest-mock
];
meta = with lib; {
description = "Datetimes for Humans";
homepage = "https://github.com/kennethreitz/maya";
license = licenses.mit;
maintainers = with maintainers; [ pbsds ];
};
}