depot/third_party/nixpkgs/pkgs/development/python-modules/sqlglot/default.nix
Default email c7cb07f092 Project import generated by Copybara.
GitOrigin-RevId: 1536926ef5621b09bba54035ae2bb6d806d72ac8
2024-02-29 21:09:43 +01:00

57 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, duckdb
, fetchFromGitHub
, pytestCheckHook
, python-dateutil
, pythonOlder
, setuptools
, setuptools-scm
}:
buildPythonPackage rec {
pname = "sqlglot";
version = "21.1.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
repo = "sqlglot";
owner = "tobymao";
rev = "refs/tags/v${version}";
hash = "sha256-xMKDkhotVBkLzn+f9RMGCPfWTF4Rz9a193nSJv5z+iA=";
};
nativeBuildInputs = [
setuptools
setuptools-scm
];
propagatedBuildInputs = [
# Optional dependency used in the sqlglot optimizer
python-dateutil
];
nativeCheckInputs = [
pytestCheckHook
duckdb
];
disabledTestPaths = [
# These integration tests assume a running Spark instance
"tests/dataframe/integration"
];
pythonImportsCheck = [
"sqlglot"
];
meta = with lib; {
description = "A no dependency Python SQL parser, transpiler, and optimizer";
homepage = "https://github.com/tobymao/sqlglot";
changelog = "https://github.com/tobymao/sqlglot/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
};
}