summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-cryptography/default.nix
blob: 10c3810b22693aef7b7e5448b55c98b76ced5b7b (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
59
60
{
  buildPythonPackage,
  cryptography,
  django,
  django-appconf,
  fetchFromGitHub,
  lib,
  pytestCheckHook,
  pytest-django,
  setuptools,
}:

buildPythonPackage {
  pname = "django-cryptography";
  version = "1.1-unstable-2024-02-16";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "georgemarshall";
    repo = "django-cryptography";
    rev = "a5cde9beed707a14a2ef2f1f7f1fee172feb8b5e";
    hash = "sha256-Xj/fw8EapsYvVbZPRQ81yeE9QpIQ1TIuk+ASOCGh/Uc=";
  };

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace-fail "packages = django_cryptography" "packages = find:"
  '';

  build-system = [ setuptools ];

  dependencies = [
    cryptography
    django
    django-appconf
  ];

  pythonImportsCheck = [ "django_cryptography" ];

  nativeCheckInputs = [
    pytest-django
    pytestCheckHook
  ];

  preCheck = ''
    export DJANGO_SETTINGS_MODULE=tests.settings
  '';

  disabledTests = [
    # self.assertEqual(len(errors), 1) - AssertionError: 0 != 1
    "test_field_checks"
  ];

  meta = {
    homepage = "https://github.com/georgemarshall/django-cryptography";
    description = "Set of primitives for performing cryptography in Django";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ centromere ];
  };
}