anki-bin: 24.06.3 -> 24.11 (#360722)
[NixPkgs.git] / pkgs / development / python-modules / pelican / default.nix
blobb6b03a7714ea35fe47fbbdda471f41006c7b796e
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   pythonOlder,
7   # build-system
8   pdm-backend,
10   # native dependencies
11   glibcLocales,
12   git,
13   pandoc,
14   typogrify,
16   # dependencies
17   blinker,
18   docutils,
19   feedgenerator,
20   jinja2,
21   markdown,
22   ordered-set,
23   pygments,
24   python-dateutil,
25   rich,
26   tzdata,
27   unidecode,
28   watchfiles,
30   # tests
31   beautifulsoup4,
32   lxml,
33   mock,
34   pytestCheckHook,
35   pytest-xdist,
38 buildPythonPackage rec {
39   pname = "pelican";
40   version = "4.10.1";
41   pyproject = true;
43   disabled = pythonOlder "3.8";
45   src = fetchFromGitHub {
46     owner = "getpelican";
47     repo = "pelican";
48     rev = "refs/tags/${version}";
49     hash = "sha256-RWzOMp3H0QbZyGsXd8cakeRqZhVH7d6ftxZHBA4cPSA=";
50     # Remove unicode file names which leads to different checksums on HFS+
51     # vs. other filesystems because of unicode normalisation.
52     postFetch = ''
53       rm -r $out/pelican/tests/output/custom_locale/posts
54     '';
55   };
57   postPatch = ''
58     substituteInPlace pelican/tests/test_pelican.py \
59       --replace "'git'" "'${git}/bin/git'"
60   '';
62   build-system = [ pdm-backend ];
64   pythonRelaxDeps = [ "unidecode" ];
66   buildInputs = [
67     glibcLocales
68     pandoc
69     git
70     markdown
71     typogrify
72   ];
74   dependencies = [
75     blinker
76     docutils
77     feedgenerator
78     jinja2
79     ordered-set
80     pygments
81     python-dateutil
82     rich
83     tzdata
84     unidecode
85     watchfiles
86   ];
88   optional-dependencies = {
89     markdown = [ markdown ];
90   };
92   nativeCheckInputs = [
93     beautifulsoup4
94     lxml
95     mock
96     pandoc
97     pytest-xdist
98     pytestCheckHook
99   ];
101   pytestFlagsArray = [
102     # DeprecationWarning: 'jinja2.Markup' is deprecated and...
103     "-W ignore::DeprecationWarning"
104   ];
106   disabledTests = [
107     # AssertionError
108     "test_basic_generation_works"
109     "test_custom_generation_works"
110     "test_custom_locale_generation_works"
111     "test_deprecated_attribute"
112     # AttributeError
113     "test_wp_custpost_true_dirpage_false"
114     "test_can_toggle_raw_html_code_parsing"
115     "test_dirpage_directive_for_page_kind"
116   ];
118   env.LC_ALL = "en_US.UTF-8";
120   # We only want to patch shebangs in /bin, and not those
121   # of the project scripts that are created by Pelican.
122   # See https://github.com/NixOS/nixpkgs/issues/30116
123   dontPatchShebangs = true;
125   postFixup = ''
126     patchShebangs $out/bin
127   '';
129   pythonImportsCheck = [ "pelican" ];
131   meta = with lib; {
132     description = "Static site generator that requires no database or server-side logic";
133     homepage = "https://getpelican.com/";
134     changelog = "https://github.com/getpelican/pelican/blob/${version}/docs/changelog.rst";
135     license = licenses.agpl3Only;
136     maintainers = with maintainers; [
137       offline
138       prikhi
139     ];
140   };