From 86a160ea18b661c8bc59c0e359dc1cb13241c675 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 4 Aug 2022 21:53:58 +0200 Subject: [PATCH 1/2] buku: fix build failing for bukuserver SQLAlchemy-Utils v0.36.6 package override build is failing. This is due to a patch in the original SQLAlchemy-Utils package which broke the build of this package override: ```bash > applying patch /nix/store/pd6anhwbf0in3r3jhi3sbn5v2fjs0mf2-skip-database-tests.patch > patching file conftest.py > Hunk #1 FAILED at 61. > Hunk #2 succeeded at 98 (offset -10 lines). ``` These SQLAlchemy package overrides were originaly added to fix incompatibilities with Flask-Admin. See commit 05ae01fcea6c7d270cc15374b0a806b09f548a9a However with Flask-Admin >= v1.5.6, several SQLAlchemy compatibility patches were added: * https://flask-admin.readthedocs.io/en/latest/changelog/ We can now safely remove these package overrides to make bukuserver work again. --- pkgs/applications/misc/buku/default.nix | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/pkgs/applications/misc/buku/default.nix b/pkgs/applications/misc/buku/default.nix index 6ae97e680e38..5b5254ba4ce4 100644 --- a/pkgs/applications/misc/buku/default.nix +++ b/pkgs/applications/misc/buku/default.nix @@ -1,26 +1,7 @@ { lib, python3, fetchFromGitHub, withServer ? false }: let - python3' = python3.override { - packageOverrides = self: super: { - sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec { - version = "1.3.24"; - src = oldAttrs.src.override { - inherit version; - hash = "sha256-67t3fL+TEjWbiXv4G6ANrg9ctp+6KhgmXcwYpvXvdRk="; - }; - doCheck = false; - }); - sqlalchemy-utils = super.sqlalchemy-utils.overridePythonAttrs (oldAttrs: rec { - version = "0.36.6"; - src = oldAttrs.src.override { - inherit version; - sha256 = "0srs5w486wp5zydjs70igi5ypgxhm6h73grb85jz03fqpqaanzvs"; - }; - }); - }; - }; - serverRequire = with python3'.pkgs; [ + serverRequire = with python3.pkgs; [ requests flask flask-admin @@ -36,7 +17,7 @@ let toml ]; in -with python3'.pkgs; buildPythonApplication rec { +with python3.pkgs; buildPythonApplication rec { version = "4.7"; pname = "buku"; From 61a1465e26dbcf9941c6e035b7d9a3b476b315a1 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 4 Aug 2022 22:39:22 +0200 Subject: [PATCH 2/2] buku: fix check inputs and remove PYTHONIOENCODING hack PYTHONIOENCODING hack is not needed anymore --- pkgs/applications/misc/buku/default.nix | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/misc/buku/default.nix b/pkgs/applications/misc/buku/default.nix index 5b5254ba4ce4..702440c32b5e 100644 --- a/pkgs/applications/misc/buku/default.nix +++ b/pkgs/applications/misc/buku/default.nix @@ -35,6 +35,10 @@ with python3.pkgs; buildPythonApplication rec { pyyaml mypy-extensions click + pylint + flake8 + pytest-cov + pyyaml ]; propagatedBuildInputs = [ @@ -45,20 +49,7 @@ with python3.pkgs; buildPythonApplication rec { html5lib ] ++ lib.optionals withServer serverRequire; - postPatch = '' - # Jailbreak problematic dependencies - sed -i \ - -e "s,'PyYAML.*','PyYAML',g" \ - -e "/'pytest-cov/d" \ - -e "/'pylint/d" \ - -e "/'flake8/d" \ - setup.py - ''; - preCheck = '' - # Fixes two tests for wrong encoding - export PYTHONIOENCODING=utf-8 - # Disables a test which requires internet substituteInPlace tests/test_bukuDb.py \ --replace "@pytest.mark.slowtest" "@unittest.skip('skipping')" \