python3Packages.harlequin-odbc: init at 0.4.0 and add flag (#527799)

This commit is contained in:
Gaétan Lepage
2026-10-14 17:46:19 +00:00
committed by GitHub
3 changed files with 63 additions and 2 deletions

View File

@@ -9,8 +9,8 @@
writableTmpDirAsHomeHook,
withPostgresAdapter ? true,
withBigQueryAdapter ? true,
withOdbcAdapter ? true,
}:
python3Packages.buildPythonApplication (finalAttrs: {
pname = "harlequin";
version = "2.16.1";
@@ -61,7 +61,8 @@ python3Packages.buildPythonApplication (finalAttrs: {
wcwidth
]
++ lib.optionals withPostgresAdapter [ harlequin-postgres ]
++ lib.optionals withBigQueryAdapter [ harlequin-bigquery ];
++ lib.optionals withBigQueryAdapter [ harlequin-bigquery ]
++ lib.optionals withOdbcAdapter [ harlequin-odbc ];
pythonImportsCheck = [
"harlequin"
@@ -112,6 +113,12 @@ python3Packages.buildPythonApplication (finalAttrs: {
++ lib.optionals (!stdenv.hostPlatform.isx86_64) [
# Test incorrectly tries to load a dylib/so compiled for x86_64
"test_load_extension"
]
++ lib.optionals withOdbcAdapter [
# harlequin-odbc declares no adapter options (its connection string is a
# positional argument), and this test requires every installed adapter to
# declare at least one.
"test_spec_covers_every_installed_adapter"
];
disabledTestPaths = [

View File

@@ -0,0 +1,52 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
hatchling,
duckdb,
pyodbc,
}:
buildPythonPackage (finalAttrs: {
pname = "harlequin-odbc";
version = "0.4.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "tconbeer";
repo = "harlequin-odbc";
tag = "v${finalAttrs.version}";
hash = "sha256-U0z7fgBzdL+PRhll6AH4DziqY26kVYA4qkOEbZbWF1g=";
};
build-system = [
hatchling
];
# harlequin loads this adapter as a plugin, so depending on harlequin would
# create a cycle, as harlequin can depend on this package.
pythonRemoveDeps = [
"harlequin"
];
dependencies = [
pyodbc
]
++ lib.optionals (pythonAtLeast "3.14") [
duckdb
];
# The test suite needs harlequin (removed above) and a live database
# reachable over ODBC.
doCheck = false;
meta = {
description = "A Harlequin adapter for ODBC drivers";
homepage = "https://github.com/tconbeer/harlequin-odbc";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
c4patino
];
};
})

View File

@@ -7547,6 +7547,8 @@ self: super: with self; {
harlequin-bigquery = callPackage ../development/python-modules/harlequin-bigquery { };
harlequin-odbc = callPackage ../development/python-modules/harlequin-odbc { };
harlequin-postgres = callPackage ../development/python-modules/harlequin-postgres { };
hass-client = callPackage ../development/python-modules/hass-client { };