1{ 2 lib, 3 buildPythonPackage, 4 pythonOlder, 5 fetchFromGitHub, 6 7 # build-system 8 setuptools, 9 10 # dependencies 11 django, 12 tablib, 13 14 # tests 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.0"; 27 pyproject = true; 28 29 disabled = pythonOlder "3.6"; 30 31 src = fetchFromGitHub { 32 owner = "jieter"; 33 repo = pname; 34 rev = "v${version}"; 35 hash = "sha256-VB7xmcBncTUYllzKS4o7G7u+KoivMiiEQGZ4x+Rnces="; 36 }; 37 38 nativeBuildInputs = [ setuptools ]; 39 40 propagatedBuildInputs = [ django ]; 41 42 passthru.optional-dependencies = { 43 tablib = [ tablib ] ++ tablib.optional-dependencies.xls ++ tablib.optional-dependencies.yaml; 44 }; 45 46 env.DJANGO_SETTINGS_MODULE = "tests.app.settings"; 47 48 nativeCheckInputs = [ 49 lxml 50 openpyxl 51 psycopg2 52 pytz 53 pyyaml 54 pytest-django 55 pytestCheckHook 56 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies); 57 58 disabledTestPaths = [ 59 # requires django-filters 60 "tests/test_views.py" 61 ]; 62 63 meta = with lib; { 64 changelog = "https://github.com/jieter/django-tables2/blob/v${version}/CHANGELOG.md"; 65 description = "Django app for creating HTML tables"; 66 homepage = "https://github.com/jieter/django-tables2"; 67 license = licenses.bsd2; 68 maintainers = with maintainers; [ hexa ]; 69 }; 70}