about summary refs log tree commit diff
path: root/pkgs/development/python-modules/hdate
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-04-25 23:49:55 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2021-05-06 23:55:57 +0200
commit540f69e705aa47178716a1784d38fec196455e11 (patch)
tree3ab1456a852d7b05b7bb66daefaaeae15791ebad /pkgs/development/python-modules/hdate
parent4fac78928cadf2cf4eb0bc576465442463b93479 (diff)
python3Packages.hdate: init 0.10.2
Diffstat (limited to 'pkgs/development/python-modules/hdate')
-rw-r--r--pkgs/development/python-modules/hdate/default.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/hdate/default.nix b/pkgs/development/python-modules/hdate/default.nix
new file mode 100644
index 0000000000000..a034eddd56517
--- /dev/null
+++ b/pkgs/development/python-modules/hdate/default.nix
@@ -0,0 +1,63 @@
+{ lib
+, astral
+, buildPythonPackage
+, fetchFromGitHub
+, fetchpatch
+, poetry-core
+, pytestCheckHook
+, pythonOlder
+, pytz
+}:
+
+buildPythonPackage rec {
+  pname = "hdate";
+  version = "0.10.2";
+  disabled = pythonOlder "3.6";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "py-libhdate";
+    repo = "py-libhdate";
+    rev = "v${version}";
+    sha256 = "07b0c7q8w6flj4q72v58d3wymsxfp5qz8z97qhhc2977mjx5fsxd";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    astral
+    pytz
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  patches = [
+    # Version was not updated for the release
+    (fetchpatch {
+      name = "update-version.patch";
+      url = "https://github.com/py-libhdate/py-libhdate/commit/b8186a891b29fed99def5ce0985ee0ae1e0dd77e.patch";
+      sha256 = "1pmhgh57x9390ff5gyisng0l6b79sd6dxmf172hpk1gr03c3hv98";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace pyproject.toml --replace "^2020.5" ">=2020.5"
+  '';
+
+  pytestFlagsArray = [
+    "tests"
+  ];
+
+  pythonImportsCheck = [ "hdate" ];
+
+  meta = with lib; {
+    description = "Python module for Jewish/Hebrew date and Zmanim";
+    homepage = "https://github.com/py-libhdate/py-libhdate";
+    license = with licenses; [ gpl3Plus ];
+    maintainers = with maintainers; [ fab ];
+  };
+}