1{ 2 stdenv, 3 lib, 4 buildPythonPackage, 5 fetchFromGitHub, 6 django, 7 pytestCheckHook, 8 setuptools, 9 celery, 10 django-taggit, 11 feedgen, 12 reportlab, 13 jsonschema, 14 wand, 15 django-filter, 16 django-treebeard, 17 djangorestframework, 18 pikepdf, 19 pypdf, 20 pycryptodome, 21 python-poppler, 22 zipstream-ng, 23 django-json-widget, 24 factory-boy, 25 pytest-django, 26 camelot, 27 pytesseract, 28 pytest-factoryboy, 29 poppler-utils, 30 pytest-playwright, 31 playwright-driver, 32 pnpm, 33 nodejs, 34 markdown, 35 nh3, 36}: 37 38buildPythonPackage rec { 39 pname = "django-filingcabinet"; 40 version = "0.17-unstable-2025-08-14"; 41 pyproject = true; 42 43 src = fetchFromGitHub { 44 owner = "okfde"; 45 repo = "django-filingcabinet"; 46 # No release tagged yet on GitHub 47 # https://github.com/okfde/django-filingcabinet/issues/69 48 rev = "e1713921d6d14e0abc8b81315545d7fb6f08c39f"; 49 hash = "sha256-R/JNI+PZb0H09ZoYCGV3nbAowkf/YlKia4xkgAgqoNM="; 50 }; 51 52 postPatch = '' 53 # zipstream is discontinued and outdated 54 # https://github.com/okfde/django-filingcabinet/issues/90 55 substituteInPlace pyproject.toml \ 56 --replace-fail "zipstream" "zipstream-ng" 57 ''; 58 59 build-system = [ setuptools ]; 60 61 nativeBuildInputs = [ 62 nodejs 63 pnpm.configHook 64 ]; 65 66 dependencies = [ 67 celery 68 django 69 django-filter 70 django-json-widget 71 django-taggit 72 django-treebeard 73 djangorestframework 74 feedgen 75 jsonschema 76 markdown 77 nh3 78 pikepdf 79 pycryptodome 80 pypdf 81 python-poppler 82 reportlab 83 wand 84 zipstream-ng 85 ]; 86 87 optional-dependencies = { 88 tabledetection = [ camelot ]; 89 ocr = [ pytesseract ]; 90 # Dependencies not yet packaged 91 #webp = [ webp ]; 92 #annotate = [ fcdocs-annotate ]; 93 }; 94 95 pnpmDeps = pnpm.fetchDeps { 96 inherit pname version src; 97 fetcherVersion = 1; 98 hash = "sha256-kvLV/pCX/wQHG0ttrjSro7/CoQ5K1T0aFChafQOwvNw="; 99 }; 100 101 postBuild = '' 102 pnpm run build 103 ''; 104 105 postInstall = '' 106 cp -r build $out/ 107 ''; 108 109 nativeCheckInputs = [ 110 poppler-utils 111 pytest-django 112 pytest-factoryboy 113 pytest-playwright 114 pytestCheckHook 115 ]; 116 117 disabledTests = [ 118 # AssertionError: Locator expected to be visible 119 "test_keyboard_scroll" 120 "test_number_input_scroll" 121 # playwright._impl._errors.TimeoutError: Locator.click: Timeout 30000ms exceeded 122 "test_sidebar_hide" 123 "test_show_search_bar" 124 # Unable to launch browser 125 "test_document_viewer" 126 ]; 127 128 preCheck = '' 129 export DJANGO_SETTINGS_MODULE="test_project.settings" 130 '' 131 + lib.optionalString (!stdenv.hostPlatform.isRiscV) '' 132 export PLAYWRIGHT_BROWSERS_PATH="${playwright-driver.browsers}" 133 ''; 134 135 pythonImportsCheck = [ "filingcabinet" ]; 136 137 # Playwright tests not supported on RiscV yet 138 doCheck = lib.meta.availableOn stdenv.hostPlatform playwright-driver.browsers; 139 140 meta = { 141 description = "Django app that manages documents with pages, annotations and collections"; 142 homepage = "https://github.com/okfde/django-filingcabinet"; 143 changelog = "https://github.com/feincms/django-cabinet/blob/${version}/CHANGELOG.rst"; 144 license = lib.licenses.mit; 145 maintainers = [ lib.maintainers.onny ]; 146 }; 147}