From 4c9f1d74f3db759c400f8a2e62df43ed94d3631f Mon Sep 17 00:00:00 2001 From: Moritz 'e1mo' Fromm Date: Tue, 16 May 2023 11:49:58 +0200 Subject: [PATCH 1/3] python3Packages.python-ipware: init at 0.9.0 --- .../python-modules/python-ipware/default.nix | 35 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/python-modules/python-ipware/default.nix diff --git a/pkgs/development/python-modules/python-ipware/default.nix b/pkgs/development/python-modules/python-ipware/default.nix new file mode 100644 index 000000000000..fb652df4a9e0 --- /dev/null +++ b/pkgs/development/python-modules/python-ipware/default.nix @@ -0,0 +1,35 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, unittestCheckHook +}: +buildPythonPackage rec { + pname = "python-ipware"; + version = "0.9.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "un33k"; + repo = "python-ipware"; + rev = "v${version}"; + hash = "sha256-RK624ktIzoLBD/2mB65zcYZ+o8axDE16bJpB6TwG4h4="; + }; + + pythonImportsCheck = [ + "ipware" + ]; + nativeCheckInputs = [ + unittestCheckHook + ]; + + meta = with lib; { + description = "A python package for server applications to retrieve client's IP address"; + homepage = "https://github.com/un33k/python-ipware"; + changelog = "https://github.com/un33k/python-ipware/blob/v${version}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ e1mo ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 77cc4ad2c095..f068908b3e3a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7756,6 +7756,8 @@ self: super: with self; { python-ipmi = callPackage ../development/python-modules/python-ipmi { }; + python-ipware = callPackage ../development/python-modules/python-ipware { }; + python-ironicclient = callPackage ../development/python-modules/python-ironicclient { }; python-izone = callPackage ../development/python-modules/python-izone { }; From 4d67d1615be6484c9f298d5feb13605f3c0c4522 Mon Sep 17 00:00:00 2001 From: Moritz 'e1mo' Fromm Date: Thu, 15 Jun 2023 20:30:49 +0200 Subject: [PATCH 2/3] python3Packages.tika-client: init at 0.1.0 --- .../python-modules/tika-client/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/tika-client/default.nix diff --git a/pkgs/development/python-modules/tika-client/default.nix b/pkgs/development/python-modules/tika-client/default.nix new file mode 100644 index 000000000000..dd35429d88a6 --- /dev/null +++ b/pkgs/development/python-modules/tika-client/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, hatchling +, httpx +}: +buildPythonPackage rec { + pname = "tika-client"; + version = "0.1.0"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "stumpylog"; + repo = "tika-client"; + rev = version; + hash = "sha256-c/4zoXxxrKA5uIz0esdNBmX1DYOiXrkCH1ePGUpEXRY="; + }; + + propagatedBuildInputs = [ + hatchling + 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. + doChecks = false; + + meta = with lib; { + description = "A modern Python REST client for Apache Tika server"; + homepage = "https://github.com/stumpylog/tika-client"; + changelog = "https://github.com/stumpylog/tika-client/blob/${version}/CHANGELOG.md"; + license = licenses.gpl3; + maintainers = with maintainers; [ e1mo ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f068908b3e3a..313d841d5828 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12097,6 +12097,8 @@ self: super: with self; { tika = callPackage ../development/python-modules/tika { }; + tika-client = callPackage ../development/python-modules/tika-client { }; + tiktoken = callPackage ../development/python-modules/tiktoken { }; tikzplotlib = callPackage ../development/python-modules/tikzplotlib { }; From 83809e4609a46da20e3cfe0c0371febc4e939036 Mon Sep 17 00:00:00 2001 From: Moritz 'e1mo' Fromm Date: Tue, 16 May 2023 12:26:48 +0200 Subject: [PATCH 3/3] paperless-ngx: 1.14.4 -> 1.16.1 Various smaller new features (quick filters from document detail, explanations for relative dates, pagination for tasks) and various other bug fixes and minor enhancements. v1.16.0 contains seemingly smaller features and and changed their tika client libary. Especially noteworthy for v1.14.5 seems a security fix around the display of texts in the frontend. Full changelog available at https://github.com/paperless-ngx/paperless-ngx/releases/tag/v1.14.5 https://github.com/paperless-ngx/paperless-ngx/releases/tag/v1.15.0 https://github.com/paperless-ngx/paperless-ngx/releases/tag/v1.15.1 https://github.com/paperless-ngx/paperless-ngx/releases/tag/v1.16.0 https://github.com/paperless-ngx/paperless-ngx/releases/tag/v1.16.1 --- .../office/paperless-ngx/default.nix | 51 +++++-------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index a60f926278ef..3ffc7f65caaf 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -17,13 +17,13 @@ }: let - version = "1.14.4"; + version = "1.16.1"; src = fetchFromGitHub { owner = "paperless-ngx"; repo = "paperless-ngx"; rev = "refs/tags/v${version}"; - hash = "sha256-9+8XqENpSdsND6g59oJkVoCe5tJ1Pwo8HD7Cszv/t7o="; + hash = "sha256-KmCUViKyjS/1+PL48TOeamYjSkg4J6ywvHgcIhNtVss="; }; # Use specific package versions required by paperless-ngx @@ -31,38 +31,15 @@ let packageOverrides = self: super: { django = super.django_4; - aioredis = super.aioredis.overridePythonAttrs (oldAttrs: rec { - version = "1.3.1"; + # Paperless tests fail with tika-client==0.1.0. Upstream WIP fix is at + # https://github.com/paperless-ngx/paperless-ngx/pull/3617 + tika-client = super.tika-client.overridePythonAttrs (oldAttrs: rec { + version = "0.0.3"; src = oldAttrs.src.override { - inherit version; - sha256 = "0fi7jd5hlx8cnv1m97kv9hc4ih4l8v15wzkqwsp73is4n0qazy0m"; - }; - }); - - channels = super.channels.overridePythonAttrs (oldAttrs: rec { - version = "3.0.5"; - pname = "channels"; - src = fetchFromGitHub { - owner = "django"; - repo = pname; rev = version; - sha256 = "sha256-bKrPLbD9zG7DwIYBst1cb+zkDsM8B02wh3D80iortpw="; - }; - propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [ self.daphne ]; - pytestFlagsArray = [ "--asyncio-mode=auto" ]; - }); - - daphne = super.daphne.overridePythonAttrs (oldAttrs: rec { - version = "3.0.2"; - pname = "daphne"; - src = fetchFromGitHub { - owner = "django"; - repo = pname; - rev = version; - hash = "sha256-KWkMV4L7bA2Eo/u4GGif6lmDNrZAzvYyDiyzyWt9LeI="; + hash = "sha256-IKPTQ4n/j/W292F0JpSEUC0X8E1tr961WEcNCN5ymoU="; }; }); - }; }; @@ -82,7 +59,7 @@ let pname = "paperless-ngx-frontend"; inherit version src; - npmDepsHash = "sha256-XTk4DpQAU/rI2XoUvLm0KVjuXFWdz2wb2EAg8EBVEdU="; + npmDepsHash = "sha256-GDdHlrU1x/uxDy4mwK7G4F9b7AJat3nhQESUpfDdKeE="; nativeBuildInputs = [ python3 @@ -118,7 +95,6 @@ python.pkgs.buildPythonApplication rec { ]; propagatedBuildInputs = with python.pkgs; [ - aioredis amqp anyio asgiref @@ -142,7 +118,6 @@ python.pkgs.buildPythonApplication rec { concurrent-log-handler constantly cryptography - daphne dateparser django-celery-results django-cors-headers @@ -150,7 +125,6 @@ python.pkgs.buildPythonApplication rec { django-extensions django-filter django-guardian - django-ipware django djangorestframework-guardian2 djangorestframework @@ -174,12 +148,10 @@ python.pkgs.buildPythonApplication rec { msgpack mysqlclient nltk - numpy ocrmypdf packaging pathvalidate pdf2image - pdfminer-six pikepdf pillow pluggy @@ -192,6 +164,7 @@ python.pkgs.buildPythonApplication rec { pyopenssl python-dateutil python-dotenv + python-ipware python-gnupg python-magic pytz @@ -209,7 +182,7 @@ python.pkgs.buildPythonApplication rec { sniffio sqlparse threadpoolctl - tika + tika-client tornado tqdm twisted @@ -266,12 +239,16 @@ python.pkgs.buildPythonApplication rec { ''; nativeCheckInputs = with python.pkgs; [ + daphne factory_boy imagehash + pdfminer-six pytest-django pytest-env + pytest-httpx pytest-xdist pytestCheckHook + reportlab ]; pytestFlagsArray = [