From ba407dd26b3848de9c4a5931a0e3ccb11678107b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 18 Nov 2024 13:45:16 +0100 Subject: [PATCH 1/8] python312Packages.textual: 0.82.0 -> 0.86.1 Diff: https://github.com/Textualize/textual/compare/refs/tags/v0.82.0...v0.86.1 Changelog: https://github.com/Textualize/textual/releases/tag/v0.86.1 --- pkgs/development/python-modules/textual/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/textual/default.nix b/pkgs/development/python-modules/textual/default.nix index f04ba71578a9..826520242513 100644 --- a/pkgs/development/python-modules/textual/default.nix +++ b/pkgs/development/python-modules/textual/default.nix @@ -20,7 +20,7 @@ buildPythonPackage rec { pname = "textual"; - version = "0.82.0"; + version = "0.86.1"; pyproject = true; disabled = pythonOlder "3.8"; @@ -29,7 +29,7 @@ buildPythonPackage rec { owner = "Textualize"; repo = "textual"; rev = "refs/tags/v${version}"; - hash = "sha256-belpoXQ+CkTchK+FjI/Ur8v4cNgzX39xLdNfPCwaU6E="; + hash = "sha256-5msCFv79nAmoaP9gZxV3DXMLTyVlSFb+qyA5jHWwc50="; }; build-system = [ poetry-core ]; From 3c2d602caa06d24bf0d404eb7d5a3d65e3e8c677 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 18 Nov 2024 13:46:14 +0100 Subject: [PATCH 2/8] python312Packages.textual-fastdatatable: 0.9.0 -> 0.10.0 --- .../python-modules/textual-fastdatatable/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/textual-fastdatatable/default.nix b/pkgs/development/python-modules/textual-fastdatatable/default.nix index 16d5418a2736..421b43da8364 100644 --- a/pkgs/development/python-modules/textual-fastdatatable/default.nix +++ b/pkgs/development/python-modules/textual-fastdatatable/default.nix @@ -12,13 +12,13 @@ buildPythonPackage rec { pname = "textual-fastdatatable"; - version = "0.9.0"; + version = "0.10.0"; pyproject = true; src = fetchPypi { pname = "textual_fastdatatable"; inherit version; - hash = "sha256-AS3SiwetCHkCMu8H81xbp5QvN/2GCvMlWgU4qZKvBRU="; + hash = "sha256-45uLpUzBb+xH+a+DIFiXB4YjabyFE4wmv1Tw3JtpNow="; }; build-system = [ From da277264a1fafa51ca0952c52a463eaa15e60550 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 18 Nov 2024 13:47:12 +0100 Subject: [PATCH 3/8] python312Packages.textual-textarea: 0.14.2 -> 0.14.4 --- pkgs/development/python-modules/textual-textarea/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/textual-textarea/default.nix b/pkgs/development/python-modules/textual-textarea/default.nix index 74293ee3c2e4..9b06ffc1a3c9 100644 --- a/pkgs/development/python-modules/textual-textarea/default.nix +++ b/pkgs/development/python-modules/textual-textarea/default.nix @@ -9,13 +9,13 @@ buildPythonPackage rec { pname = "textual-textarea"; - version = "0.14.2"; + version = "0.14.4"; pyproject = true; src = fetchPypi { pname = "textual_textarea"; inherit version; - hash = "sha256-AJU7BBoev6pBrLhvbfF4I7l+E8YnO5jCD5OIsNf6NW0="; + hash = "sha256-VgSJF5sZQmuFRrhSF1Cs3iL1cCGzr8CLBkNVcEj7cxU="; }; build-system = [ From 201985dc663e4c0fd2e09d120c56c06608cc32be Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 18 Nov 2024 13:57:25 +0100 Subject: [PATCH 4/8] python312Packages.textual-textarea: refactor - enable tests - add changelog to meta --- .../textual-textarea/default.nix | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/textual-textarea/default.nix b/pkgs/development/python-modules/textual-textarea/default.nix index 9b06ffc1a3c9..fb8639a84302 100644 --- a/pkgs/development/python-modules/textual-textarea/default.nix +++ b/pkgs/development/python-modules/textual-textarea/default.nix @@ -1,9 +1,12 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, poetry-core, pyperclip, + pytest-asyncio, + pytestCheckHook, + pythonOlder, textual, }: @@ -12,28 +15,33 @@ buildPythonPackage rec { version = "0.14.4"; pyproject = true; - src = fetchPypi { - pname = "textual_textarea"; - inherit version; - hash = "sha256-VgSJF5sZQmuFRrhSF1Cs3iL1cCGzr8CLBkNVcEj7cxU="; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "tconbeer"; + repo = "textual-textarea"; + rev = "refs/tags/v${version}"; + hash = "sha256-tmbSCU1VgxR9aXG22UVpweD71dVmhKSRBTDm1Gf33jM="; }; - build-system = [ - poetry-core - ]; + build-system = [ poetry-core ]; dependencies = [ pyperclip textual + ] ++ textual.optional-dependencies.syntax; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook ]; - pythonImportsCheck = [ - "textual_textarea" - ]; + pythonImportsCheck = [ "textual_textarea" ]; meta = { description = "A text area (multi-line input) with syntax highlighting for Textual"; - homepage = "https://pypi.org/project/textual-textarea/"; + homepage = "https://github.com/tconbeer/textual-textarea"; + changelog = "https://github.com/tconbeer/textual-textarea/releases/tag/v${version}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ pcboy ]; }; From add9ba09bbad5a947ac93d8315ca0d8e79fee806 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 18 Nov 2024 16:06:34 +0100 Subject: [PATCH 5/8] python312Packages.textual-fastdatatable: refactor - enable tests - add changelog to meta --- .../textual-fastdatatable/default.nix | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/textual-fastdatatable/default.nix b/pkgs/development/python-modules/textual-fastdatatable/default.nix index 421b43da8364..54f830cc85d3 100644 --- a/pkgs/development/python-modules/textual-fastdatatable/default.nix +++ b/pkgs/development/python-modules/textual-fastdatatable/default.nix @@ -1,13 +1,17 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, poetry-core, pyarrow, pytz, textual, tzdata, + pythonOlder, polars, + pytest-asyncio, + pytest-textual-snapshot, + pytestCheckHook, }: buildPythonPackage rec { @@ -15,36 +19,45 @@ buildPythonPackage rec { version = "0.10.0"; pyproject = true; - src = fetchPypi { - pname = "textual_fastdatatable"; - inherit version; - hash = "sha256-45uLpUzBb+xH+a+DIFiXB4YjabyFE4wmv1Tw3JtpNow="; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "tconbeer"; + repo = "textual-fastdatatable"; + rev = "refs/tags/v${version}"; + hash = "sha256-r1evN69etFn21TkXPLuAh1OxIsurDDyPyYOKQR5uUos="; }; - build-system = [ - poetry-core - ]; + build-system = [ poetry-core ]; dependencies = [ pyarrow pytz textual tzdata - ]; + ] ++ textual.optional-dependencies.syntax; optional-dependencies = { - polars = [ - polars - ]; + polars = [ polars ]; }; - pythonImportsCheck = [ - "textual_fastdatatable" + nativeCheckInputs = [ + pytest-asyncio + pytest-textual-snapshot + pytestCheckHook + ] ++ lib.flatten (builtins.attrValues optional-dependencies); + + pythonImportsCheck = [ "textual_fastdatatable" ]; + + disabledTestPaths = [ + # Tests are comparing CLI output + "tests/snapshot_tests/test_snapshots.py" ]; meta = { description = "A performance-focused reimplementation of Textual's DataTable widget, with a pluggable data storage backend"; - homepage = "https://pypi.org/project/textual-fastdatatable/"; + homepage = "https://github.com/tconbeer/textual-fastdatatable"; + changelog = "https://github.com/tconbeer/textual-fastdatatable/releases/tag/v${version}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ pcboy ]; }; From 2702f06d51f9b84eae1e0fd2b627e22829e9cc3b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 18 Nov 2024 16:07:38 +0100 Subject: [PATCH 6/8] harlequin: 1.25.0 -> 1.25.2 Diff: https://github.com/tconbeer/harlequin/compare/refs/tags/v1.25.0...v1.25.2 Changelog: https://github.com/tconbeer/harlequin/releases/tag/v1.25.2 --- pkgs/by-name/ha/harlequin/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ha/harlequin/package.nix b/pkgs/by-name/ha/harlequin/package.nix index ca41bb550b6d..6451391a4d83 100644 --- a/pkgs/by-name/ha/harlequin/package.nix +++ b/pkgs/by-name/ha/harlequin/package.nix @@ -11,14 +11,14 @@ }: python3Packages.buildPythonApplication rec { pname = "harlequin"; - version = "1.25.0"; + version = "1.25.2"; pyproject = true; src = fetchFromGitHub { owner = "tconbeer"; repo = "harlequin"; rev = "refs/tags/v${version}"; - hash = "sha256-iRl91GqYigD6t0aVVShBg835yhlPxgfZcQCdAGUoc1k="; + hash = "sha256-ov9pMvFzJAMfOM7JeSgnp6dZ424GiRaH7W5OCKin9Jk="; }; build-system = with python3Packages; [ From e3b12254fbdcb9b9e28dbfff274e6478265b8c8c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 18 Nov 2024 16:48:04 +0100 Subject: [PATCH 7/8] python312Packages.sqlfmt: refactor --- .../python-modules/sqlfmt/default.nix | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/sqlfmt/default.nix b/pkgs/development/python-modules/sqlfmt/default.nix index 6b35dbcfc44f..3d191ea49208 100644 --- a/pkgs/development/python-modules/sqlfmt/default.nix +++ b/pkgs/development/python-modules/sqlfmt/default.nix @@ -1,17 +1,20 @@ { lib, - buildPythonPackage, - fetchPypi, - fetchFromGitHub, - importlib-metadata, black, - poetry-core, + buildPythonPackage, click, + fetchFromGitHub, + fetchPypi, + gitpython, + importlib-metadata, jinja2, platformdirs, + poetry-core, + pytest-asyncio, + pytestCheckHook, + pythonOlder, tomli, tqdm, - gitpython, }: buildPythonPackage rec { @@ -19,6 +22,8 @@ buildPythonPackage rec { version = "0.23.3"; pyproject = true; + disabled = pythonOlder "3.9"; + src = fetchFromGitHub { owner = "tconbeer"; repo = "sqlfmt"; @@ -26,9 +31,9 @@ buildPythonPackage rec { hash = "sha256-kbluj29P1HwTaCYv1Myslak9s8FFm2e/eHdGgi3H4i0="; }; - build-system = [ - poetry-core - ]; + pythonRelaxDeps = [ "platformdirs" ]; + + build-system = [ poetry-core ]; dependencies = [ click @@ -40,25 +45,26 @@ buildPythonPackage rec { ]; optional-dependencies = { - jinjafmt = [ - black - ]; - sqlfmt_primer = [ - gitpython - ]; + jinjafmt = [ black ]; + sqlfmt_primer = [ gitpython ]; }; - pythonRelaxDeps = [ - "platformdirs" - ]; + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ] ++ lib.flatten (builtins.attrValues optional-dependencies); - pythonImportsCheck = [ - "sqlfmt" - ]; + preCheck = '' + export HOME=$(mktemp -d) + export PATH="$PATH:$out/bin"; + ''; + + pythonImportsCheck = [ "sqlfmt" ]; meta = { description = "Sqlfmt formats your dbt SQL files so you don't have to"; homepage = "https://github.com/tconbeer/sqlfmt"; + changelog = "https://github.com/tconbeer/sqlfmt/blob/${src.rev}/CHANGELOG.md"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ pcboy ]; mainProgram = "sqlfmt"; From f673b779338786f6553c7118ed1703fa6072260e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 18 Nov 2024 16:48:22 +0100 Subject: [PATCH 8/8] harlequin: enable tests --- pkgs/by-name/ha/harlequin/package.nix | 59 ++++++++++++++++++--------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/ha/harlequin/package.nix b/pkgs/by-name/ha/harlequin/package.nix index 6451391a4d83..4f9afa90bd28 100644 --- a/pkgs/by-name/ha/harlequin/package.nix +++ b/pkgs/by-name/ha/harlequin/package.nix @@ -6,6 +6,7 @@ testers, nix-update-script, versionCheckHook, + glibcLocales, withPostgresAdapter ? true, withBigQueryAdapter ? true, }: @@ -21,34 +22,32 @@ python3Packages.buildPythonApplication rec { hash = "sha256-ov9pMvFzJAMfOM7JeSgnp6dZ424GiRaH7W5OCKin9Jk="; }; - build-system = with python3Packages; [ - poetry-core - ]; + pythonRelaxDeps = [ "textual" ]; + + build-system = with python3Packages; [ poetry-core ]; + + nativeBuildInputs = [ glibcLocales ]; dependencies = with python3Packages; [ + click + duckdb + importlib-metadata + numpy + packaging + platformdirs + questionary + rich-click + sqlfmt textual textual-fastdatatable textual-textarea - click - rich-click - duckdb - sqlfmt - platformdirs - importlib-metadata tomlkit - questionary - numpy - packaging ] ++ lib.optionals withPostgresAdapter [ harlequin-postgres ] ++ lib.optionals withBigQueryAdapter [ harlequin-bigquery ]; - pythonRelaxDeps = [ - "textual" - ]; - pythonImportsCheck = [ "harlequin" "harlequin_duckdb" @@ -60,17 +59,37 @@ python3Packages.buildPythonApplication rec { updateScript = nix-update-script { }; }; - nativeCheckInputs = [ - versionCheckHook + preCheck = '' + export HOME=$(mktemp -d) + ''; + + nativeCheckInputs = + [ + versionCheckHook + ] + ++ (with python3Packages; [ + pytest-asyncio + pytestCheckHook + ]); + + disabledTests = [ + # Tests require network access + "test_connect_extensions" + "test_connect_prql" + ]; + + disabledTestPaths = [ + # Tests requires more setup + "tests/functional_tests/" ]; meta = { description = "The SQL IDE for Your Terminal"; homepage = "https://harlequin.sh"; - mainProgram = "harlequin"; + changelog = "https://github.com/tconbeer/harlequin/releases/tag/v${version}"; license = lib.licenses.mit; + mainProgram = "harlequin"; maintainers = with lib.maintainers; [ pcboy ]; platforms = lib.platforms.unix; - changelog = "https://github.com/tconbeer/harlequin/releases/tag/v${version}"; }; }