Unverified Commit 59c2537d authored by Doron Behar's avatar Doron Behar Committed by GitHub
Browse files

python312Packages.tree-sitter-sql: init at 0.3.8 (#413616)

parents 90fccd02 baec4b1c
Loading
Loading
Loading
Loading
+59 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  tree-sitter-sql,

  #optional-dependencies
  tree-sitter,
}:
buildPythonPackage rec {
  pname = "tree-sitter-sql";
  version = "0.3.8";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "DerekStride";
    repo = "tree-sitter-sql";
    tag = "v${version}";
    hash = "sha256-8gdbbz187sV8I+PJHubFyyQwGUqvo05Yw1DX7rOK4DI=";
  };

  postUnpack = ''
    cp -rf ${tree-sitter-sql.passthru.parsers}/* $sourceRoot
  '';

  build-system = [
    setuptools
  ];

  passthru = {
    # As mentioned in https://github.com/DerekStride/tree-sitter-sql README
    # generated tree sitter parser files necessary for compilation
    # are separately distributed on the gh-pages branch
    parsers = fetchFromGitHub {
      owner = "DerekStride";
      repo = "tree-sitter-sql";
      rev = "9853b887c5e4309de273922b681cc7bc09e30c78/gh-pages";
      hash = "sha256-p60nphbSN+O5fOlL06nw0qgQFpmvoNCTmLzDvUC/JGs=";
    };
  };

  optional-dependencies = {
    core = [
      tree-sitter
    ];
  };

  pythonImportsCheck = [ "tree_sitter_sql" ];

  meta = {
    description = "sql grammar for tree-sitter";
    homepage = "https://github.com/DerekStride/tree-sitter-sql";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ pcboy ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -17911,6 +17911,8 @@ self: super: with self; {
  tree-sitter-rust = callPackage ../development/python-modules/tree-sitter-rust { };
  tree-sitter-sql = callPackage ../development/python-modules/tree-sitter-sql { };
  tree-sitter-yaml = callPackage ../development/python-modules/tree-sitter-yaml { };
  treelib = callPackage ../development/python-modules/treelib { };