github-haystack 1.0.1__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- github_haystack-1.1.0/CHANGELOG.md +20 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/PKG-INFO +1 -1
- {github_haystack-1.0.1 → github_haystack-1.1.0}/pyproject.toml +8 -29
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/components/connectors/github/repo_forker.py +1 -2
- github_haystack-1.1.0/src/haystack_integrations/components/connectors/py.typed +0 -0
- github_haystack-1.1.0/src/haystack_integrations/prompts/py.typed +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/file_editor_tool.py +0 -3
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/issue_commenter_tool.py +0 -3
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/issue_viewer_tool.py +0 -3
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/pr_creator_tool.py +0 -3
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/repo_viewer_tool.py +0 -3
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/utils.py +11 -5
- github_haystack-1.1.0/src/haystack_integrations/tools/py.typed +0 -0
- github_haystack-1.0.1/CHANGELOG.md +0 -9
- {github_haystack-1.0.1 → github_haystack-1.1.0}/.gitignore +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/LICENSE.txt +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/README.md +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/pydoc/config.yml +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/components/connectors/github/__init__.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/components/connectors/github/file_editor.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/components/connectors/github/issue_commenter.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/components/connectors/github/issue_viewer.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/components/connectors/github/pr_creator.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/components/connectors/github/repo_viewer.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/__init__.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/context_prompt.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/file_editor_prompt.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/issue_commenter_prompt.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/issue_viewer_prompt.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/pr_creator_prompt.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/repo_viewer_prompt.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/system_prompt.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/__init__.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/__init__.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_file_editor.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_file_editor_tool.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_issue_commenter.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_issue_commenter_tool.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_issue_viewer.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_issue_viewer_tool.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_pr_creator.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_pr_creator_tool.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_repo_forker.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_repo_viewer.py +0 -0
- {github_haystack-1.0.1 → github_haystack-1.1.0}/tests/test_repo_viewer_tool.py +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [integrations/github-v1.0.1] - 2025-06-12
|
|
4
|
+
|
|
5
|
+
### 🐛 Bug Fixes
|
|
6
|
+
|
|
7
|
+
- Prompts and schemas of GitHubIssueCommenterTool and GitHubIssueViewerTool now properly explain url parameter (#1929)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 🧹 Chores
|
|
11
|
+
|
|
12
|
+
- Align core-integrations Hatch scripts (#1898)
|
|
13
|
+
|
|
14
|
+
## [integrations/github-v1.0.0] - 2025-05-28
|
|
15
|
+
|
|
16
|
+
### 🚀 Features
|
|
17
|
+
|
|
18
|
+
- Add GitHub integration with components, tools, and prompts (#1637)
|
|
19
|
+
|
|
20
|
+
<!-- generated by git-cliff -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: github-haystack
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Haystack components for interacting with GitHub repositories
|
|
5
5
|
Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/github
|
|
6
6
|
Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/github/README.md
|
|
@@ -66,23 +66,15 @@ integration = 'pytest -m "integration" {args:tests}'
|
|
|
66
66
|
all = 'pytest {args:tests}'
|
|
67
67
|
cov-retry = 'all --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x'
|
|
68
68
|
|
|
69
|
-
types = "mypy
|
|
69
|
+
types = """mypy -p haystack_integrations.components.connectors.github \
|
|
70
|
+
-p haystack_integrations.prompts.github \
|
|
71
|
+
-p haystack_integrations.tools.github {args}"""
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
detached = true
|
|
77
|
-
dependencies = ["pip", "black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
|
|
78
|
-
|
|
79
|
-
[tool.hatch.envs.lint.scripts]
|
|
80
|
-
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
|
|
81
|
-
|
|
82
|
-
[tool.black]
|
|
83
|
-
target-version = ["py38"]
|
|
84
|
-
line-length = 120
|
|
85
|
-
skip-string-normalization = true
|
|
73
|
+
[tool.mypy]
|
|
74
|
+
install_types = true
|
|
75
|
+
non_interactive = true
|
|
76
|
+
check_untyped_defs = true
|
|
77
|
+
disallow_incomplete_defs = true
|
|
86
78
|
|
|
87
79
|
[tool.ruff]
|
|
88
80
|
target-version = "py38"
|
|
@@ -160,22 +152,9 @@ omit = ["*/tests/*", "*/__init__.py"]
|
|
|
160
152
|
show_missing = true
|
|
161
153
|
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
|
|
162
154
|
|
|
163
|
-
|
|
164
|
-
[[tool.mypy.overrides]]
|
|
165
|
-
module = [
|
|
166
|
-
"github.*",
|
|
167
|
-
"haystack.*",
|
|
168
|
-
"haystack_integrations.*",
|
|
169
|
-
"openai.*",
|
|
170
|
-
"pytest.*",
|
|
171
|
-
"numpy.*",
|
|
172
|
-
]
|
|
173
|
-
ignore_missing_imports = true
|
|
174
|
-
|
|
175
155
|
[tool.pytest.ini_options]
|
|
176
156
|
addopts = "--strict-markers"
|
|
177
157
|
markers = [
|
|
178
158
|
"integration: integration tests",
|
|
179
|
-
"unit: unit tests",
|
|
180
159
|
]
|
|
181
160
|
log_cli = true
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import re
|
|
5
|
+
import time
|
|
5
6
|
from typing import Any, Dict, Optional
|
|
6
7
|
|
|
7
8
|
import requests
|
|
@@ -274,8 +275,6 @@ class GitHubRepoForker:
|
|
|
274
275
|
|
|
275
276
|
# Wait for fork completion if requested
|
|
276
277
|
if self.wait_for_completion:
|
|
277
|
-
import time
|
|
278
|
-
|
|
279
278
|
start_time = time.time()
|
|
280
279
|
|
|
281
280
|
while time.time() - start_time < self.max_wait_seconds:
|
|
File without changes
|
|
File without changes
|
|
@@ -62,9 +62,6 @@ class GitHubFileEditorTool(ComponentTool):
|
|
|
62
62
|
"documents": {"handler": custom_handler}
|
|
63
63
|
}
|
|
64
64
|
"""
|
|
65
|
-
self.name = name
|
|
66
|
-
self.description = description
|
|
67
|
-
self.parameters = parameters
|
|
68
65
|
self.github_token = github_token
|
|
69
66
|
self.repo = repo
|
|
70
67
|
self.branch = branch
|
|
@@ -60,9 +60,6 @@ class GitHubIssueCommenterTool(ComponentTool):
|
|
|
60
60
|
"documents": {"handler": custom_handler}
|
|
61
61
|
}
|
|
62
62
|
"""
|
|
63
|
-
self.name = name
|
|
64
|
-
self.description = description
|
|
65
|
-
self.parameters = parameters
|
|
66
63
|
self.github_token = github_token
|
|
67
64
|
self.raise_on_failure = raise_on_failure
|
|
68
65
|
self.retry_attempts = retry_attempts
|
|
@@ -60,9 +60,6 @@ class GitHubIssueViewerTool(ComponentTool):
|
|
|
60
60
|
"documents": {"handler": custom_handler}
|
|
61
61
|
}
|
|
62
62
|
"""
|
|
63
|
-
self.name = name
|
|
64
|
-
self.description = description
|
|
65
|
-
self.parameters = parameters
|
|
66
63
|
self.github_token = github_token
|
|
67
64
|
self.raise_on_failure = raise_on_failure
|
|
68
65
|
self.retry_attempts = retry_attempts
|
|
@@ -58,9 +58,6 @@ class GitHubPRCreatorTool(ComponentTool):
|
|
|
58
58
|
"documents": {"handler": custom_handler}
|
|
59
59
|
}
|
|
60
60
|
"""
|
|
61
|
-
self.name = name
|
|
62
|
-
self.description = description
|
|
63
|
-
self.parameters = parameters
|
|
64
61
|
self.github_token = github_token
|
|
65
62
|
self.raise_on_failure = raise_on_failure
|
|
66
63
|
self.outputs_to_string = outputs_to_string
|
|
@@ -67,9 +67,6 @@ class GitHubRepoViewerTool(ComponentTool):
|
|
|
67
67
|
"documents": {"handler": custom_handler}
|
|
68
68
|
}
|
|
69
69
|
"""
|
|
70
|
-
self.name = name
|
|
71
|
-
self.description = description
|
|
72
|
-
self.parameters = parameters
|
|
73
70
|
self.github_token = github_token
|
|
74
71
|
self.repo = repo
|
|
75
72
|
self.branch = branch
|
{github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/utils.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
|
-
from typing import Any, Callable, Dict, List, Union
|
|
5
|
+
from typing import Any, Callable, Dict, List, Optional, Union
|
|
6
6
|
|
|
7
7
|
from haystack import Document
|
|
8
8
|
from haystack.utils.callable_serialization import deserialize_callable, serialize_callable
|
|
@@ -20,10 +20,10 @@ def message_handler(documents: List[Document], max_length: int = 150_000) -> str
|
|
|
20
20
|
result_str = ""
|
|
21
21
|
for document in documents:
|
|
22
22
|
if document.meta["type"] in ["file", "dir", "error"]:
|
|
23
|
-
result_str += document.content + "\n"
|
|
23
|
+
result_str += document.content or "" + "\n"
|
|
24
24
|
else:
|
|
25
25
|
result_str += f"File Content for {document.meta['path']}\n\n"
|
|
26
|
-
result_str += document.content
|
|
26
|
+
result_str += document.content or ""
|
|
27
27
|
|
|
28
28
|
if len(result_str) > max_length:
|
|
29
29
|
result_str = result_str[:max_length] + "...(large file can't be fully displayed)"
|
|
@@ -33,8 +33,8 @@ def message_handler(documents: List[Document], max_length: int = 150_000) -> str
|
|
|
33
33
|
|
|
34
34
|
def serialize_handlers(
|
|
35
35
|
serialized: Dict[str, Any],
|
|
36
|
-
outputs_to_state: Dict[str, Dict[str, Union[str, Callable]]],
|
|
37
|
-
outputs_to_string: Dict[str, Union[str, Callable[[Any], str]]],
|
|
36
|
+
outputs_to_state: Optional[Dict[str, Dict[str, Union[str, Callable]]]],
|
|
37
|
+
outputs_to_string: Optional[Dict[str, Union[str, Callable[[Any], str]]]],
|
|
38
38
|
) -> None:
|
|
39
39
|
"""
|
|
40
40
|
Serializes callable handlers in outputs_to_state and outputs_to_string.
|
|
@@ -48,12 +48,18 @@ def serialize_handlers(
|
|
|
48
48
|
for key, config in outputs_to_state.items():
|
|
49
49
|
serialized_config = config.copy()
|
|
50
50
|
if "handler" in config:
|
|
51
|
+
if not callable(config["handler"]):
|
|
52
|
+
msg = f"Handler for outputs_to_state[{key}] is not a callable"
|
|
53
|
+
raise ValueError(msg)
|
|
51
54
|
serialized_config["handler"] = serialize_callable(config["handler"])
|
|
52
55
|
serialized_outputs[key] = serialized_config
|
|
53
56
|
serialized["outputs_to_state"] = serialized_outputs
|
|
54
57
|
|
|
55
58
|
if outputs_to_string is not None and "handler" in outputs_to_string:
|
|
56
59
|
serialized_string = outputs_to_string.copy()
|
|
60
|
+
if not callable(outputs_to_string["handler"]):
|
|
61
|
+
msg = "Handler for outputs_to_string is not a callable"
|
|
62
|
+
raise ValueError(msg)
|
|
57
63
|
serialized_string["handler"] = serialize_callable(outputs_to_string["handler"])
|
|
58
64
|
serialized["outputs_to_string"] = serialized_string
|
|
59
65
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/prompts/github/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_haystack-1.0.1 → github_haystack-1.1.0}/src/haystack_integrations/tools/github/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|