summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-parler/default.nix
blob: 2b64c0131d2b4bc1ac29bcd1f557ac5735b824a8 (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
{
  lib,
  buildPythonPackage,
  django,
  fetchFromGitHub,
  python,
  setuptools,
}:

buildPythonPackage rec {
  pname = "django-parler";
  version = "2.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "django-parler";
    repo = "django-parler";
    tag = "v${version}";
    hash = "sha256-tRGifFPCXF3aa3PQWKw3tl1H1TY+lgcChUP1VdwG1cE=";
  };

  build-system = [ setuptools ];

  dependencies = [ django ];

  # Disable failing test: article.tests.AdminArticleTestCase.test_admin_add
  # AssertionError: '<h1>Ajout de Article (Hollandais)</h1>' not found in ...
  # https://github.com/django-parler/django-parler/issues/358
  preCheck = lib.optionalString (lib.versionAtLeast django.version "5.0") ''
    rm example/article/tests.py
  '';

  checkPhase = ''
    runHook preCheck
    ${python.interpreter} runtests.py
    runHook postCheck
  '';

  meta = {
    description = "Simple Django model translations without nasty hacks";
    homepage = "https://github.com/django-parler/django-parler";
    changelog = "https://github.com/django-parler/django-parler/releases/tag/v${version}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ derdennisop ];
  };
}