Unverified Commit 41f83545 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

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

parents eb33fb19 8778dc2e
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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
+79 −78
Original line number Diff line number Diff line
@@ -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,20 +58,16 @@ let
    poppler-utils
  ];

  frontend =
    let
      frontendSrc = src + "/src-ui";
    in
    stdenv.mkDerivation rec {
  frontend = stdenv.mkDerivation (finalAttrs: {
    pname = "paperless-ngx-frontend";
    inherit version;

      src = frontendSrc;
    src = src + "/src-ui";

    pnpmDeps = pnpm.fetchDeps {
        inherit pname version src;
      inherit (finalAttrs) pname version src;
      fetcherVersion = 1;
        hash = "sha256-VtYYwpMXPAC3g1OESnw3dzLTwiGqJBQcicFZskEucok=";
      hash = "sha256-bx/jXlG3lRiwKyz1M0dU00Xn5xaeALSIxIAGzo8gAgo=";
    };

    nativeBuildInputs = [
@@ -112,7 +98,8 @@ let
      node-gyp rebuild
      popd

        pnpm run build --configuration production
      # 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
    '';
@@ -121,7 +108,7 @@ let
    checkPhase = ''
      runHook preCheck

        pnpm run test
      pnpm run test | cat

      runHook postCheck
    '';
@@ -134,6 +121,15 @@ let

      runHook postInstall
    '';
  });

  nltkDataDir = symlinkJoin {
    name = "paperless_ngx_nltk_data";
    paths = with nltk-data; [
      punkt-tab
      snowball-data
      stopwords
    ];
  };
in
python.pkgs.buildPythonApplication rec {
@@ -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; };
  };

+2 −2
Original line number Diff line number Diff line
@@ -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 = [
Loading