Files
nixpkgs/pkgs/by-name/sq/sqlit-tui/package.nix
Victor Hooi 668a64fa3a sqlit-tui: add missing pytz dependency, fix UI test exclusion
Fixes two checkPhase failures (observed on aarch64-darwin):

- test_timezone_aware_datetime: duckdb imports pytz lazily when
  converting timezone-aware datetimes, and pytz was not declared.
  Added to dependencies rather than nativeCheckInputs because the
  same lazy import fires at runtime on any tz-aware duckdb result.
- tests/ui/.../test_yank_to_line_end_y_dollar: the "tests/ui/"
  entry in disabledTests never matches — disabledTests feeds
  pytest -k, a name expression, and a path is not a test name — so
  the UI suite ran anyway ("UI tests fail in the sandbox" per the
  existing comment) and a 0.15 s timer-based test races widget
  teardown. Moved to disabledTestPaths, which deselects the path
  as intended.

With both: 1488 passed, 693 skipped, 0 failed (was 2 failed), and
the UI suite is excluded at collection (checkPhase 69 s vs 178 s).

Assisted-by: Claude Code (Claude Fable 5)
2026-08-13 21:41:12 +10:00

74 lines
1.5 KiB
Nix

{
fetchFromGitHub,
lib,
python3Packages,
versionCheckHook,
writableTmpDirAsHomeHook,
}:
python3Packages.buildPythonApplication (finalAttrs: {
pname = "sqlit-tui";
version = "1.6.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "Maxteabag";
repo = "sqlit";
tag = "v${finalAttrs.version}";
hash = "sha256-LAWlUnRa+i+XQN8Sl7ri4i0UGjyqV7MTz1X+XgNDAcI=";
};
build-system = with python3Packages; [
hatch-vcs
hatchling
setuptools-scm
];
dependencies = with python3Packages; [
docker
duckdb
keyring
mysql-connector-python
oracledb
paramiko
psycopg2
pyodbc
pyperclip
pytz
sqlparse
sshtunnel
textual
textual-fastdatatable
];
nativeCheckInputs = [
versionCheckHook
writableTmpDirAsHomeHook
]
++ (with python3Packages; [
pytest-asyncio
pytestCheckHook
]);
pythonImportsCheck = [ "sqlit" ];
disabledTestPaths = [
"tests/ui/" # UI tests fail in the sandbox
];
disabledTests = [
"test_installer_cancel_terminates_process" # timeout error
"test_detect_strategy_pip_user_fallback" # AssertionError: assert 'externally-managed' == 'pip-user'
];
meta = {
description = "Lightweight TUI for SQL Server, PostgreSQL, MySQL, SQLite, and more";
homepage = "https://github.com/Maxteabag/sqlit";
changelog = "https://github.com/Maxteabag/sqlit/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ gaelj ];
mainProgram = "sqlit";
};
})