From 229f6d148713cf171edbe7cffcd63c784658a40f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 21 Oct 2022 10:47:58 +0200 Subject: [PATCH 1/6] python310Packages.channels: 3.0.5 -> 4.0.0 --- .../python-modules/channels/default.nix | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/channels/default.nix b/pkgs/development/python-modules/channels/default.nix index e4c8658f59bf..5bc2db228ae4 100644 --- a/pkgs/development/python-modules/channels/default.nix +++ b/pkgs/development/python-modules/channels/default.nix @@ -1,47 +1,58 @@ { lib -, buildPythonPackage -, fetchFromGitHub , asgiref -, django +, buildPythonPackage , daphne +, django +, fetchFromGitHub , pytest-asyncio , pytest-django , pytestCheckHook +, pythonOlder }: buildPythonPackage rec { pname = "channels"; - version = "3.0.5"; + version = "4.0.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "django"; repo = pname; rev = version; - sha256 = "sha256-bKrPLbD9zG7DwIYBst1cb+zkDsM8B02wh3D80iortpw="; + hash = "sha256-n88MxwYQ4O2kBy/W0Zvi3FtIlhZQQRCssB/lYrFNvps="; }; propagatedBuildInputs = [ asgiref django - daphne ]; + passthru.optional-dependencies = { + daphne = [ + daphne + ]; + }; + checkInputs = [ pytest-asyncio pytest-django pytestCheckHook - ]; + ] ++ passthru.optional-dependencies.daphne; pytestFlagsArray = [ "--asyncio-mode=legacy" ]; - pythonImportsCheck = [ "channels" ]; + pythonImportsCheck = [ + "channels" + ]; meta = with lib; { description = "Brings event-driven capabilities to Django with a channel system"; - license = licenses.bsd3; homepage = "https://github.com/django/channels"; + license = licenses.bsd3; maintainers = with maintainers; [ fab ]; }; } From 5804c8cde29861afe79a4668d7252877549ebab5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 21 Oct 2022 10:52:14 +0200 Subject: [PATCH 2/6] python310Packages.daphne: 3.0.2 -> 4.0.0 --- .../python-modules/daphne/default.nix | 55 ++++++++++++++----- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/daphne/default.nix b/pkgs/development/python-modules/daphne/default.nix index 90b108e3bc74..e4bbb16abbe9 100644 --- a/pkgs/development/python-modules/daphne/default.nix +++ b/pkgs/development/python-modules/daphne/default.nix @@ -1,35 +1,60 @@ -{ lib, stdenv, buildPythonPackage, isPy3k, fetchFromGitHub -, asgiref, autobahn, twisted, pytest-runner -, hypothesis, pytest, pytest-asyncio, service-identity, pyopenssl +{ lib +, stdenv +, asgiref +, autobahn +, buildPythonPackage +, django +, fetchFromGitHub +, hypothesis +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, twisted }: + buildPythonPackage rec { pname = "daphne"; - version = "3.0.2"; + version = "4.0.0"; + format = "setuptools"; - disabled = !isPy3k; + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "django"; repo = pname; rev = version; - sha256 = "sha256-KWkMV4L7bA2Eo/u4GGif6lmDNrZAzvYyDiyzyWt9LeI="; + hash = "sha256-vPMrmC2B0Pcvk8Y1FsJ4PXnzIMtPod7lL2u0IYNVUxc="; }; - nativeBuildInputs = [ pytest-runner ]; + propagatedBuildInputs = [ + asgiref + autobahn + twisted + ] ++ twisted.optional-dependencies.tls; - propagatedBuildInputs = [ asgiref autobahn twisted service-identity pyopenssl ]; + checkInputs = [ + django + hypothesis + pytest-asyncio + pytestCheckHook + ]; - checkInputs = [ hypothesis pytest pytest-asyncio ]; - - doCheck = !stdenv.isDarwin; # most tests fail on darwin - - checkPhase = '' - py.test + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest-runner" "" ''; + # Most tests fail on darwin + doCheck = !stdenv.isDarwin; + + pythonImportsCheck = [ + "daphne" + ]; + meta = with lib; { description = "Django ASGI (HTTP/WebSocket) server"; - license = licenses.bsd3; homepage = "https://github.com/django/daphne"; + license = licenses.bsd3; + maintainers = with maintainers; [ ]; }; } From a169e6f7b268e87d817400f7cf52243e525a5b47 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 21 Oct 2022 10:56:29 +0200 Subject: [PATCH 3/6] python310Packages.channels-redis: 3.4.1 -> 4.0.0 --- .../python-modules/channels-redis/default.nix | 46 ++++++++++++------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/channels-redis/default.nix b/pkgs/development/python-modules/channels-redis/default.nix index 6ee3dc340c63..9d24655c36f4 100644 --- a/pkgs/development/python-modules/channels-redis/default.nix +++ b/pkgs/development/python-modules/channels-redis/default.nix @@ -3,7 +3,8 @@ , asgiref , buildPythonPackage , channels -, fetchPypi +, cryptography +, fetchFromGitHub , hiredis , msgpack , pythonOlder @@ -12,34 +13,47 @@ buildPythonPackage rec { pname = "channels-redis"; - version = "3.4.1"; + version = "4.0.0"; + format = "setuptools"; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit version; - pname = "channels_redis"; - sha256 = "sha256-eOSi8rKnRP5ah4SOw2te5J9SLGgIzv5sWDZj0NUx+qg="; + src = fetchFromGitHub { + owner = "django"; + repo = "channels_redis"; + rev = version; + hash = "sha256-YiLNrMRroa8T4uPNwa5ussFoFYjyg31waGpBGhAETmY="; }; - buildInputs = [ redis hiredis ]; + buildInputs = [ + hiredis + redis + ]; - propagatedBuildInputs = [ channels msgpack aioredis asgiref ]; + propagatedBuildInputs = [ + aioredis + asgiref + channels + msgpack + ]; + + passthru.optional-dependencies = { + cryptography = [ + cryptography + ]; + }; # Fails with : ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 6379) # (even with a local Redis instance running) doCheck = false; - postPatch = '' - sed -i "s/msgpack~=0.6.0/msgpack/" setup.py - sed -i "s/aioredis~=1.0/aioredis/" setup.py - ''; - - pythonImportsCheck = [ "channels_redis" ]; + pythonImportsCheck = [ + "channels_redis" + ]; meta = with lib; { - homepage = "https://github.com/django/channels_redis/"; description = "Redis-backed ASGI channel layer implementation"; + homepage = "https://github.com/django/channels_redis/"; license = licenses.bsd3; maintainers = with maintainers; [ mmai ]; }; From be062905d38f0145ead874e4514db5829f7eb88b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 21 Oct 2022 11:14:35 +0200 Subject: [PATCH 4/6] baserow: 1.10.2 -> 1.12.1 --- pkgs/servers/baserow/default.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pkgs/servers/baserow/default.nix b/pkgs/servers/baserow/default.nix index cdb1329ce2e4..222d24252ebf 100644 --- a/pkgs/servers/baserow/default.nix +++ b/pkgs/servers/baserow/default.nix @@ -8,14 +8,14 @@ let baserow_premium = with python3.pkgs; ( buildPythonPackage rec { pname = "baserow_premium"; - version = "1.10.2"; + version = "1.12.1"; foramt = "setuptools"; src = fetchFromGitLab { owner = "bramw"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-4BrhTwAxHboXz8sMZL0V68skgNw2D2/YJuiWVNe0p4w="; + hash = "sha256-zT2afl3QNE2dO3JXjsZXqSmm1lv3EorG3mYZLQQMQ2Q="; }; sourceRoot = "source/premium/backend"; @@ -27,14 +27,14 @@ in with python3.pkgs; buildPythonPackage rec { pname = "baserow"; - version = "1.10.2"; + version = "1.12.1"; format = "setuptools"; src = fetchFromGitLab { owner = "bramw"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-4BrhTwAxHboXz8sMZL0V68skgNw2D2/YJuiWVNe0p4w="; + hash = "sha256-zT2afl3QNE2dO3JXjsZXqSmm1lv3EorG3mYZLQQMQ2Q="; }; sourceRoot = "source/backend"; @@ -46,9 +46,12 @@ with python3.pkgs; buildPythonPackage rec { sed 's/\[standard\]//' -i requirements/base.in requirements/base.txt ''; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + makeWrapper + ]; propagatedBuildInputs = [ + autobahn advocate antlr4-python3-runtime boto3 @@ -56,6 +59,7 @@ with python3.pkgs; buildPythonPackage rec { celery-redbeat channels channels-redis + daphne dj-database-url django-celery-beat django-celery-email @@ -111,8 +115,8 @@ with python3.pkgs; buildPythonPackage rec { cp -r src/baserow/core/management/backup $out/lib/${python.libPrefix}/site-packages/baserow/core/management/ ''; - # Disable linting checks disabledTests = [ + # Disable linting checks "flake8_plugins" ]; @@ -130,8 +134,8 @@ with python3.pkgs; buildPythonPackage rec { DJANGO_SETTINGS_MODULE = "baserow.config.settings.test"; meta = with lib; { - homepage = "https://baserow.io"; description = "No-code database and Airtable alternative"; + homepage = "https://baserow.io"; license = licenses.mit; maintainers = with maintainers; [ onny ]; }; From f77724235ecad2409fc811888aeb770cc987c714 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 21 Oct 2022 11:23:42 +0200 Subject: [PATCH 5/6] paperless-ngx: disable failing tests --- .../applications/office/paperless-ngx/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index e11b34e52bcf..9da4cdfdd06d 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -198,7 +198,9 @@ python.pkgs.pythonPackages.buildPythonApplication rec { pytestCheckHook ]; - pytestFlagsArray = [ "src" ]; + pytestFlagsArray = [ + "src" + ]; # The tests require: # - PATH with runtime binaries @@ -214,14 +216,21 @@ python.pkgs.pythonPackages.buildPythonApplication rec { --replace "--cov --cov-report=html" "" ''; + disabledTests = [ + # Tests require a running Redis instance + "test_consume_barcode_file" + "test_consume_barcode_tiff_file" + "test_consume_barcode_supported_no_extension_file" + ]; + passthru = { inherit python path; tests = { inherit (nixosTests) paperless; }; }; meta = with lib; { - description = "A supercharged version of paperless: scan, index, and archive all of your physical documents"; - homepage = "https://paperless-ngx.readthedocs.io/en/latest/"; + description = "Tool to scan, index, and archive all of your physical documents"; + homepage = "https://paperless-ngx.readthedocs.io/"; license = licenses.gpl3Only; maintainers = with maintainers; [ lukegb gador erikarvstedt ]; }; From 9e597cc63e0d325b2cd1ee477852a9d06e457d62 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Fri, 21 Oct 2022 14:48:23 +0200 Subject: [PATCH 6/6] paperless-ngx: downgrade channels, channels-redis and daphne remove eth override. Re-Enable tests. Signed-off-by: Florian Brandes --- .../office/paperless-ngx/default.nix | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index 9da4cdfdd06d..f5de1d65184c 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -22,7 +22,7 @@ let # use paperless-ngx version of django-q # see https://github.com/paperless-ngx/paperless-ngx/pull/1014 - django-q = super.django-q.overridePythonAttrs (oldAttrs: rec { + django-q = super.django-q.overridePythonAttrs (oldAttrs: { src = fetchFromGitHub { owner = "paperless-ngx"; repo = "django-q"; @@ -42,8 +42,39 @@ let }; }); - eth-keys = super.eth-keys.overridePythonAttrs (_: { - doCheck = false; + # downgrade redis due to https://github.com/paperless-ngx/paperless-ngx/pull/1802 + # and https://github.com/django/channels_redis/issues/332 + channels-redis = super.channels-redis.overridePythonAttrs (oldAttrs: rec { + version = "3.4.1"; + src = fetchFromGitHub { + owner = "django"; + repo = "channels_redis"; + rev = version; + hash = "sha256-ZQSsE3pkM+nfDhWutNuupcyC5MDikUu6zU4u7Im6bRQ="; + }; + }); + + 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 ]; + }); + + daphne = super.daphne.overridePythonAttrs (oldAttrs: rec { + version = "3.0.2"; + pname = "daphne"; + src = fetchFromGitHub { + owner = "django"; + repo = pname; + rev = version; + hash = "sha256-KWkMV4L7bA2Eo/u4GGif6lmDNrZAzvYyDiyzyWt9LeI="; + }; }); }; }; @@ -216,12 +247,6 @@ python.pkgs.pythonPackages.buildPythonApplication rec { --replace "--cov --cov-report=html" "" ''; - disabledTests = [ - # Tests require a running Redis instance - "test_consume_barcode_file" - "test_consume_barcode_tiff_file" - "test_consume_barcode_supported_no_extension_file" - ]; passthru = { inherit python path;