1{ lib
2, astral
3, buildPythonPackage
4, fetchFromGitHub
5, poetry-core
6, pytestCheckHook
7, pythonOlder
8, pytz
9}:
10
11buildPythonPackage rec {
12 pname = "hdate";
13 version = "0.10.4";
14 format = "pyproject";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "py-libhdate";
20 repo = "py-libhdate";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-NF2ZA9ruW7sL2tLY11VAtyPRxGg2o5/mpv3ZsH/Zxb8=";
23 };
24
25 postPatch = ''
26 substituteInPlace pyproject.toml \
27 --replace 'pytz = ">= 2020.0"' 'pytz = "*"' \
28 --replace 'astral = {version = "^2.2", python = "^3.6"}' 'astral = "*"'
29 '';
30
31 nativeBuildInputs = [
32 poetry-core
33 ];
34
35 propagatedBuildInputs = [
36 astral
37 pytz
38 ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 ];
43
44 pytestFlagsArray = [
45 "tests"
46 ];
47
48 pythonImportsCheck = [
49 "hdate"
50 ];
51
52 meta = with lib; {
53 description = "Python module for Jewish/Hebrew date and Zmanim";
54 homepage = "https://github.com/py-libhdate/py-libhdate";
55 changelog = "https://github.com/py-libhdate/py-libhdate/releases/tag/v${version}";
56 license = with licenses; [ gpl3Plus ];
57 maintainers = with maintainers; [ fab ];
58 };
59}