summary refs log tree commit diff
path: root/pkgs/development/python-modules/maya/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/maya/default.nix')
-rw-r--r--pkgs/development/python-modules/maya/default.nix62
1 files changed, 46 insertions, 16 deletions
diff --git a/pkgs/development/python-modules/maya/default.nix b/pkgs/development/python-modules/maya/default.nix
index baa95f7c7de..e96d6682658 100644
--- a/pkgs/development/python-modules/maya/default.nix
+++ b/pkgs/development/python-modules/maya/default.nix
@@ -1,28 +1,58 @@
-{ lib, fetchPypi, fetchpatch, buildPythonPackage
-, dateparser, humanize, pendulum, ruamel-yaml, tzlocal }:
+{ lib
+, fetchFromGitHub
+, buildPythonPackage
+
+# build-system
+, setuptools
+
+# dependencies
+, dateparser
+, humanize
+, tzlocal
+, pendulum
+, snaptime
+, pytz
+
+# tests
+, freezegun
+, pytestCheckHook
+}:
 
 buildPythonPackage rec {
   pname = "maya";
-  version = "0.3.3";
+  version = "0.6.1";
+  format = "pyproject";
 
-  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";
-    })
+  postPatch = ''
+    # function was made private in humanize
+    substituteInPlace maya/core.py \
+      --replace "humanize.time.abs_timedelta" "humanize.time._abs_timedelta"
+  '';
+
+  nativeBuildInputs = [
+    setuptools
   ];
 
-  propagatedBuildInputs = [ dateparser humanize pendulum ruamel-yaml tzlocal ];
+  propagatedBuildInputs = [
+    dateparser
+    humanize
+    pendulum
+    pytz
+    snaptime
+    tzlocal
+  ];
 
-  # No tests
-  doCheck = false;
+  nativeCheckInputs = [
+    freezegun
+    pytestCheckHook
+  ];
 
   meta = with lib; {
     description = "Datetimes for Humans";