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