1{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch, pythonOlder
2, six, typing, pygments
3, django, shortuuid, python-dateutil, pytest
4, pytest-django, pytestcov, mock, vobject
5, werkzeug, glibcLocales, factory_boy
6}:
7
8buildPythonPackage rec {
9 pname = "django-extensions";
10 version = "2.2.5";
11
12 src = fetchFromGitHub {
13 owner = pname;
14 repo = pname;
15 rev = version;
16 sha256 = "0053yqq4vq3mwy7zkfs5vfm3g8j9sfy3vrc6xby83qlj9wz43ipi";
17 };
18
19 # This patch fixes a single failing test and can be removed when updating this pkg
20 # to the next version
21 patches = [
22 (fetchpatch {
23 url = "https://github.com/django-extensions/django-extensions/commit/1d21786da2e6868d98ae34c82079e1e03ad1aa97.patch";
24 sha256 = "0d81zpj0f8a7ijrfb12j0b67fgj89k3axaskz1nwqsr4wc6n4bw2";
25 })
26 ];
27
28 postPatch = ''
29 substituteInPlace setup.py --replace "'tox'," ""
30
31 # not yet pytest 5 compatible?
32 rm tests/management/commands/test_set_fake_emails.py
33 rm tests/management/commands/test_set_fake_passwords.py
34 rm tests/management/commands/test_validate_templates.py
35
36 # pip should not be used during tests...
37 rm tests/management/commands/test_pipchecker.py
38 '';
39
40 propagatedBuildInputs = [ six ] ++ lib.optional (pythonOlder "3.5") typing;
41
42 checkInputs = [
43 django shortuuid python-dateutil pytest
44 pytest-django pytestcov mock vobject
45 werkzeug glibcLocales factory_boy pygments
46 ];
47
48 LC_ALL = "en_US.UTF-8";
49
50 meta = with lib; {
51 description = "A collection of custom extensions for the Django Framework";
52 homepage = https://github.com/django-extensions/django-extensions;
53 license = licenses.mit;
54 };
55}