1{
2 lib,
3 buildPythonPackage,
4 django,
5 fetchFromGitHub,
6 hatchling,
7 pyhamcrest,
8 python,
9 pythonOlder,
10 setuptools,
11 setuptools-scm,
12}:
13
14buildPythonPackage rec {
15 pname = "django-currentuser";
16 version = "0.9.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "zsoldosp";
23 repo = "django-currentuser";
24 tag = "v${version}";
25 hash = "sha256-pfgsVsWM/aehZZAQzjL1fdsqWlfnquOniu76UoLPREI=";
26 };
27
28 build-system = [
29 setuptools
30 setuptools-scm
31 ];
32
33 dependencies = [ django ];
34
35 nativeCheckInputs = [ pyhamcrest ];
36
37 preCheck = ''
38 DJANGO_SETTINGS_MODULE="settings"
39 PYTHONPATH="tests:$PYTHONPATH"
40 '';
41
42 checkPhase = ''
43 runHook preCheck
44 ${python.interpreter} manage.py test testapp
45 runHook postCheck
46 '';
47
48 meta = with lib; {
49 description = "Conveniently store reference to request user on thread/db level";
50 homepage = "https://github.com/zsoldosp/django-currentuser";
51 changelog = "https://github.com/zsoldosp/django-currentuser/#release-notes";
52 license = licenses.bsd3;
53 maintainers = with maintainers; [ augustebaum ];
54 };
55}