vectorcode: init at 0.5.3 (#394565)

This commit is contained in:
Gaétan Lepage
2025-04-02 00:40:06 +02:00
committed by GitHub
6 changed files with 137 additions and 54 deletions
+86
View File
@@ -0,0 +1,86 @@
{
lib,
python3Packages,
fetchFromGitHub,
versionCheckHook,
}:
python3Packages.buildPythonApplication rec {
pname = "vectorcode";
version = "0.5.3";
pyproject = true;
src = fetchFromGitHub {
owner = "Davidyz";
repo = "VectorCode";
tag = version;
hash = "sha256-Vfo+wY51b3triiDhURlMl1iKNlYDy7eqEtT9/RVNZCM=";
};
build-system = with python3Packages; [
pdm-backend
];
dependencies = with python3Packages; [
chromadb
httpx
numpy
pathspec
psutil
pygments
sentence-transformers
shtab
tabulate
transformers
tree-sitter
tree-sitter-language-pack
];
optional-dependencies = with python3Packages; {
intel = [
openvino
optimum
];
legacy = [
numpy
torch
transformers
];
lsp = [
lsprotocol
pygls
];
mcp = [
mcp
pydantic
];
};
pythonImportsCheck = [ "vectorcode" ];
nativeCheckInputs =
[
versionCheckHook
]
++ (with python3Packages; [
mcp
pygls
pytestCheckHook
]);
versionCheckProgramArg = "version";
disabledTests = [
# Require internet access
"test_get_embedding_function"
"test_get_embedding_function_fallback"
];
meta = {
description = "Code repository indexing tool to supercharge your LLM experience";
homepage = "https://github.com/Davidyz/VectorCode";
changelog = "https://github.com/Davidyz/VectorCode/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ GaetanLepage ];
mainProgram = "vectorcode";
};
}
@@ -2,30 +2,25 @@
lib,
fetchFromGitHub,
buildPythonPackage,
pythonOlder,
cargo,
rustPlatform,
cargo,
rustc,
setuptools,
wheel,
tree-sitter,
pytestCheckHook,
}:
let
buildPythonPackage rec {
pname = "tree-sitter-c-sharp";
version = "0.23.1";
pyproject = true;
src = fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter-c-sharp";
rev = "v${version}";
tag = "v${version}";
hash = "sha256-weH0nyLpvVK/OpgvOjTuJdH2Hm4a1wVshHmhUdFq3XA=";
};
in
buildPythonPackage {
pname = "tree-sitter-c-sharp";
inherit version src;
pyproject = true;
disabled = pythonOlder "3.9";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
@@ -37,7 +32,6 @@ buildPythonPackage {
rustPlatform.cargoSetupHook
rustc
setuptools
wheel
];
optional-dependencies = {
@@ -46,8 +40,11 @@ buildPythonPackage {
];
};
pythonImportsCheck = [
"tree_sitter_c_sharp"
pythonImportsCheck = [ "tree_sitter_c_sharp" ];
nativeCheckInputs = [
pytestCheckHook
tree-sitter
];
meta = {
@@ -1,31 +1,26 @@
{
lib,
fetchFromGitHub,
buildPythonPackage,
pythonOlder,
cargo,
fetchFromGitHub,
rustPlatform,
cargo,
rustc,
setuptools,
wheel,
tree-sitter,
pytestCheckHook,
}:
let
buildPythonPackage rec {
pname = "tree-sitter-embedded-template";
version = "0.23.2";
pyproject = true;
src = fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter-embedded-template";
rev = "v${version}";
tag = "v${version}";
hash = "sha256-C2Lo3tT2363O++ycXiR6x0y+jy2zlmhcKp7t1LhvCe8=";
};
in
buildPythonPackage {
pname = "tree-sitter-embedded-template";
inherit version src;
pyproject = true;
disabled = pythonOlder "3.9";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
@@ -37,7 +32,6 @@ buildPythonPackage {
rustPlatform.cargoSetupHook
rustc
setuptools
wheel
];
optional-dependencies = {
@@ -46,8 +40,11 @@ buildPythonPackage {
];
};
pythonImportsCheck = [
"tree_sitter_embedded_template"
pythonImportsCheck = [ "tree_sitter_embedded_template" ];
nativeCheckInputs = [
pytestCheckHook
tree-sitter
];
meta = {
@@ -1,26 +1,28 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchPypi,
# build-system
cython,
setuptools,
typing-extensions,
# dependencies
tree-sitter,
tree-sitter-c-sharp,
tree-sitter-embedded-template,
tree-sitter-yaml,
}:
let
version = "0.6.1";
in
buildPythonPackage {
buildPythonPackage rec {
pname = "tree-sitter-language-pack";
inherit version;
version = "0.6.1";
pyproject = true;
disabled = pythonOlder "3.9";
# Using the GitHub sources necessitates fetching the treesitter grammar parsers by using a vendored script:
# https://github.com/Goldziher/tree-sitter-language-pack/blob/main/scripts/clone_vendors.py
# The pypi archive has the benefit of already vendoring those dependencies which makes packaging easier on our side
src = fetchPypi {
pname = "tree_sitter_language_pack";
inherit version;
@@ -45,9 +47,13 @@ buildPythonPackage {
"tree_sitter_language_pack.bindings"
];
# No tests in the pypi archive
doCheck = false;
meta = {
description = "Comprehensive collection of tree-sitter languages";
homepage = "https://github.com/Goldziher/tree-sitter-language-pack/";
homepage = "https://github.com/Goldziher/tree-sitter-language-pack";
changelog = "https://github.com/Goldziher/tree-sitter-language-pack/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ yzx9 ];
};
@@ -1,31 +1,26 @@
{
lib,
fetchFromGitHub,
buildPythonPackage,
pythonOlder,
cargo,
fetchFromGitHub,
rustPlatform,
cargo,
rustc,
setuptools,
wheel,
tree-sitter,
pytestCheckHook,
}:
let
buildPythonPackage rec {
pname = "tree-sitter-yaml";
version = "0.7.0";
pyproject = true;
src = fetchFromGitHub {
owner = "tree-sitter-grammars";
repo = "tree-sitter-yaml";
rev = "v${version}";
tag = "v${version}";
hash = "sha256-23/zcjnQUQt32N2EdQMzWM9srkXfQxlBvOo7FWH6rnw=";
};
in
buildPythonPackage {
pname = "tree-sitter-yaml";
inherit version src;
pyproject = true;
disabled = pythonOlder "3.9";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
@@ -37,7 +32,6 @@ buildPythonPackage {
rustPlatform.cargoSetupHook
rustc
setuptools
wheel
];
optional-dependencies = {
@@ -46,8 +40,11 @@ buildPythonPackage {
];
};
pythonImportsCheck = [
"tree_sitter_yaml"
pythonImportsCheck = [ "tree_sitter_yaml" ];
nativeCheckInputs = [
pytestCheckHook
tree-sitter
];
meta = {
+2 -2
View File
@@ -17406,10 +17406,10 @@ self: super: with self; {
tree-sitter-json = callPackage ../development/python-modules/tree-sitter-json { };
tree-sitter-languages = callPackage ../development/python-modules/tree-sitter-languages { };
tree-sitter-language-pack = callPackage ../development/python-modules/tree-sitter-language-pack { };
tree-sitter-languages = callPackage ../development/python-modules/tree-sitter-languages { };
tree-sitter-make = callPackage ../development/python-modules/tree-sitter-make { };
tree-sitter-python = callPackage ../development/python-modules/tree-sitter-python { };