From 8926c56fe10552d24f0575db23af2dc3c819096a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 29 Oct 2024 23:32:14 +0100 Subject: [PATCH 1/3] python312Packages.httpx-oauth: init at 0.15.1 --- .../python-modules/httpx-oauth/default.nix | 53 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 55 insertions(+) create mode 100644 pkgs/development/python-modules/httpx-oauth/default.nix diff --git a/pkgs/development/python-modules/httpx-oauth/default.nix b/pkgs/development/python-modules/httpx-oauth/default.nix new file mode 100644 index 0000000000000..1be59926112d3 --- /dev/null +++ b/pkgs/development/python-modules/httpx-oauth/default.nix @@ -0,0 +1,53 @@ +{ + lib, + buildPythonPackage, + fastapi, + fetchFromGitHub, + hatchling, + hatch-regex-commit, + httpx, + pytest-asyncio, + pytest-cov-stub, + pytest-mock, + pytestCheckHook, + respx, +}: + +buildPythonPackage rec { + pname = "httpx-oauth"; + version = "0.15.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "frankie567"; + repo = "httpx-oauth"; + rev = "refs/tags/v${version}"; + hash = "sha256-f3X3kSw7elTScCA3bNggwXyyHORre6Xzup/D0kgn4DQ="; + }; + + build-system = [ + hatchling + hatch-regex-commit + ]; + + dependencies = [ httpx ]; + + nativeCheckInputs = [ + fastapi + pytest-asyncio + pytest-cov-stub + pytest-mock + pytestCheckHook + respx + ]; + + pythonImportsCheck = [ "httpx_oauth" ]; + + meta = with lib; { + description = "Async OAuth client using HTTPX"; + homepage = "https://github.com/frankie567/httpx-oauth"; + changelog = "https://github.com/frankie567/httpx-oauth/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a7111bf884dbe..c2a63e143d113 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5899,6 +5899,8 @@ self: super: with self; { httpx-ntlm = callPackage ../development/python-modules/httpx-ntlm { }; + httpx-oauth = callPackage ../development/python-modules/httpx-oauth { }; + httpx-socks = callPackage ../development/python-modules/httpx-socks { }; httpx-sse = callPackage ../development/python-modules/httpx-sse { }; From f016de10f3b966e4e0b4bc2069cb5985edb27645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 29 Oct 2024 23:36:06 +0100 Subject: [PATCH 2/3] paperless-ngx: 2.12.1 -> 2.13.2 --- .../office/paperless-ngx/default.nix | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index 34549330a747b..63afa14b107cc 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -25,13 +25,13 @@ }: let - version = "2.12.1"; + version = "2.13.2"; src = fetchFromGitHub { owner = "paperless-ngx"; repo = "paperless-ngx"; rev = "refs/tags/v${version}"; - hash = "sha256-txqwVGLUel74ObCqwMWSqa4Nd2eDRf0SqAIes5tlMDg="; + hash = "sha256-0dR/NIOnhPRHEMOxVlxDraBbuuvxET4NeA580OB1Tdg="; }; # subpath installation is broken with uvicorn >= 0.26 @@ -40,6 +40,27 @@ let python = python3.override { self = python; packageOverrides = final: prev: { + django = prev.django_5; + + # TODO: drop after https://github.com/NixOS/nixpkgs/pull/306556 or similar got merged + django-allauth = prev.django-allauth.overridePythonAttrs ({ src, nativeCheckInputs, ... }: let + version = "65.0.2"; + in { + inherit version; + src = src.override { + rev = "refs/tags/${version}"; + hash = "sha256-GvYdExkNuySrg8ERnWOJxucFe5HVdPAcHfRNeqiVS7M="; + }; + + nativeCheckInputs = nativeCheckInputs ++ [ prev.fido2 ]; + }); + + django-extensions = prev.django-extensions.overridePythonAttrs (_: { + # fails with: TypeError: 'class Meta' got invalid attribute(s): index_together + # probably because of django_5 but it is the latest version available and used like that in paperless-ngx + doCheck = false; + }); + # 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; }; @@ -76,7 +97,7 @@ let cd src-ui ''; - npmDepsHash = "sha256-hb2z2cPMTN5bHtUldTR5Mvgo4nZL8/S+Uhfis37gF44="; + npmDepsHash = "sha256-bPtm3me84QeJgn297d8pStJSwMXnZG1XL5rokhrXg9Q="; nativeBuildInputs = [ pkg-config @@ -137,7 +158,7 @@ python.pkgs.buildPythonApplication rec { channels-redis concurrent-log-handler dateparser - django + django_5 django-allauth django-auditlog django-celery-results @@ -155,8 +176,10 @@ python.pkgs.buildPythonApplication rec { flower gotenberg-client gunicorn + httpx-oauth imap-tools inotifyrecursive + jinja2 langdetect mysqlclient nltk @@ -257,10 +280,8 @@ python.pkgs.buildPythonApplication rec { "testNormalOperation" # Something broken with new Tesseract and inline RTL/LTR overrides? "test_rtl_language_detection" - # Broke during the pytest-httpx 0.30.0 -> 0.32.0 upgrade - "test_request_pdf_a_format" - "test_generate_pdf_html_email" - "test_generate_pdf_html_email_merge_failure" + # django.core.exceptions.FieldDoesNotExist: Document has no field named 'transaction_id' + "test_convert" ]; doCheck = !stdenv.hostPlatform.isDarwin; From 45bb433c54e34ce846f5bfcaee42c6359ad56ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 4 Nov 2024 16:56:08 +0100 Subject: [PATCH 3/3] paperless-ngx: 2.13.2 -> 2.13.4 --- pkgs/applications/office/paperless-ngx/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index 63afa14b107cc..9035cd8778dc6 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -25,13 +25,13 @@ }: let - version = "2.13.2"; + version = "2.13.4"; src = fetchFromGitHub { owner = "paperless-ngx"; repo = "paperless-ngx"; rev = "refs/tags/v${version}"; - hash = "sha256-0dR/NIOnhPRHEMOxVlxDraBbuuvxET4NeA580OB1Tdg="; + hash = "sha256-db8omhyngvenAgfGGpMAhGkgqGug/sv7AL1G+sniM/c="; }; # subpath installation is broken with uvicorn >= 0.26 @@ -97,7 +97,7 @@ let cd src-ui ''; - npmDepsHash = "sha256-bPtm3me84QeJgn297d8pStJSwMXnZG1XL5rokhrXg9Q="; + npmDepsHash = "sha256-pBCWcdCTQh0N4pRLBWLZXybuhpiat030xvPZ5z7CUJ0="; nativeBuildInputs = [ pkg-config