From 05ae01fcea6c7d270cc15374b0a806b09f548a9a Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 22 Jul 2021 23:15:53 +0200 Subject: [PATCH 1/2] buku: fix build Failing Hydra build: https://hydra.nixos.org/build/148285785 The underlying issue is `flask-admin` not working with newer versions of `SQLAlchemy` and `SQLAlchemy-Utils`[1]. I decided to only fix `buku` now since this is the package I wanted to take care of initially. Also, multiple versions of python packages - a measure that would be necessary for `flask-admin` - are generally discouraged[2]. [1] 1.5.8 works with `SQLAlchemy`, but is broken with `SQLAlchemy-Utils` at 0.37, see also https://github.com/flask-admin/flask-admin/issues/2113 [2] https://github.com/NixOS/nixpkgs/pull/127707 --- pkgs/applications/misc/buku/default.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/buku/default.nix b/pkgs/applications/misc/buku/default.nix index 68b4f7b3e560..90bd40e64579 100644 --- a/pkgs/applications/misc/buku/default.nix +++ b/pkgs/applications/misc/buku/default.nix @@ -1,6 +1,26 @@ { lib, python3, fetchFromGitHub }: -with python3.pkgs; buildPythonApplication rec { +let + python3' = python3.override { + packageOverrides = self: super: { + sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec { + version = "1.3.24"; + src = oldAttrs.src.override { + inherit version; + sha256 = "ebbb777cbf9312359b897bf81ba00dae0f5cb69fba2a18265dcc18a6f5ef7519"; + }; + }); + sqlalchemy-utils = super.sqlalchemy-utils.overridePythonAttrs (oldAttrs: rec { + version = "0.36.6"; + src = oldAttrs.src.override { + inherit version; + sha256 = "0srs5w486wp5zydjs70igi5ypgxhm6h73grb85jz03fqpqaanzvs"; + }; + }); + }; + }; +in +with python3'.pkgs; buildPythonApplication rec { version = "4.5"; pname = "buku"; From b47a85441986b14661fd2109eab6834c6a2b9c55 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 22 Jul 2021 23:21:28 +0200 Subject: [PATCH 2/2] buku: 4.5 -> 4.6 ChangeLog: https://github.com/jarun/buku/releases/tag/v4.6 --- pkgs/applications/misc/buku/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/misc/buku/default.nix b/pkgs/applications/misc/buku/default.nix index 90bd40e64579..0729df72492b 100644 --- a/pkgs/applications/misc/buku/default.nix +++ b/pkgs/applications/misc/buku/default.nix @@ -21,20 +21,21 @@ let }; in with python3'.pkgs; buildPythonApplication rec { - version = "4.5"; + version = "4.6"; pname = "buku"; src = fetchFromGitHub { owner = "jarun"; repo = "buku"; rev = "v${version}"; - sha256 = "1lcq5fk8d5j2kfhn9m5l2hk46v7nj4vfa22m1psz35c9zpw4px8q"; + sha256 = "sha256-hr9qiP7SbloigDcs+6KVWu0SOlggMaBr7CCfY8zoJG0="; }; checkInputs = [ pytestcov hypothesis pytest + pytest-vcr pylint flake8 pyyaml @@ -75,8 +76,8 @@ with python3'.pkgs; buildPythonApplication rec { # Disables a test which requires internet substituteInPlace tests/test_bukuDb.py \ --replace "@pytest.mark.slowtest" "@unittest.skip('skipping')" \ - --replace "self.assertEqual(shorturl, 'http://tny.im/yt')" "" \ - --replace "self.assertEqual(url, 'https://www.google.com')" "" + --replace "self.assertEqual(shorturl, \"http://tny.im/yt\")" "" \ + --replace "self.assertEqual(url, \"https://www.google.com\")" "" substituteInPlace setup.py \ --replace mypy-extensions==0.4.1 mypy-extensions>=0.4.1 ''; @@ -95,7 +96,7 @@ with python3'.pkgs; buildPythonApplication rec { homepage = "https://github.com/jarun/Buku"; license = licenses.gpl3; platforms = platforms.unix; - maintainers = with maintainers; [ matthiasbeyer infinisil ]; + maintainers = with maintainers; [ matthiasbeyer infinisil ma27 ]; }; }