From 896e08ac0fb3091666565eb837389d0c017f1308 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 21 Mar 2024 08:27:00 +0100 Subject: python311Packages.maya: refactor --- pkgs/development/python-modules/maya/default.nix | 37 ++++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/maya/default.nix b/pkgs/development/python-modules/maya/default.nix index e96d66826583..ec709741ab09 100644 --- a/pkgs/development/python-modules/maya/default.nix +++ b/pkgs/development/python-modules/maya/default.nix @@ -1,30 +1,28 @@ { lib -, fetchFromGitHub , buildPythonPackage - -# build-system -, setuptools - -# dependencies , dateparser +, fetchFromGitHub +, freezegun , humanize -, tzlocal , pendulum -, snaptime -, pytz - -# tests -, freezegun +, pytest-mock , pytestCheckHook +, pythonOlder +, pytz +, setuptools +, snaptime +, tzlocal }: buildPythonPackage rec { pname = "maya"; version = "0.6.1"; - format = "pyproject"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { - owner = "kennethreitz"; + owner = "timofurrer"; repo = "maya"; rev = "refs/tags/v${version}"; hash = "sha256-4fUyUqVQk/AcQL3xMnU1cQlF5yiD/N9NPAsUPuDTTNY="; @@ -33,7 +31,7 @@ buildPythonPackage rec { postPatch = '' # function was made private in humanize substituteInPlace maya/core.py \ - --replace "humanize.time.abs_timedelta" "humanize.time._abs_timedelta" + --replace-fail "humanize.time.abs_timedelta" "humanize.time._abs_timedelta" ''; nativeBuildInputs = [ @@ -51,12 +49,19 @@ buildPythonPackage rec { nativeCheckInputs = [ freezegun + pytest-mock pytestCheckHook ]; + pythonImportsCheck = [ + "maya" + ]; + meta = with lib; { description = "Datetimes for Humans"; - homepage = "https://github.com/kennethreitz/maya"; + homepage = "https://github.com/timofurrer/maya"; + changelog = "https://github.com/timofurrer/maya/releases/tag/v${version}"; license = licenses.mit; + maintainers = with maintainers; [ ]; }; } -- cgit 1.4.1 From 7370c06ed6b3a9c23ad67881e39e99cde8860c82 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 21 Mar 2024 15:25:50 +0100 Subject: python312Packages.maya: disable failing tests --- pkgs/development/python-modules/maya/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/maya/default.nix b/pkgs/development/python-modules/maya/default.nix index ec709741ab09..96387c8f2575 100644 --- a/pkgs/development/python-modules/maya/default.nix +++ b/pkgs/development/python-modules/maya/default.nix @@ -57,6 +57,11 @@ buildPythonPackage rec { "maya" ]; + disabledTests = [ + # https://github.com/timofurrer/maya/issues/202 + "test_parse_iso8601" + ]; + meta = with lib; { description = "Datetimes for Humans"; homepage = "https://github.com/timofurrer/maya"; -- cgit 1.4.1