1{ 2 lib, 3 buildPythonPackage, 4 chardet, 5 diff-match-patch, 6 django, 7 fetchFromGitHub, 8 psycopg2, 9 python, 10 pytz, 11 setuptools-scm, 12 tablib, 13}: 14 15buildPythonPackage rec { 16 pname = "django-import-export"; 17 version = "4.3.7"; 18 pyproject = true; 19 20 src = fetchFromGitHub { 21 owner = "django-import-export"; 22 repo = "django-import-export"; 23 tag = version; 24 hash = "sha256-hHLFrcCw9PXGh7JbHo76SUZ09ZCK9u72BjiaL5HuVMc="; 25 }; 26 27 pythonRelaxDeps = [ "tablib" ]; 28 29 build-system = [ setuptools-scm ]; 30 31 dependencies = [ 32 diff-match-patch 33 django 34 tablib 35 ]; 36 37 optional-dependencies = { 38 all = [ tablib ] ++ tablib.optional-dependencies.all; 39 cli = [ tablib ] ++ tablib.optional-dependencies.cli; 40 ods = [ tablib ] ++ tablib.optional-dependencies.ods; 41 pandas = [ tablib ] ++ tablib.optional-dependencies.pandas; 42 xls = [ tablib ] ++ tablib.optional-dependencies.xls; 43 xlsx = [ tablib ] ++ tablib.optional-dependencies.xlsx; 44 yaml = [ tablib ] ++ tablib.optional-dependencies.yaml; 45 }; 46 47 nativeCheckInputs = [ 48 chardet 49 psycopg2 50 pytz 51 ] ++ lib.flatten (builtins.attrValues optional-dependencies); 52 53 checkPhase = '' 54 runHook preCheck 55 ${python.interpreter} tests/manage.py test core --settings=settings 56 runHook postCheck 57 ''; 58 59 pythonImportsCheck = [ "import_export" ]; 60 61 meta = with lib; { 62 description = "Django application and library for importing and exporting data with admin integration"; 63 homepage = "https://github.com/django-import-export/django-import-export"; 64 changelog = "https://github.com/django-import-export/django-import-export/blob/${src.tag}/docs/changelog.rst"; 65 license = licenses.bsd2; 66 maintainers = with maintainers; [ sephi ]; 67 }; 68}