1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 django, 6 setuptools, 7 setuptools-scm, 8 django-configurations, 9 pytest, 10 pytestCheckHook, 11}: 12 13buildPythonPackage rec { 14 pname = "pytest-django"; 15 version = "4.11.1"; 16 pyproject = true; 17 18 src = fetchPypi { 19 pname = "pytest_django"; 20 inherit version; 21 hash = "sha256-qUkUGh7hA8sOeiDxRR01X4P15KXQe91Nz90f0P8ieZE="; 22 }; 23 24 build-system = [ 25 setuptools 26 setuptools-scm 27 ]; 28 29 buildInputs = [ pytest ]; 30 31 dependencies = [ django ]; 32 33 nativeCheckInputs = [ 34 django-configurations 35 # pytest-xidst causes random errors in the form of: django.db.utils.OperationalError: no such table: app_item 36 pytestCheckHook 37 ]; 38 39 preCheck = '' 40 # bring pytest_django_test module into PYTHONPATH 41 export PYTHONPATH="$PWD:$PYTHONPATH" 42 43 # test the lightweight sqlite flavor 44 export DJANGO_SETTINGS_MODULE="pytest_django_test.settings_sqlite" 45 ''; 46 47 __darwinAllowLocalNetworking = true; 48 49 meta = with lib; { 50 changelog = "https://github.com/pytest-dev/pytest-django/blob/v${version}/docs/changelog.rst"; 51 description = "Pytest plugin for testing of Django applications"; 52 homepage = "https://pytest-django.readthedocs.org/en/latest/"; 53 license = licenses.bsd3; 54 maintainers = [ ]; 55 }; 56}