From f71841764835f3fce502015e3013a8101c380dfa Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sun, 23 Jan 2022 12:00:00 +0000 Subject: [PATCH 1/3] python3Packages.sqlalchemy-continuum: 1.3.11 -> 1.3.12 --- .../python-modules/sqlalchemy-continuum/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/sqlalchemy-continuum/default.nix b/pkgs/development/python-modules/sqlalchemy-continuum/default.nix index 944a2cf08e09..da64d44a43fe 100644 --- a/pkgs/development/python-modules/sqlalchemy-continuum/default.nix +++ b/pkgs/development/python-modules/sqlalchemy-continuum/default.nix @@ -13,11 +13,11 @@ buildPythonPackage rec { pname = "SQLAlchemy-Continuum"; - version = "1.3.11"; + version = "1.3.12"; src = fetchPypi { inherit pname version; - sha256 = "1c9yd9s98crqgs39rc2ld2r0nchgyjrfbjdlqb99y4hhc6lv04xw"; + sha256 = "rlHl59MAQhsicMtZQT9rv1iQrDyVYJlawtyhvFaAM7o="; }; propagatedBuildInputs = [ @@ -41,7 +41,5 @@ buildPythonPackage rec { homepage = "https://github.com/kvesteri/sqlalchemy-continuum/"; description = "Versioning and auditing extension for SQLAlchemy"; license = licenses.bsd3; - # https://github.com/kvesteri/sqlalchemy-continuum/issues/255 - broken = lib.versionAtLeast sqlalchemy.version "1.4"; }; } From 10047fc2b3592585a20c091ac28e5e8e9c078081 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sun, 23 Jan 2022 12:00:00 +0000 Subject: [PATCH 2/3] python3Packages.ihatemoney: fix build --- .../python-modules/ihatemoney/default.nix | 75 ++++++------------- 1 file changed, 22 insertions(+), 53 deletions(-) diff --git a/pkgs/development/python-modules/ihatemoney/default.nix b/pkgs/development/python-modules/ihatemoney/default.nix index 2c535ea79b57..752452233b73 100644 --- a/pkgs/development/python-modules/ihatemoney/default.nix +++ b/pkgs/development/python-modules/ihatemoney/default.nix @@ -39,25 +39,9 @@ , psycopg2 # optional, for postgresql support , flask_testing , pytestCheckHook +, fetchpatch }: -# ihatemoney is not really a library. It will only ever be imported -# by the interpreter of uwsgi. So overrides for its depencies are fine. -let - # sqlalchemy-continuum requires sqlalchemy < 1.4 - pinned_sqlalchemy = sqlalchemy.overridePythonAttrs ( - old: rec { - pname = "SQLAlchemy"; - version = "1.3.24"; - - src = fetchPypi { - inherit pname version; - sha256 = "06bmxzssc66cblk1hamskyv5q3xf1nh1py3vi6dka4lkpxy7gfzb"; - }; - } - ); -in - buildPythonPackage rec { pname = "ihatemoney"; version = "5.1.1"; @@ -81,16 +65,7 @@ buildPythonPackage rec { flask-babel flask-cors flask_mail - ( - flask_migrate.override { - flask_sqlalchemy = flask_sqlalchemy.override { - sqlalchemy = pinned_sqlalchemy; - }; - alembic = alembic.override { - sqlalchemy = pinned_sqlalchemy; - }; - } - ) + flask_migrate flask-restful flask-talisman flask_wtf @@ -103,40 +78,32 @@ buildPythonPackage rec { pytz requests six - ( - ( - sqlalchemy-continuum.override { - sqlalchemy = pinned_sqlalchemy; - sqlalchemy-utils = sqlalchemy-utils.override { - sqlalchemy = pinned_sqlalchemy; - }; - sqlalchemy-i18n = sqlalchemy-i18n.override { - sqlalchemy = pinned_sqlalchemy; - sqlalchemy-utils = sqlalchemy-utils.override { - sqlalchemy = pinned_sqlalchemy; - }; - }; - flask_sqlalchemy = flask_sqlalchemy.override { - sqlalchemy = pinned_sqlalchemy; - }; - } - ).overridePythonAttrs ( - old: { - doCheck = false; - } - ) - ) + sqlalchemy-continuum werkzeug wtforms psycopg2 debts ]; - # upstream performed the update without needing to patch the code - # the original patch does not apply, sadly - # https://github.com/spiral-project/ihatemoney/pull/912 + patches = [ + # fix build with wtforms 3. remove with next release + (fetchpatch { + url = "https://github.com/spiral-project/ihatemoney/commit/40ce32d9fa58a60d26a4d0df547b8deb709c330d.patch"; + sha256 = "sha256-2ewOu21qhq/AOZaE9qrF5J6HH0h6ohFgjDb+BYjJnuQ="; + excludes = [ "setup.cfg" ]; + }) + ]; + postPatch = '' + # upstream performed the update without needing to patch the code + # the original patch does not apply, sadly + # https://github.com/spiral-project/ihatemoney/pull/912 substituteInPlace setup.cfg --replace "Flask-WTF>=0.14.3,<1" "Flask-WTF>=0.14.3,<2" + # https://github.com/spiral-project/ihatemoney/pull/986 + substituteInPlace setup.cfg --replace "SQLAlchemy>=1.3.0,<1.4" "SQLAlchemy>=1.3.0,<1.5" + # enabled by the patch above, remove on next release + substituteInPlace setup.cfg --replace "WTForms>=2.3.1,<2.4" "WTForms" + ''; checkInputs = [ @@ -144,6 +111,8 @@ buildPythonPackage rec { pytestCheckHook ]; + pythonImportChecks = [ "ihatemoney" ]; + disabledTests = [ "test_notifications" # requires running service. "test_invite" # requires running service. From 177f8cac9bd9e035027203f37d066e77694040f0 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sun, 23 Jan 2022 20:45:59 +0000 Subject: [PATCH 3/3] Update pkgs/development/python-modules/ihatemoney/default.nix Co-authored-by: Sandro --- .../python-modules/ihatemoney/default.nix | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/ihatemoney/default.nix b/pkgs/development/python-modules/ihatemoney/default.nix index 752452233b73..4fe56c616146 100644 --- a/pkgs/development/python-modules/ihatemoney/default.nix +++ b/pkgs/development/python-modules/ihatemoney/default.nix @@ -95,15 +95,10 @@ buildPythonPackage rec { ]; postPatch = '' - # upstream performed the update without needing to patch the code - # the original patch does not apply, sadly - # https://github.com/spiral-project/ihatemoney/pull/912 - substituteInPlace setup.cfg --replace "Flask-WTF>=0.14.3,<1" "Flask-WTF>=0.14.3,<2" - # https://github.com/spiral-project/ihatemoney/pull/986 - substituteInPlace setup.cfg --replace "SQLAlchemy>=1.3.0,<1.4" "SQLAlchemy>=1.3.0,<1.5" - # enabled by the patch above, remove on next release - substituteInPlace setup.cfg --replace "WTForms>=2.3.1,<2.4" "WTForms" - + substituteInPlace setup.cfg \ + --replace "Flask-WTF>=0.14.3,<1" "Flask-WTF>=0.14.3,<2" \ + --replace "SQLAlchemy>=1.3.0,<1.4" "SQLAlchemy>=1.3.0,<1.5" \ + --replace "WTForms>=2.3.1,<2.4" "WTForms" ''; checkInputs = [