summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-currentuser/default.nix
blob: edee115866a81c86c9d7c9170d73f09e77dd14c3 (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
{
  lib,
  buildPythonPackage,
  django,
  fetchFromGitHub,
  hatchling,
  pyhamcrest,
  python,
  setuptools,
  setuptools-scm,
}:

buildPythonPackage rec {
  pname = "django-currentuser";
  version = "0.9.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "zsoldosp";
    repo = "django-currentuser";
    tag = "v${version}";
    hash = "sha256-pfgsVsWM/aehZZAQzjL1fdsqWlfnquOniu76UoLPREI=";
  };

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [ django ];

  nativeCheckInputs = [ pyhamcrest ];

  preCheck = ''
    DJANGO_SETTINGS_MODULE="settings"
    PYTHONPATH="tests:$PYTHONPATH"
  '';

  checkPhase = ''
    runHook preCheck
    ${python.interpreter} manage.py test testapp
    runHook postCheck
  '';

  meta = {
    description = "Conveniently store reference to request user on thread/db level";
    homepage = "https://github.com/zsoldosp/django-currentuser";
    changelog = "https://github.com/zsoldosp/django-currentuser/#release-notes";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ augustebaum ];
  };
}