1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 poetry-core,
9
10 # dependencies
11 django,
12
13 # optionals
14 bleach,
15 docutils,
16 markdown,
17 pygments,
18 python-creole,
19 smartypants,
20 textile,
21
22 # tests
23 pytest-cov-stub,
24 pytest-django,
25 pytestCheckHook,
26}:
27
28buildPythonPackage rec {
29 pname = "django-markup";
30 version = "1.10";
31 pyproject = true;
32
33 disabled = pythonOlder "3.8";
34
35 src = fetchFromGitHub {
36 owner = "bartTC";
37 repo = "django-markup";
38 tag = "v${version}";
39 hash = "sha256-LcEbN5/LbY3xWellBVK2Kfvt/XLzRJjGWcEk8h722Og=";
40 };
41
42 build-system = [ poetry-core ];
43
44 dependencies = [ django ];
45
46 optional-dependencies = {
47 all_filter_dependencies = [
48 bleach
49 docutils
50 markdown
51 pygments
52 python-creole
53 smartypants
54 textile
55 ];
56 };
57
58 pythonImportsCheck = [ "django_markup" ];
59
60 nativeCheckInputs = [
61 pytest-cov-stub
62 pytest-django
63 pytestCheckHook
64 ]
65 ++ optional-dependencies.all_filter_dependencies;
66
67 disabledTests = [
68 # pygments compat issue
69 "test_rst_with_pygments"
70 ];
71
72 preCheck = ''
73 export DJANGO_SETTINGS_MODULE=django_markup.tests
74 '';
75
76 meta = with lib; {
77 description = "Generic Django application to convert text with specific markup to html";
78 homepage = "https://github.com/bartTC/django-markup";
79 changelog = "https://github.com/bartTC/django-markup/blob/${src.tag}/CHANGELOG.md";
80 license = licenses.mit;
81 maintainers = with maintainers; [ hexa ];
82 };
83}