python311Packages.maya: fix build, reformat
make compatible with recent humanize versions, through access of the private _abs_timedelta function. Enable tests.
This commit is contained in:
parent
aadcf41da0
commit
64358475b7
1 changed files with 45 additions and 15 deletions
|
@ -1,28 +1,58 @@
|
||||||
{ lib, fetchPypi, fetchpatch, buildPythonPackage
|
{ lib
|
||||||
, dateparser, humanize, pendulum, ruamel-yaml, tzlocal }:
|
, fetchFromGitHub
|
||||||
|
, buildPythonPackage
|
||||||
|
|
||||||
|
# build-system
|
||||||
|
, setuptools
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
, dateparser
|
||||||
|
, humanize
|
||||||
|
, tzlocal
|
||||||
|
, pendulum
|
||||||
|
, snaptime
|
||||||
|
, pytz
|
||||||
|
|
||||||
|
# tests
|
||||||
|
, freezegun
|
||||||
|
, pytestCheckHook
|
||||||
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "maya";
|
pname = "maya";
|
||||||
version = "0.6.1";
|
version = "0.6.1";
|
||||||
|
format = "pyproject";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchFromGitHub {
|
||||||
inherit pname version;
|
owner = "kennethreitz";
|
||||||
sha256 = "sha256-f1PgbVoSNhPc58Jwy8ZHZDppQlkNunoZ7DYZTQM4w/Q=";
|
repo = "maya";
|
||||||
|
rev = "refs/tags/v${version}";
|
||||||
|
hash = "sha256-4fUyUqVQk/AcQL3xMnU1cQlF5yiD/N9NPAsUPuDTTNY=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
postPatch = ''
|
||||||
(fetchpatch {
|
# function was made private in humanize
|
||||||
# https://github.com/kennethreitz/maya/issues/112
|
substituteInPlace maya/core.py \
|
||||||
# Merged, so should be in next release.
|
--replace "humanize.time.abs_timedelta" "humanize.time._abs_timedelta"
|
||||||
url = "https://github.com/kennethreitz/maya/commit/f69a93b1103130139cdec30511777823957fb659.patch";
|
'';
|
||||||
sha256 = "152ba7amv9dhhx1wcklfalsdzsxggik9f7rsrikms921lq9xqc8h";
|
|
||||||
})
|
nativeBuildInputs = [
|
||||||
|
setuptools
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [ dateparser humanize pendulum ruamel-yaml tzlocal ];
|
propagatedBuildInputs = [
|
||||||
|
dateparser
|
||||||
|
humanize
|
||||||
|
pendulum
|
||||||
|
pytz
|
||||||
|
snaptime
|
||||||
|
tzlocal
|
||||||
|
];
|
||||||
|
|
||||||
# No tests
|
nativeCheckInputs = [
|
||||||
doCheck = false;
|
freezegun
|
||||||
|
pytestCheckHook
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Datetimes for Humans";
|
description = "Datetimes for Humans";
|
||||||
|
|
Loading…
Reference in a new issue