@@ -0,0 +1,63 @@
1+{ lib
2+, astral
3+, buildPythonPackage
4+, fetchFromGitHub
5+, fetchpatch
6+, poetry-core
7+, pytestCheckHook
8+, pythonOlder
9+, pytz
10+}:
11+
12+buildPythonPackage rec {
13+ pname = "hdate";
14+ version = "0.10.2";
15+ disabled = pythonOlder "3.6";
16+ format = "pyproject";
17+
18+ src = fetchFromGitHub {
19+ owner = "py-libhdate";
20+ repo = "py-libhdate";
21+ rev = "v${version}";
22+ sha256 = "07b0c7q8w6flj4q72v58d3wymsxfp5qz8z97qhhc2977mjx5fsxd";
23+ };
24+
25+ nativeBuildInputs = [
26+ poetry-core
27+ ];
28+
29+ propagatedBuildInputs = [
30+ astral
31+ pytz
32+ ];
33+
34+ checkInputs = [
35+ pytestCheckHook
36+ ];
37+
38+ patches = [
39+ # Version was not updated for the release
40+ (fetchpatch {
41+ name = "update-version.patch";
42+ url = "https://github.com/py-libhdate/py-libhdate/commit/b8186a891b29fed99def5ce0985ee0ae1e0dd77e.patch";
43+ sha256 = "1pmhgh57x9390ff5gyisng0l6b79sd6dxmf172hpk1gr03c3hv98";
44+ })
45+ ];
46+
47+ postPatch = ''
48+ substituteInPlace pyproject.toml --replace "^2020.5" ">=2020.5"
49+ '';
50+
51+ pytestFlagsArray = [
52+ "tests"
53+ ];
54+
55+ pythonImportsCheck = [ "hdate" ];
56+
57+ meta = with lib; {
58+ description = "Python module for Jewish/Hebrew date and Zmanim";
59+ homepage = "https://github.com/py-libhdate/py-libhdate";
60+ license = with licenses; [ gpl3Plus ];
61+ maintainers = with maintainers; [ fab ];
62+ };
63+}