summary refs log tree commit diff
path: root/pkgs/applications/office/paperless/python-modules/django-crispy-forms.nix
blob: 465da3862471754a95bbfa5a1c5d014269bf8857 (plain) (blame)
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
{ lib, buildPythonPackage, fetchFromGitHub
, pytest_4, pytest-django, django }:

buildPythonPackage {
  pname = "django-crispy-forms";
  version = "2019.04.21";

  src = fetchFromGitHub {
    owner = "django-crispy-forms";
    repo = "django-crispy-forms";
    rev = "e25a5326697e5b545689b3a914e516404a6911bb";
    sha256 = "12zqa76q6i7j47aqvhilivpbdplgp9zw2q8zfcjzlgclrqafaj39";
  };

  # For reasons unknown, the source dir must contain a dash
  # for the tests to run successfully
  postUnpack = ''
    mv $sourceRoot source-
    export sourceRoot=source-
  '';

  checkInputs = [ pytest_4 pytest-django django ];

  checkPhase = ''
    PYTHONPATH="$(pwd):$PYTHONPATH" \
    DJANGO_SETTINGS_MODULE=crispy_forms.tests.test_settings \
      pytest crispy_forms/tests
  '';

  meta = with lib; {
    description = "The best way to have DRY Django forms";
    homepage = https://github.com/maraujop/django-crispy-forms;
    license = licenses.mit;
    maintainers = with maintainers; [ earvstedt ];
  };
}