1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 setuptools, 8 9 # dependencies 10 django, 11 tablib, 12 13 # tests 14 django-filter, 15 lxml, 16 openpyxl, 17 psycopg2, 18 pytz, 19 pyyaml, 20 pytest-django, 21 pytestCheckHook, 22}: 23 24buildPythonPackage rec { 25 pname = "django-tables2"; 26 version = "2.7.1"; 27 pyproject = true; 28 29 src = fetchFromGitHub { 30 owner = "jieter"; 31 repo = "django-tables2"; 32 tag = "v${version}"; 33 hash = "sha256-DhPQM/OEd8ViEm7cLbb/KCb6bjyoqKnbGOcqkTPRRxo="; 34 }; 35 36 build-system = [ setuptools ]; 37 38 dependencies = [ django ]; 39 40 optional-dependencies = { 41 tablib = [ tablib ] ++ tablib.optional-dependencies.xls ++ tablib.optional-dependencies.yaml; 42 }; 43 44 env.DJANGO_SETTINGS_MODULE = "tests.app.settings"; 45 46 nativeCheckInputs = [ 47 django-filter 48 lxml 49 openpyxl 50 psycopg2 51 pytz 52 pyyaml 53 pytest-django 54 pytestCheckHook 55 ] 56 ++ lib.flatten (lib.attrValues optional-dependencies); 57 58 meta = with lib; { 59 changelog = "https://github.com/jieter/django-tables2/blob/v${version}/CHANGELOG.md"; 60 description = "Django app for creating HTML tables"; 61 homepage = "https://github.com/jieter/django-tables2"; 62 license = licenses.bsd2; 63 maintainers = with maintainers; [ hexa ]; 64 }; 65}