paperless-ngx: 2.17.1 -> 2.18.1 (#434598)

This commit is contained in:
Sandro
2025-08-22 15:15:59 +02:00
committed by GitHub
16 changed files with 167 additions and 199 deletions
+1 -4
View File
@@ -31,10 +31,7 @@ let
PAPERLESS_REDIS = "unix://${redisServer.unixSocket}";
}
// lib.optionalAttrs (cfg.settings.PAPERLESS_ENABLE_NLTK or true) {
PAPERLESS_NLTK_DIR = pkgs.symlinkJoin {
name = "paperless_ngx_nltk_data";
paths = cfg.package.nltkData;
};
PAPERLESS_NLTK_DIR = cfg.package.nltkDataDir;
}
// lib.optionalAttrs (cfg.openMPThreadingWorkaround) {
OMP_NUM_THREADS = "1";
+1 -3
View File
@@ -308,8 +308,6 @@ let
substituteInPlace authentik/lib/default.yml \
--replace-fail '/blueprints' "$out/blueprints" \
--replace-fail './media' '/var/lib/authentik/media'
substituteInPlace pyproject.toml \
--replace-fail 'djangorestframework-guardian' 'djangorestframework-guardian2'
substituteInPlace authentik/stages/email/utils.py \
--replace-fail 'web/' '${webui}/'
'';
@@ -346,7 +344,7 @@ let
django-storages
django-tenants
djangorestframework
djangorestframework-guardian2
djangorestframework-guardian
docker
drf-orjson-renderer
drf-spectacular
+1 -1
View File
@@ -135,7 +135,7 @@ python.pkgs.buildPythonApplication rec {
'';
nativeCheckInputs = with python.pkgs; [
(postgresql.withPackages (p: [ p.postgis ]))
(postgresql.withPackages (p: [ p.postgis ])).out
postgresqlTestHook
pytest-django
pytest-playwright
+91 -90
View File
@@ -22,34 +22,24 @@
xcbuild,
pango,
pkg-config,
symlinkJoin,
nltk-data,
xorg,
}:
let
version = "2.17.1";
version = "2.18.1";
src = fetchFromGitHub {
owner = "paperless-ngx";
repo = "paperless-ngx";
tag = "v${version}";
hash = "sha256-6FvP/HgomsPxqCtKrZFxMlD2fFyT2e/JII2L7ANiOao=";
hash = "sha256-POHF00cV8pl6i1rcwxtZ+Q1AlLybDj6gSlL0lPwSSCo=";
};
python = python3.override {
self = python;
packageOverrides = final: prev: {
django = prev.django_5_1;
# TODO remove when paperless-ngx is updated past 2.17.1
imap-tools = prev.imap-tools.overridePythonAttrs {
version = "1.10.0";
src = fetchFromGitHub {
owner = "ikvk";
repo = "imap_tools";
tag = "v1.10.0";
hash = "sha256-lan12cHkoxCKadgyFey4ShcnwFg3Gl/VqKWlYAkvF3Y=";
};
};
django = prev.django_5_2;
# tesseract5 may be overwritten in the paperless module and we need to propagate that to make the closure reduction effective
ocrmypdf = prev.ocrmypdf.override { tesseract = tesseract5; };
@@ -68,73 +58,79 @@ let
poppler-utils
];
frontend =
let
frontendSrc = src + "/src-ui";
in
stdenv.mkDerivation rec {
pname = "paperless-ngx-frontend";
inherit version;
frontend = stdenv.mkDerivation (finalAttrs: {
pname = "paperless-ngx-frontend";
inherit version;
src = frontendSrc;
src = src + "/src-ui";
pnpmDeps = pnpm.fetchDeps {
inherit pname version src;
fetcherVersion = 1;
hash = "sha256-VtYYwpMXPAC3g1OESnw3dzLTwiGqJBQcicFZskEucok=";
};
nativeBuildInputs = [
node-gyp
nodejs_20
pkg-config
pnpm.configHook
python3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
xcbuild
];
buildInputs = [
pango
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
giflib
];
CYPRESS_INSTALL_BINARY = "0";
NG_CLI_ANALYTICS = "false";
buildPhase = ''
runHook preBuild
pushd node_modules/canvas
node-gyp rebuild
popd
pnpm run build --configuration production
runHook postBuild
'';
doCheck = true;
checkPhase = ''
runHook preCheck
pnpm run test
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib/paperless-ui
mv ../src/documents/static/frontend $out/lib/paperless-ui/
runHook postInstall
'';
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
fetcherVersion = 1;
hash = "sha256-bx/jXlG3lRiwKyz1M0dU00Xn5xaeALSIxIAGzo8gAgo=";
};
nativeBuildInputs = [
node-gyp
nodejs_20
pkg-config
pnpm.configHook
python3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
xcbuild
];
buildInputs = [
pango
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
giflib
];
CYPRESS_INSTALL_BINARY = "0";
NG_CLI_ANALYTICS = "false";
buildPhase = ''
runHook preBuild
pushd node_modules/canvas
node-gyp rebuild
popd
# cat forcefully disables angular cli's spinner which doesn't work with nix' tty which is 0x0
pnpm run build --configuration production | cat
runHook postBuild
'';
doCheck = true;
checkPhase = ''
runHook preCheck
pnpm run test | cat
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib/paperless-ui
mv ../src/documents/static/frontend $out/lib/paperless-ui/
runHook postInstall
'';
});
nltkDataDir = symlinkJoin {
name = "paperless_ngx_nltk_data";
paths = with nltk-data; [
punkt-tab
snowball-data
stopwords
];
};
in
python.pkgs.buildPythonApplication rec {
pname = "paperless-ngx";
@@ -149,8 +145,7 @@ python.pkgs.buildPythonApplication rec {
fi
substituteInPlace pyproject.toml \
--replace-fail '"--numprocesses=auto",' "" \
--replace-fail '--maxprocesses=16' "--numprocesses=$NIX_BUILD_CORES" \
--replace-fail "djangorestframework-guardian~=0.3.0" "djangorestframework-guardian2"
--replace-fail '--maxprocesses=16' "--numprocesses=$NIX_BUILD_CORES"
'';
nativeBuildInputs = [
@@ -159,14 +154,17 @@ python.pkgs.buildPythonApplication rec {
];
pythonRelaxDeps = [
"django-allauth"
"pathvalidate"
# https://github.com/NixOS/nixpkgs/pull/432489
"django"
"scikit-learn"
"redis"
];
dependencies =
with python.pkgs;
[
babel
bleach
channels
channels-redis
@@ -185,6 +183,7 @@ python.pkgs.buildPythonApplication rec {
}
))
django-auditlog
django-cachalot
django-celery-results
django-compression-middleware
django-cors-headers
@@ -194,7 +193,7 @@ python.pkgs.buildPythonApplication rec {
django-multiselectfield
django-soft-delete
djangorestframework
djangorestframework-guardian2
djangorestframework-guardian
drf-spectacular
drf-spectacular-sidecar
drf-writable-nested
@@ -213,6 +212,7 @@ python.pkgs.buildPythonApplication rec {
pathvalidate
pdf2image
psycopg
psycopg-pool
python-dateutil
python-dotenv
python-gnupg
@@ -301,6 +301,7 @@ python.pkgs.buildPythonApplication rec {
export PATH="${path}:$PATH"
export HOME=$(mktemp -d)
export XDG_DATA_DIRS="${liberation_ttf}/share:$XDG_DATA_DIRS"
export PAPERLESS_NLTK_DIR=${passthru.nltkDataDir}
'';
disabledTests = [
@@ -318,22 +319,22 @@ python.pkgs.buildPythonApplication rec {
# Favicon tests fail due to static file handling in the test environment
"test_favicon_view"
"test_favicon_view_missing_file"
# Requires DNS
"test_send_webhook_data_or_json"
"test_workflow_webhook_send_webhook_retry"
"test_workflow_webhook_send_webhook_task"
];
doCheck = !stdenv.hostPlatform.isDarwin;
passthru = {
inherit
python
path
frontend
nltkDataDir
path
python
tesseract5
;
nltkData = with nltk-data; [
punkt-tab
snowball-data
stopwords
];
tests = { inherit (nixosTests) paperless; };
};
@@ -16,14 +16,14 @@
buildPythonPackage rec {
pname = "django-auditlog";
version = "3.1.2";
version = "3.2.1";
pyproject = true;
src = fetchFromGitHub {
owner = "jazzband";
repo = "django-auditlog";
tag = "v${version}";
hash = "sha256-xb6pTsXkB8HVpXvB9WzBUlRcjh5cn1CdmMYQQVCQ/GU=";
hash = "sha256-159p82PT3za3wp2XhekGxy+NYxLyQfAyUOyhDjyr2CI=";
};
nativeBuildInputs = [
@@ -7,20 +7,26 @@
psycopg2,
jinja2,
beautifulsoup4,
pytest-django,
pytestCheckHook,
python,
pytz,
redis,
redisTestHook,
setuptools,
stdenv,
}:
buildPythonPackage rec {
pname = "django-cachalot";
version = "2.7.0";
format = "setuptools";
version = "2.8.0";
pyproject = true;
src = fetchFromGitHub {
owner = "noripyt";
repo = "django-cachalot";
tag = "v${version}";
hash = "sha256-Fi5UvqH2bVb4v/GWDkEYIcBMBVos+35g4kcEnZTOQvw=";
hash = "sha256-3W+9cULL3mMtAkxbqetoIj2FL/HRbzWHIDMe9O1e6BM=";
};
patches = [
@@ -29,18 +35,27 @@ buildPythonPackage rec {
./disable-unsupported-tests.patch
];
propagatedBuildInputs = [ django ];
build-system = [ setuptools ];
checkInputs = [
dependencies = [ django ];
nativeCheckInputs = [
beautifulsoup4
django-debug-toolbar
psycopg2
jinja2
pytest-django
pytestCheckHook
pytz
redis
redisTestHook
];
pythonImportsCheck = [ "cachalot" ];
# redisTestHook does not work on darwin
doCheck = !stdenv.hostPlatform.isDarwin;
# disable broken pinning test
preCheck = ''
substituteInPlace cachalot/tests/read.py \
@@ -1,25 +1,30 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
django-environ,
mock,
django,
pytestCheckHook,
pytest-django,
setuptools,
}:
buildPythonPackage rec {
pname = "django-guardian";
version = "2.4.0";
format = "setuptools";
version = "3.0.3";
pyproject = true;
src = fetchPypi {
inherit pname version;
sha256 = "c58a68ae76922d33e6bdc0e69af1892097838de56e93e78a8361090bcd9f89a0";
src = fetchFromGitHub {
owner = "django-guardian";
repo = "django-guardian";
tag = version;
hash = "sha256-0rOEue+OApWQmSBuwTLnu/yU5HUa5pgvVBUG5fT4iwY=";
};
propagatedBuildInputs = [ django ];
build-system = [ setuptools ];
dependencies = [ django ];
nativeCheckInputs = [
django-environ
@@ -34,7 +39,6 @@ buildPythonPackage rec {
description = "Per object permissions for Django";
homepage = "https://github.com/django-guardian/django-guardian";
license = with licenses; [
mit
bsd2
];
maintainers = [ ];
@@ -9,7 +9,7 @@
buildPythonPackage rec {
pname = "django-multiselectfield";
version = "0.1.13";
version = "1.0.1";
pyproject = true;
disabled = pythonOlder "3.9";
@@ -17,7 +17,7 @@ buildPythonPackage rec {
src = fetchPypi {
pname = "django_multiselectfield";
inherit version;
hash = "sha256-Q31yYy9MDKQWlRkXYyUpw9HUK2K7bDwD4zlvpQJlvpQ=";
hash = "sha256-P4tP/z4H1Kkci7S4Cbw1yusitBdptgb0ye3FO41ypmc=";
};
build-system = [ setuptools ];
@@ -3,6 +3,8 @@
buildPythonPackage,
fetchFromGitHub,
djangorestframework,
pytest-django,
pytestCheckHook,
setuptools,
}:
@@ -18,21 +20,20 @@ buildPythonPackage rec {
hash = "sha256-nUkR5xTyeBv7ziJ6Mej9TKvMOa5/k+ELBqt4BVam/wk=";
};
build-system = [ setuptools ];
postPatch = ''
patchShebangs manage.py
'';
build-system = [ setuptools ];
dependencies = [ djangorestframework ];
checkPhase = ''
runHook preCheck
nativeCheckInputs = [
pytest-django
pytestCheckHook
];
./manage.py test
runHook postCheck
'';
env.DJANGO_SETTINGS_MODULE = "tests.django_settings";
pythonImportsCheck = [ "rest_framework_dataclasses" ];
@@ -2,36 +2,38 @@
lib,
buildPythonPackage,
fetchFromGitHub,
django,
django-guardian,
djangorestframework,
pytest-django,
pytestCheckHook,
setuptools,
}:
buildPythonPackage rec {
pname = "djangorestframework-guardian";
version = "0.3.0";
format = "setuptools";
version = "0.4.0";
pyproject = true;
src = fetchFromGitHub {
owner = "rpkilby";
repo = "django-rest-framework-guardian";
rev = version;
hash = "sha256-jl/VEl1pUHU8J1d5ZQSGJweNJayIGw1iVAmwID85fqw=";
hash = "sha256-7SaKyWoLen5DAwSyrWeA4rEmjXMcPwJ7LM7WYxk+IKs=";
};
postPatch = ''
chmod +x manage.py
patchShebangs manage.py
'';
build-system = [ setuptools ];
propagatedBuildInputs = [
dependencies = [
django-guardian
djangorestframework
];
checkPhase = ''
./manage.py test
'';
nativeCheckInputs = [
pytest-django
pytestCheckHook
];
env.DJANGO_SETTINGS_MODULE = "tests.settings";
pythonImportsCheck = [ "rest_framework_guardian" ];
@@ -40,7 +42,5 @@ buildPythonPackage rec {
homepage = "https://github.com/rpkilby/django-rest-framework-guardian";
license = licenses.bsd3;
maintainers = [ ];
# unmaintained, last compatible version is 3.x, use djangorestframework-guardian2 instead
broken = lib.versionAtLeast django.version "4";
};
}
@@ -1,46 +0,0 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
django-guardian,
djangorestframework,
setuptools,
}:
buildPythonPackage rec {
pname = "djangorestframework-guardian2";
version = "0.7.0";
pyproject = true;
src = fetchFromGitHub {
owner = "johnthagen";
repo = "django-rest-framework-guardian2";
tag = "v${version}";
hash = "sha256-LrIhOoBWC3HttjAGbul4zof++OW35pGMyFGZzUpG1Tk=";
};
postPatch = ''
chmod +x manage.py
patchShebangs manage.py
'';
build-system = [ setuptools ];
dependencies = [
django-guardian
djangorestframework
];
checkPhase = ''
./manage.py test
'';
pythonImportsCheck = [ "rest_framework_guardian" ];
meta = with lib; {
description = "Django-guardian support for Django REST Framework";
homepage = "https://github.com/johnthagen/django-rest-framework-guardian2/";
license = licenses.bsd3;
maintainers = with maintainers; [ e1mo ];
};
}
@@ -8,14 +8,14 @@
buildPythonPackage rec {
pname = "drf-spectacular-sidecar";
version = "2025.4.1";
version = "2025.8.1";
pyproject = true;
src = fetchFromGitHub {
owner = "tfranzel";
repo = "drf-spectacular-sidecar";
rev = version;
hash = "sha256-YzSUwShj7QGCVKlTRM2Gro38Y+jGYQsMGBMAH0radmA=";
hash = "sha256-H2eHFX7VG7YqLztEV/G4QnVYytkfADeHxgBTRlmKt50=";
};
build-system = [ setuptools ];
@@ -49,6 +49,9 @@ buildPythonPackage rec {
__darwinAllowLocalNetworking = true;
# redisTestHook does not work on darwin-x86_64
doCheck = !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64);
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
# PermissionError: [Errno 13] Permission denied: '/tmp/rq-tests.txt'
"test_deleted_jobs_arent_executed"
@@ -2,35 +2,33 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
anyio,
hatchling,
httpx,
}:
buildPythonPackage rec {
pname = "tika-client";
version = "0.9.0";
version = "0.10.0";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "stumpylog";
repo = "tika-client";
tag = version;
hash = "sha256-lg6syUbEbPb70iBa4lw5fVN8cvfWY3bkG2jNGxxNLDo=";
hash = "sha256-XYyMp+02lWzE+3Txr+shVGVwalLEJHvoy988tA7SWgY=";
};
build-system = [ hatchling ];
dependencies = [ httpx ];
dependencies = [
anyio
httpx
];
pythonImportsCheck = [ "tika_client" ];
# Almost all of the tests (all except one in 0.1.0) fail since there
# is no tika http API endpoint reachable. Since tika is not yet
# packaged for nixpkgs, it seems like an unreasonable amount of effort
# fixing these tests.
# The tests expect the tika-server to run in a docker container
doChecks = false;
meta = with lib; {
+1
View File
@@ -188,6 +188,7 @@ mapAliases ({
distutils_extra = distutils-extra; # added 2023-10-12
digital-ocean = python-digitalocean; # addad 2024-04-12
dj-stripe = throw "dj-stripe has been removed because it is unused and broken"; # added 2025-07-21
djangorestframework-guardian2 = throw "djangorestframework-guardian2 has been removed because djangorestframework-guardian is active again and the upstream project was archived"; # added 2025-08-22
djangorestframework-jwt = drf-jwt; # added 2021-07-20
django-allauth-2fa = throw "django-allauth-2fa was removed because it was unused and django-allauth now contains 2fa logic itself."; # added 2025-02-15
django-sampledatahelper = throw "django-sampledatahelper was removed because it is no longer compatible to latest Django version"; # added 2022-07-18
-4
View File
@@ -4150,10 +4150,6 @@ self: super: with self; {
callPackage ../development/python-modules/djangorestframework-guardian
{ };
djangorestframework-guardian2 =
callPackage ../development/python-modules/djangorestframework-guardian2
{ };
djangorestframework-jsonp = callPackage ../development/python-modules/djangorestframework-jsonp { };
djangorestframework-recursive =