1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# build-system
7, setuptools
8
9# l10n
10, polib
11, lingua
12, chameleon
13
14# dependencies
15, python-dateutil
16
17# tests
18, importlib-metadata
19, pytestCheckHook
20}:
21
22buildPythonPackage rec {
23 pname = "holidays";
24 version = "0.36";
25 pyproject = true;
26
27 disabled = pythonOlder "3.8";
28
29 src = fetchFromGitHub {
30 owner = "dr-prodigy";
31 repo = "python-holidays";
32 rev = "refs/tags/v${version}";
33 hash = "sha256-pYlirojeHi10kUcjcvpfBYpIzbYmIlFgOLfy7WRhACU=";
34 };
35
36 nativeBuildInputs = [
37 setuptools
38
39 # l10n
40 lingua
41 chameleon
42 polib
43 ];
44
45 postPatch = ''
46 patchShebangs scripts/l10n/*.py
47 '';
48
49 preBuild = ''
50 # make l10n
51 ./scripts/l10n/generate_po_files.py
52 ./scripts/l10n/generate_mo_files.py
53 '';
54
55 propagatedBuildInputs = [
56 python-dateutil
57 ];
58
59 doCheck = false;
60
61 nativeCheckInputs = [
62 importlib-metadata
63 polib
64 pytestCheckHook
65 ];
66
67 pythonImportsCheck = [
68 "holidays"
69 ];
70
71 disabledTests = [
72 # Failure starting with 0.24
73 "test_l10n"
74 ];
75
76 meta = with lib; {
77 description = "Generate and work with holidays in Python";
78 homepage = "https://github.com/dr-prodigy/python-holidays";
79 changelog = "https://github.com/dr-prodigy/python-holidays/releases/tag/v${version}";
80 license = licenses.mit;
81 maintainers = with maintainers; [ fab jluttine ];
82 };
83}
84