1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 django,
6 pythonOlder,
7 setuptools,
8 python,
9 pytestCheckHook,
10 pytest-django,
11}:
12
13buildPythonPackage rec {
14 pname = "django-json-widget";
15 version = "2.0.3";
16 pyproject = true;
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "jmrivas86";
22 repo = "django-json-widget";
23 tag = "v${version}";
24 hash = "sha256-11XDmSYJzrjcV3q3P0Kl2WkfoAtuPYzQt5D2ZzRTCCY=";
25 };
26
27 build-system = [ setuptools ];
28
29 dependencies = [ django ];
30
31 nativeCheckInputs = [
32 pytest-django
33 pytestCheckHook
34 ];
35
36 preCheck = ''
37 export DJANGO_SETTINGS_MODULE=tests.settings
38 '';
39
40 pythonImportsCheck = [ "django_json_widget" ];
41
42 meta = {
43 description = "Alternative widget that makes it easy to edit the jsonfield field of django";
44 homepage = "https://github.com/jmrivas86/django-json-widget";
45 changelog = "https://github.com/jmrivas86/django-json-widget/blob/v${version}/CHANGELOG.rst";
46 # Contradictory license specifications
47 # https://github.com/jmrivas86/django-json-widget/issues/93
48 license = lib.licenses.mit;
49 maintainers = [ lib.maintainers.onny ];
50 };
51}