2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
duckdb,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
|
|
|
python-dateutil,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
2022-09-22 12:36:57 +00:00
|
|
|
}:
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sqlglot";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "25.20.1";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "sqlglot";
|
|
|
|
owner = "tobymao";
|
2024-01-25 14:12:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-RE9Hbb3g6j4j5X2ksjcBZ610RcV7Zd3YaKaBIUyD2vU=";
|
2022-09-22 12:36:57 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
# Optional dependency used in the sqlglot optimizer
|
|
|
|
python-dateutil
|
|
|
|
];
|
2022-09-22 12:36:57 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
duckdb
|
|
|
|
];
|
2023-02-16 17:41:37 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "sqlglot" ];
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "No dependency Python SQL parser, transpiler, and optimizer";
|
2022-09-22 12:36:57 +00:00
|
|
|
homepage = "https://github.com/tobymao/sqlglot";
|
2024-01-25 14:12:00 +00:00
|
|
|
changelog = "https://github.com/tobymao/sqlglot/blob/v${version}/CHANGELOG.md";
|
2022-09-22 12:36:57 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|