1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonAtLeast,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 django,
12
13 # tests
14 factory-boy,
15 mock,
16 pip,
17 pygments,
18 pytestCheckHook,
19 pytest-django,
20 shortuuid,
21 vobject,
22 werkzeug,
23}:
24
25buildPythonPackage rec {
26 pname = "django-extensions";
27 version = "3.2.3";
28 pyproject = true;
29
30 # https://github.com/django-extensions/django-extensions/issues/1831
31 # Requires asyncore, which was dropped in 3.12
32 disabled = pythonAtLeast "3.12";
33
34 src = fetchFromGitHub {
35 owner = pname;
36 repo = pname;
37 rev = "refs/tags/${version}";
38 hash = "sha256-A2+5FBv0IhTJPkwgd7je+B9Ac64UHJEa3HRBbWr2FxM=";
39 };
40
41 postPatch = ''
42 substituteInPlace setup.cfg \
43 --replace "--cov=django_extensions --cov-report html --cov-report term" ""
44 '';
45
46 build-system = [ setuptools ];
47
48 dependencies = [ django ];
49
50 __darwinAllowLocalNetworking = true;
51
52 nativeCheckInputs = [
53 factory-boy
54 mock
55 pip
56 pygments # not explicitly declared in setup.py, but some tests require it
57 pytest-django
58 pytestCheckHook
59 shortuuid
60 vobject
61 werkzeug
62 ];
63
64 disabledTestPaths = [
65 # requires network access
66 "tests/management/commands/test_pipchecker.py"
67 # django.db.utils.OperationalError: no such table: django_extensions_permmodel
68 "tests/test_dumpscript.py"
69 ];
70
71 meta = with lib; {
72 description = "A collection of custom extensions for the Django Framework";
73 homepage = "https://github.com/django-extensions/django-extensions";
74 license = licenses.mit;
75 };
76}