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.10"; 18 pyproject = true; 19 20 src = fetchFromGitHub { 21 owner = "django-import-export"; 22 repo = "django-import-export"; 23 tag = version; 24 hash = "sha256-amc5Qp3tdtqUGGN+DMT/r/CKMkMNnx5ryA+HlzQEejk="; 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 ] 52 ++ lib.flatten (builtins.attrValues optional-dependencies); 53 54 checkPhase = '' 55 runHook preCheck 56 ${python.interpreter} tests/manage.py test core --settings=settings 57 runHook postCheck 58 ''; 59 60 pythonImportsCheck = [ "import_export" ]; 61 62 meta = with lib; { 63 description = "Django application and library for importing and exporting data with admin integration"; 64 homepage = "https://github.com/django-import-export/django-import-export"; 65 changelog = "https://github.com/django-import-export/django-import-export/blob/${src.tag}/docs/changelog.rst"; 66 license = licenses.bsd2; 67 maintainers = with maintainers; [ sephi ]; 68 }; 69}