1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 calmjs,
11 django-appconf,
12 jinja2,
13 rcssmin,
14 rjsmin,
15
16 # tests
17 beautifulsoup4,
18 brotli,
19 csscompressor,
20 django-sekizai,
21 pytestCheckHook,
22 pytest-django,
23
24}:
25
26buildPythonPackage rec {
27 pname = "django-compressor";
28 version = "4.5";
29 pyproject = true;
30
31 src = fetchPypi {
32 pname = "django_compressor";
33 inherit version;
34 hash = "sha256-nZjJBbdBvmywmtgowdIqn/kkTdCII+KSavjd0YccPGU=";
35 };
36
37 build-system = [
38 setuptools
39 ];
40
41 pythonRelaxDeps = [
42 "rcssmin"
43 "rjsmin"
44 ];
45
46 dependencies = [
47 beautifulsoup4
48 calmjs
49 django-appconf
50 jinja2
51 rcssmin
52 rjsmin
53 ];
54
55 env.DJANGO_SETTINGS_MODULE = "compressor.test_settings";
56
57 nativeCheckInputs = [
58 beautifulsoup4
59 brotli
60 csscompressor
61 django-sekizai
62 pytestCheckHook
63 pytest-django
64 ];
65
66 # Getting error: compressor.exceptions.OfflineGenerationError: You have
67 # offline compression enabled but key "..." is missing from offline manifest.
68 # You may need to run "python manage.py compress"
69 disabledTestPaths = [ "compressor/tests/test_offline.py" ];
70
71 pythonImportsCheck = [ "compressor" ];
72
73 meta = with lib; {
74 description = "Compresses linked and inline JavaScript or CSS into single cached files";
75 homepage = "https://django-compressor.readthedocs.org/";
76 changelog = "https://github.com/django-compressor/django-compressor/blob/${version}/docs/changelog.txt";
77 license = licenses.mit;
78 maintainers = with maintainers; [ desiderius ];
79 };
80}