nixpkgs/pkgs/development/python-modules/sqlglot/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.0 KiB
Nix
Raw Normal View History

2022-09-18 14:05:23 +03:00
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytestCheckHook
, python-dateutil
, duckdb
, setuptools-scm
2022-09-18 14:05:23 +03:00
}:
buildPythonPackage rec {
pname = "sqlglot";
version = "17.14.2";
2022-09-18 14:05:23 +03:00
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
repo = "sqlglot";
owner = "tobymao";
rev = "v${version}";
hash = "sha256-aImshQ5jf0k62ucpK4X8G7uHGAFQkhGgjMYo4mvSvew=";
2022-09-18 14:05:23 +03:00
};
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [ setuptools-scm ];
# optional dependency used in the sqlglot optimizer
2022-09-18 14:05:23 +03:00
propagatedBuildInputs = [ python-dateutil ];
nativeCheckInputs = [ pytestCheckHook duckdb ];
# these integration tests assume a running Spark instance
disabledTestPaths = [ "tests/dataframe/integration" ];
2022-09-18 14:05:23 +03:00
pythonImportsCheck = [ "sqlglot" ];
meta = with lib; {
description = "A no dependency Python SQL parser, transpiler, and optimizer";
homepage = "https://github.com/tobymao/sqlglot";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
};
}