From 741025d9b11c7c5fabb05d8a03a9be43f204cf31 Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Sun, 22 Oct 2023 11:15:17 +0200 Subject: [PATCH 1/2] python3Packages.flask-security-too: fix build Signed-off-by: Florian Brandes --- .../python-modules/flask-security-too/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/flask-security-too/default.nix b/pkgs/development/python-modules/flask-security-too/default.nix index 529a1a63913a..0eae72147262 100644 --- a/pkgs/development/python-modules/flask-security-too/default.nix +++ b/pkgs/development/python-modules/flask-security-too/default.nix @@ -21,6 +21,7 @@ # extras: mfa , cryptography , phonenumbers +, webauthn # propagates , blinker @@ -31,10 +32,10 @@ , flask-wtf , itsdangerous , passlib +, importlib-resources # tests , argon2-cffi -, flask-mongoengine , mongoengine , mongomock , peewee @@ -47,7 +48,7 @@ buildPythonPackage rec { pname = "flask-security-too"; version = "5.3.0"; - format = "setuptools"; + format = "pyproject"; disabled = pythonOlder "3.7"; @@ -71,6 +72,7 @@ buildPythonPackage rec { flask-wtf itsdangerous passlib + importlib-resources ]; passthru.optional-dependencies = { @@ -92,12 +94,12 @@ buildPythonPackage rec { mfa = [ cryptography phonenumbers + webauthn ]; }; nativeCheckInputs = [ argon2-cffi - flask-mongoengine mongoengine mongomock peewee @@ -112,6 +114,11 @@ buildPythonPackage rec { ++ passthru.optional-dependencies.mfa; + disabledTests = [ + # needs /etc/resolv.conf + "test_login_email_whatever" + ]; + pythonImportsCheck = [ "flask_security" ]; From b553f3a109eac0b79c34dac04637a4d944c9be2d Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Sun, 22 Oct 2023 11:29:13 +0200 Subject: [PATCH 2/2] pgadmin4: fix build due to Flask update Also updates security-flask-too from 5.3.0 -> 5.3.2 Signed-off-by: Florian Brandes --- .../flask-security-too/default.nix | 24 ++++---- pkgs/tools/admin/pgadmin/default.nix | 57 ++++++++++++++++++- 2 files changed, 67 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/flask-security-too/default.nix b/pkgs/development/python-modules/flask-security-too/default.nix index 0eae72147262..81abf369a8a4 100644 --- a/pkgs/development/python-modules/flask-security-too/default.nix +++ b/pkgs/development/python-modules/flask-security-too/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage , fetchPypi , pythonOlder +, setuptools # extras: babel , babel @@ -11,7 +12,6 @@ , bcrypt , bleach , flask-mailman -, qrcode # extras: fsqla , flask-sqlalchemy @@ -22,17 +22,17 @@ , cryptography , phonenumbers , webauthn +, qrcode # propagates -, blinker , email-validator , flask , flask-login , flask-principal , flask-wtf -, itsdangerous , passlib , importlib-resources +, wtforms # tests , argon2-cffi @@ -47,32 +47,30 @@ buildPythonPackage rec { pname = "flask-security-too"; - version = "5.3.0"; - format = "pyproject"; + version = "5.3.2"; + pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { pname = "Flask-Security-Too"; inherit version; - hash = "sha256-n12DCRPqxm8YhFeVrl99BEvdDYNq6rzP662rain3k1Q="; + hash = "sha256-wLUHXfDWSp7zWwTIjTH79AWlkkNzb21tChpLSEWr8+U="; }; - postPatch = '' - # This should be removed after updating to version 5.3.0. - sed -i '/filterwarnings =/a ignore:pkg_resources is deprecated:DeprecationWarning' pytest.ini - ''; + nativeBuildInputs = [ + setuptools + ]; propagatedBuildInputs = [ - blinker email-validator flask flask-login flask-principal flask-wtf - itsdangerous passlib importlib-resources + wtforms ]; passthru.optional-dependencies = { @@ -84,7 +82,6 @@ buildPythonPackage rec { bcrypt bleach flask-mailman - qrcode ]; fsqla = [ flask-sqlalchemy @@ -95,6 +92,7 @@ buildPythonPackage rec { cryptography phonenumbers webauthn + qrcode ]; }; diff --git a/pkgs/tools/admin/pgadmin/default.nix b/pkgs/tools/admin/pgadmin/default.nix index beecd6412bcf..117f02a593ba 100644 --- a/pkgs/tools/admin/pgadmin/default.nix +++ b/pkgs/tools/admin/pgadmin/default.nix @@ -9,6 +9,7 @@ , yarn , fixup_yarn_lock , nodejs +, fetchpatch , server-mode ? true }: @@ -26,7 +27,61 @@ let # keep the scope, as it is used throughout the derivation and tests # this also makes potential future overrides easier - pythonPackages = python3.pkgs.overrideScope (final: prev: rec { }); + pythonPackages = python3.pkgs.overrideScope (final: prev: rec { + # pgadmin 7.8 is incompatible with Flask >= 2.3 + flask = prev.flask.overridePythonAttrs (oldAttrs: rec { + version = "2.2.5"; + src = oldAttrs.src.override { + pname = "Flask"; + inherit version; + hash = "sha256-7e6bCn/yZiG9WowQ/0hK4oc3okENmbC7mmhQx/uXeqA="; + }; + format = "setuptools"; + }); + # downgrade needed for older Flask + httpbin = prev.httpbin.overridePythonAttrs (oldAttrs: rec { + version = "0.7.0"; + src = oldAttrs.src.override { + inherit version; + hash = "sha256-y7N3kMkVdfTxV1f0KtQdn3KesifV7b6J5OwXVIbbjfo="; + }; + format = "setuptools"; + patches = [ + (fetchpatch { + # Replaces BaseResponse class with Response class for Werkezug 2.1.0 compatibility + # https://github.com/postmanlabs/httpbin/pull/674 + url = "https://github.com/postmanlabs/httpbin/commit/5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b.patch"; + hash = "sha256-SbEWjiqayMFYrbgAPZtSsXqSyCDUz3z127XgcKOcrkE="; + }) + ]; + pytestFlagsArray = [ + "test_httpbin.py" + ]; + propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [ final.pythonPackages.brotlipy ]; + }); + # downgrade needed for older httpbin + werkzeug = prev.werkzeug.overridePythonAttrs (oldAttrs: rec { + version = "2.2.3"; + format = "setuptools"; + src = oldAttrs.src.override { + pname = "Werkzeug"; + inherit version; + hash = "sha256-LhzMlBfU2jWLnebxdOOsCUOR6h1PvvLWZ4ZdgZ39Cv4="; + }; + }); + # Downgrade needed for older Flask + flask-security-too = prev.flask-security-too.overridePythonAttrs (oldAttrs: rec { + version = "5.1.2"; + src = oldAttrs.src.override { + inherit version; + hash = "sha256-lZzm43m30y+2qjxNddFEeg9HDlQP9afq5VtuR25zaLc="; + }; + postPatch = '' + # This should be removed after updating to version 5.3.0. + sed -i '/filterwarnings =/a ignore:pkg_resources is deprecated:DeprecationWarning' pytest.ini + ''; + }); + }); offlineCache = fetchYarnDeps { yarnLock = ./yarn.lock;