From eb8c84f81431833d95395e8218862524c4eeaf5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Oct 2024 13:11:30 -0700 Subject: [PATCH 1/3] Revert "mycli: disable checking to fix build" This reverts commit f12c5fd4b8454954a8d03874b8b4d7214c9ca800. The tests were broken because paramiko couldn't be imported, which was fixed by 50d865aa192645e10064173422b394a12aecdfea. --- pkgs/tools/admin/mycli/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/tools/admin/mycli/default.nix b/pkgs/tools/admin/mycli/default.nix index 73b24698ff6b..4d3e320bee0a 100644 --- a/pkgs/tools/admin/mycli/default.nix +++ b/pkgs/tools/admin/mycli/default.nix @@ -38,9 +38,6 @@ buildPythonApplication rec { export LC_ALL="en_US.UTF-8" ''; - # fails at checkphase due to the below test paths - # disabling it specifically does not work, so we disable checking altogether - doCheck = false; disabledTestPaths = [ "mycli/packages/paramiko_stub/__init__.py" ]; From 95b6ee2e823270e8f83a98ef94565f19f77260c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Oct 2024 20:59:31 -0700 Subject: [PATCH 2/3] mycli: unpin sqlparse --- pkgs/tools/admin/mycli/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/tools/admin/mycli/default.nix b/pkgs/tools/admin/mycli/default.nix index 4d3e320bee0a..61d3a84f1095 100644 --- a/pkgs/tools/admin/mycli/default.nix +++ b/pkgs/tools/admin/mycli/default.nix @@ -15,6 +15,10 @@ buildPythonApplication rec { hash = "sha256-0R2k5hRkAJbqgGZEPXWUb48oFxTKMKiQZckf3F+VC3I="; }; + pythonRelaxDeps = [ + "sqlparse" + ]; + propagatedBuildInputs = [ cli-helpers click From 3ea55e93ca1b4cbfa16e83cd72f0d9cb4c8b402a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Oct 2024 15:19:35 -0700 Subject: [PATCH 3/3] mycli: modernize --- pkgs/tools/admin/mycli/default.nix | 64 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/pkgs/tools/admin/mycli/default.nix b/pkgs/tools/admin/mycli/default.nix index 61d3a84f1095..41920ba2b280 100644 --- a/pkgs/tools/admin/mycli/default.nix +++ b/pkgs/tools/admin/mycli/default.nix @@ -1,14 +1,13 @@ -{ lib -, python3 -, fetchPypi -, glibcLocales +{ + fetchPypi, + lib, + python3Packages, }: -with python3.pkgs; - -buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "mycli"; version = "1.27.2"; + pyproject = true; src = fetchPypi { inherit pname version; @@ -19,40 +18,39 @@ buildPythonApplication rec { "sqlparse" ]; - propagatedBuildInputs = [ - cli-helpers - click - configobj - importlib-resources - paramiko - prompt-toolkit - pyaes - pycrypto - pygments - pymysql - pyperclip - sqlglot - sqlparse + build-system = with python3Packages; [ + setuptools ]; - nativeCheckInputs = [ pytestCheckHook glibcLocales ]; + dependencies = + with python3Packages; + [ + cli-helpers + click + configobj + cryptography + paramiko + prompt-toolkit + pyaes + pygments + pymysql + pyperclip + sqlglot + sqlparse + ] + ++ cli-helpers.optional-dependencies.styles; + + nativeCheckInputs = with python3Packages; [ pytestCheckHook ]; preCheck = '' - export HOME=. - export LC_ALL="en_US.UTF-8" + export HOME="$(mktemp -d)" ''; disabledTestPaths = [ "mycli/packages/paramiko_stub/__init__.py" ]; - postPatch = '' - substituteInPlace setup.py \ - --replace "cryptography == 36.0.2" "cryptography" - ''; - - meta = with lib; { - inherit version; + meta = { description = "Command-line interface for MySQL"; mainProgram = "mycli"; longDescription = '' @@ -60,7 +58,7 @@ buildPythonApplication rec { syntax highlighting. ''; homepage = "http://mycli.net"; - license = licenses.bsd3; - maintainers = with maintainers; [ jojosch ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ jojosch ]; }; }