From 97cbfe18015c4df1334302920a8aaeffbfdb332a Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 10 Dec 2020 04:20:00 +0000 Subject: [PATCH 1/2] python38Packages.sqlparse: install manpage --- .../python-modules/sqlparse/default.nix | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/sqlparse/default.nix b/pkgs/development/python-modules/sqlparse/default.nix index 635111b95d9..3ee59c391f8 100644 --- a/pkgs/development/python-modules/sqlparse/default.nix +++ b/pkgs/development/python-modules/sqlparse/default.nix @@ -1,7 +1,8 @@ -{ stdenv +{ lib , buildPythonPackage , fetchPypi -, pytest +, installShellFiles +, pytestCheckHook , isPy3k }: @@ -9,20 +10,22 @@ buildPythonPackage rec { pname = "sqlparse"; version = "0.4.1"; + disabled = !isPy3k; + src = fetchPypi { inherit pname version; sha256 = "0f91fd2e829c44362cbcfab3e9ae12e22badaa8a29ad5ff599f9ec109f0454e8"; }; - checkInputs = [ pytest ]; - checkPhase = '' - py.test + nativeBuildInputs = [ installShellFiles ]; + + checkInputs = [ pytestCheckHook ]; + + postInstall = '' + installManPage docs/sqlformat.1 ''; - # Package supports 3.x, but tests are clearly 2.x only. - doCheck = !isPy3k; - - meta = with stdenv.lib; { + meta = with lib; { description = "Non-validating SQL parser for Python"; longDescription = '' Provides support for parsing, splitting and formatting SQL statements. @@ -30,5 +33,4 @@ buildPythonPackage rec { homepage = "https://github.com/andialbrecht/sqlparse"; license = licenses.bsd3; }; - } From baeb4eb1b17cc6820f0b96ea2633a02dd5c15774 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 10 Dec 2020 04:20:00 +0000 Subject: [PATCH 2/2] litecli: fix build --- pkgs/development/tools/database/litecli/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/database/litecli/default.nix b/pkgs/development/tools/database/litecli/default.nix index 3d24ac34b3e..163926f0e58 100644 --- a/pkgs/development/tools/database/litecli/default.nix +++ b/pkgs/development/tools/database/litecli/default.nix @@ -1,4 +1,4 @@ -{ lib, python3Packages }: +{ lib, python3Packages, fetchpatch }: python3Packages.buildPythonApplication rec { pname = "litecli"; @@ -13,6 +13,14 @@ python3Packages.buildPythonApplication rec { sha256 = "FARWjtbS5zi/XQDyAVImUmArLj8xATz1jZ4jnXFdq1w="; }; + patches = [ + # Fix compatibility with sqlparse >= 0.4.0. Remove with the next release + (fetchpatch { + url = "https://github.com/dbcli/litecli/commit/37957e401d22f88800bbdec2c690e731f2cc13bd.patch"; + sha256 = "1x82s2h1rzflyiahyd8pfya30rzs6yx6ij4a4s16f8iix5x35zv9"; + }) + ]; + propagatedBuildInputs = with python3Packages; [ cli-helpers click