summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-markdownify/default.nix
blob: 7e48c9b194482fba15fadf7e6ea33cc399562075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
  buildPythonPackage,
  django,
  fetchFromGitHub,
  lib,
  pytest-django,
  pytestCheckHook,
  setuptools,
  markdown,
  bleach,
  tinycss2,
}:
buildPythonPackage (finalAttrs: {
  pname = "django-markdownify";
  version = "0.9.7";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "erwinmatijsen";
    repo = "django-markdownify";
    tag = finalAttrs.version;
    hash = "sha256-Zl6t/ja/VAYrVOM6xkjcayn+vCss6JLQr+vBGsGGp+k=";
  };

  build-system = [ setuptools ];

  dependencies = [
    django
    markdown
    bleach
  ]
  ++ bleach.optional-dependencies.css;

  preCheck = ''
    export DJANGO_SETTINGS_MODULE=markdownify.checks
  '';

  nativeCheckInputs = [
    tinycss2
    pytest-django
    pytestCheckHook
  ];

  pythonImportsCheck = [ "markdownify" ];

  disabledTests = [
    # Test settings didn't setup DjangoTemplates
    "test_markdownify_nodelist"
  ];

  meta = {
    description = "Markdown template filter for Django";
    homepage = "https://github.com/erwinmatijsen/django-markdownify";
    changelog = "https://github.com/erwinmatijsen/django-markdownify/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ kurogeek ];
  };
})