gitcode-api 1.2.15__tar.gz → 1.2.17__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.
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/PKG-INFO +4 -2
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/README.md +3 -1
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/__init__.py +11 -2
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/_base_client.py +5 -6
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/_cli_banner.py +15 -3
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/cli.py +3 -3
- gitcode_api-1.2.17/gitcode_api/constants.py +8 -0
- gitcode_api-1.2.17/gitcode_api/version.txt +1 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api.egg-info/PKG-INFO +4 -2
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api.egg-info/SOURCES.txt +1 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/pyproject.toml +2 -2
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_collaboration_templates.py +2 -2
- gitcode_api-1.2.15/gitcode_api/version.txt +0 -1
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/LICENSE +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/__main__.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/_base_resource.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/_client.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/_exceptions.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/_models.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/llm/__init__.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/llm/_tool.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/llm/jiuwen.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/llm/mcp.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/llm/openai.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/py.typed +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/resources/__init__.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/resources/_shared.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/resources/account.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/resources/collaboration.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/resources/misc.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/resources/repositories.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/run_mcp.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api/utils.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api.egg-info/dependency_links.txt +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api.egg-info/entry_points.txt +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api.egg-info/requires.txt +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/gitcode_api.egg-info/top_level.txt +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/setup.cfg +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_base_client.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_build_manifest.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_cli.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_client.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_llm_tools.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_models.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_resources_account.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_resources_collaboration.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_resources_misc.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_resources_repositories.py +0 -0
- {gitcode_api-1.2.15 → gitcode_api-1.2.17}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitcode-api
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.17
|
|
4
4
|
Summary: Easy to use Python SDK for the GitCode REST API. Providing builtin CLI tool, and optional LLM integration (MCP, OpenAI tool, and openJiuwen tool) for agents. Community-maintained.
|
|
5
5
|
Author-email: Hugo Huang <hugo@hugohuang.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -37,7 +37,7 @@ Dynamic: license-file
|
|
|
37
37
|
|
|
38
38
|
# GitCode-API
|
|
39
39
|
|
|
40
|
-
[](https://pypi.org/project/gitcode-api) [](https://pepy.tech/projects/gitcode-api) [](https://www.codefactor.io/repository/github/trenza1ore/gitcode-api)
|
|
41
41
|
[](https://cursor.com/en/install-mcp?name=GitCode%20API&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJnaXRjb2RlLWFwaVttY3BdIiwiZ2l0Y29kZS1hcGkiLCJzZXJ2ZSJdLCJlbnYiOnsiR0lUQ09ERV9BQ0NFU1NfVE9LRU4iOiIke2lucHV0OmdpdGNvZGVfYWNjZXNzX3Rva2VufSJ9LCJpbnB1dHMiOlt7ImlkIjoiZ2l0Y29kZV9hY2Nlc3NfdG9rZW4iLCJ0eXBlIjoicHJvbXB0U3RyaW5nIiwiZGVzY3JpcHRpb24iOiJFbnRlciBHSVRDT0RFX0FDQ0VTU19UT0tFTiIsInBhc3N3b3JkIjp0cnVlfV19) [](https://vscode.dev/redirect/mcp/install?name=GitCode%20API&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22--from%22%2C%22gitcode-api%5Bmcp%5D%22%2C%22gitcode-api%22%2C%22serve%22%5D%2C%22env%22%3A%7B%22GITCODE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agitcode_access_token%7D%22%7D%2C%22inputs%22%3A%5B%7B%22id%22%3A%22gitcode_access_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Enter%20GITCODE_ACCESS_TOKEN%22%2C%22password%22%3Atrue%7D%5D%7D)
|
|
42
42
|
[](https://github.com/Trenza1ore/GitCode-API) [](https://gitcode.com/SushiNinja/GitCode-API)
|
|
43
43
|
|
|
@@ -427,6 +427,8 @@ with GitCode(
|
|
|
427
427
|
pulls = client.pulls.list(state="open", per_page=5)
|
|
428
428
|
```
|
|
429
429
|
|
|
430
|
+
> Default CA bundle / `verify` behavior for the built-in `httpx` client is documented under **TLS and certificate verification** in [`docs/sdk/quickstart.rst`](docs/sdk/quickstart.rst) and summarized at the top of [`docs/sdk/client_api.rst`](docs/sdk/client_api.rst).
|
|
431
|
+
|
|
430
432
|
Use `httpx.AsyncClient(verify=...)` with `AsyncGitCode` for async code.
|
|
431
433
|
|
|
432
434
|
The OpenAI tool (`GitCodeOpenAITool`), MCP helpers, and `create_openjiuwen_gitcode_api_tool` accept the same `client=` / `async_client=` arguments (OpenAI and MCP also accept a shared `GitCodeLLMTool` via `tool=`). Build `GitCode` / `AsyncGitCode` with your custom `http_client` once and pass it through so LLM tool calls reuse the same TLS settings.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GitCode-API
|
|
2
2
|
|
|
3
|
-
[](https://pypi.org/project/gitcode-api) [](https://pepy.tech/projects/gitcode-api) [](https://www.codefactor.io/repository/github/trenza1ore/gitcode-api)
|
|
4
4
|
[](https://cursor.com/en/install-mcp?name=GitCode%20API&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJnaXRjb2RlLWFwaVttY3BdIiwiZ2l0Y29kZS1hcGkiLCJzZXJ2ZSJdLCJlbnYiOnsiR0lUQ09ERV9BQ0NFU1NfVE9LRU4iOiIke2lucHV0OmdpdGNvZGVfYWNjZXNzX3Rva2VufSJ9LCJpbnB1dHMiOlt7ImlkIjoiZ2l0Y29kZV9hY2Nlc3NfdG9rZW4iLCJ0eXBlIjoicHJvbXB0U3RyaW5nIiwiZGVzY3JpcHRpb24iOiJFbnRlciBHSVRDT0RFX0FDQ0VTU19UT0tFTiIsInBhc3N3b3JkIjp0cnVlfV19) [](https://vscode.dev/redirect/mcp/install?name=GitCode%20API&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22--from%22%2C%22gitcode-api%5Bmcp%5D%22%2C%22gitcode-api%22%2C%22serve%22%5D%2C%22env%22%3A%7B%22GITCODE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agitcode_access_token%7D%22%7D%2C%22inputs%22%3A%5B%7B%22id%22%3A%22gitcode_access_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Enter%20GITCODE_ACCESS_TOKEN%22%2C%22password%22%3Atrue%7D%5D%7D)
|
|
5
5
|
[](https://github.com/Trenza1ore/GitCode-API) [](https://gitcode.com/SushiNinja/GitCode-API)
|
|
6
6
|
|
|
@@ -390,6 +390,8 @@ with GitCode(
|
|
|
390
390
|
pulls = client.pulls.list(state="open", per_page=5)
|
|
391
391
|
```
|
|
392
392
|
|
|
393
|
+
> Default CA bundle / `verify` behavior for the built-in `httpx` client is documented under **TLS and certificate verification** in [`docs/sdk/quickstart.rst`](docs/sdk/quickstart.rst) and summarized at the top of [`docs/sdk/client_api.rst`](docs/sdk/client_api.rst).
|
|
394
|
+
|
|
393
395
|
Use `httpx.AsyncClient(verify=...)` with `AsyncGitCode` for async code.
|
|
394
396
|
|
|
395
397
|
The OpenAI tool (`GitCodeOpenAITool`), MCP helpers, and `create_openjiuwen_gitcode_api_tool` accept the same `client=` / `async_client=` arguments (OpenAI and MCP also accept a shared `GitCodeLLMTool` via `tool=`). Build `GitCode` / `AsyncGitCode` with your custom `http_client` once and pass it through so LLM tool calls reuse the same TLS settings.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"""Public package exports for the GitCode SDK."""
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import re
|
|
4
|
+
from importlib.metadata import metadata
|
|
5
|
+
from typing import cast
|
|
4
6
|
|
|
7
|
+
from . import constants
|
|
5
8
|
from ._client import AsyncGitCode, GitCode
|
|
6
9
|
from ._exceptions import (
|
|
7
10
|
GitCodeAPIError,
|
|
@@ -11,10 +14,16 @@ from ._exceptions import (
|
|
|
11
14
|
)
|
|
12
15
|
from .utils import as_dict
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
package_meta = metadata("gitcode_api")
|
|
18
|
+
package_desc = cast(str, package_meta.get("Description"))
|
|
19
|
+
readme_uuids = re.findall(r"\&uuid=(\w+)", package_desc, flags=re.ASCII)
|
|
20
|
+
__build_hash__ = readme_uuids[0] if readme_uuids else "unknown"
|
|
21
|
+
__version__ = cast(str, package_meta.get("Version")).strip()
|
|
15
22
|
|
|
16
23
|
__all__ = [
|
|
24
|
+
"constants",
|
|
17
25
|
"__version__",
|
|
26
|
+
"__build_hash__",
|
|
18
27
|
"AsyncGitCode",
|
|
19
28
|
"GitCode",
|
|
20
29
|
"GitCodeAPIError",
|
|
@@ -12,10 +12,7 @@ import httpx
|
|
|
12
12
|
|
|
13
13
|
from ._base_resource import BaseResource
|
|
14
14
|
from ._exceptions import GitCodeConfigurationError, GitCodeHTTPStatusError
|
|
15
|
-
|
|
16
|
-
DEFAULT_BASE_URL = "https://api.gitcode.com/api/v5"
|
|
17
|
-
DEFAULT_TIMEOUT = 30.0
|
|
18
|
-
DEFAULT_TOKEN_ENV = "GITCODE_ACCESS_TOKEN"
|
|
15
|
+
from .constants import DEFAULT_BASE_URL, DEFAULT_CA_ENV, DEFAULT_TIMEOUT, DEFAULT_TOKEN_ENV
|
|
19
16
|
|
|
20
17
|
|
|
21
18
|
def _drop_none_values(mapping: Dict[str, Any]) -> Dict[str, Any]:
|
|
@@ -215,7 +212,8 @@ class SyncAPIClient(BaseGitCodeClient):
|
|
|
215
212
|
) -> None:
|
|
216
213
|
"""Create or reuse an ``httpx.Client`` for synchronous requests."""
|
|
217
214
|
super().__init__(api_key=api_key, owner=owner, repo=repo, base_url=base_url, timeout=timeout, decrypt=decrypt)
|
|
218
|
-
|
|
215
|
+
verify = os.environ.get(DEFAULT_CA_ENV, "").strip() or os.environ.get("REQUESTS_CA_BUNDLE", "").strip() or True
|
|
216
|
+
self._client = http_client or httpx.Client(timeout=self.timeout, verify=verify)
|
|
219
217
|
|
|
220
218
|
def request(
|
|
221
219
|
self,
|
|
@@ -289,7 +287,8 @@ class AsyncAPIClient(BaseGitCodeClient):
|
|
|
289
287
|
) -> None:
|
|
290
288
|
"""Create or reuse an ``httpx.AsyncClient`` for asynchronous requests."""
|
|
291
289
|
super().__init__(api_key=api_key, owner=owner, repo=repo, base_url=base_url, timeout=timeout, decrypt=decrypt)
|
|
292
|
-
|
|
290
|
+
verify = os.environ.get(DEFAULT_CA_ENV, "").strip() or os.environ.get("REQUESTS_CA_BUNDLE", "").strip() or True
|
|
291
|
+
self._client = http_client or httpx.AsyncClient(timeout=self.timeout, verify=verify)
|
|
293
292
|
|
|
294
293
|
async def request(
|
|
295
294
|
self,
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
4
|
from functools import lru_cache
|
|
5
|
+
from importlib.metadata import metadata
|
|
6
|
+
from typing import List, cast
|
|
5
7
|
|
|
6
8
|
# ANSI Colour Codes
|
|
7
9
|
CREDBG = "\033[41m"
|
|
@@ -24,8 +26,18 @@ BANNER = r"""
|
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
@lru_cache(maxsize=1)
|
|
27
|
-
def format_default_welcome(version: str) -> str:
|
|
29
|
+
def format_default_welcome(version: str, build: str) -> str:
|
|
28
30
|
"""Colored banner and version line for the no-arguments launcher (plain if not a TTY)."""
|
|
31
|
+
homepage = "https://gitcode-api.readthedocs.io"
|
|
32
|
+
docspage = "https://gitcode-api.readthedocs.io"
|
|
33
|
+
banner = BANNER
|
|
34
|
+
version = f"Ver. {version} (build {build})"
|
|
35
|
+
for project_url in cast(List[str], metadata("gitcode_api").get_all("Project-URL")):
|
|
36
|
+
if project_url.casefold().startswith("homepage"):
|
|
37
|
+
homepage = project_url.split(", ")[1]
|
|
29
38
|
if sys.stdout.isatty():
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
homepage = f"{CBLU}{homepage}{CEND}"
|
|
40
|
+
docspage = f"{CBLU}{docspage}{CEND}"
|
|
41
|
+
banner = f"{CRED}{BANNER}{CEND}"
|
|
42
|
+
version = f"{CREDBG}{version}{CEND}"
|
|
43
|
+
return f"{banner}\n {version}\n Home Page: {homepage}\n Docs Page: {docspage}\n\n"
|
|
@@ -13,7 +13,7 @@ from typing import Any, Dict, List, Optional, Union, get_args, get_origin
|
|
|
13
13
|
|
|
14
14
|
import httpx
|
|
15
15
|
|
|
16
|
-
from . import GitCode, __version__
|
|
16
|
+
from . import GitCode, __build_hash__, __version__
|
|
17
17
|
from ._base_client import DEFAULT_BASE_URL, DEFAULT_TOKEN_ENV
|
|
18
18
|
from ._cli_banner import format_default_welcome
|
|
19
19
|
from ._exceptions import GitCodeError
|
|
@@ -295,7 +295,7 @@ Each method -h opens with resource.method_signature("<name>") from the Python SD
|
|
|
295
295
|
epilog=epilog,
|
|
296
296
|
formatter_class=_CLIHelpFormatter,
|
|
297
297
|
)
|
|
298
|
-
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
|
|
298
|
+
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__} (build {__build_hash__})")
|
|
299
299
|
|
|
300
300
|
client = _probe_gitcode()
|
|
301
301
|
try:
|
|
@@ -457,7 +457,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
|
|
|
457
457
|
parser = build_parser()
|
|
458
458
|
effective = list(sys.argv[1:] if argv is None else argv)
|
|
459
459
|
if not effective:
|
|
460
|
-
print(format_default_welcome(__version__), end="")
|
|
460
|
+
print(format_default_welcome(__version__, __build_hash__), end="")
|
|
461
461
|
saved_epilog = parser.epilog
|
|
462
462
|
parser.epilog = None
|
|
463
463
|
try:
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""Shared constant values for the GitCode SDK."""
|
|
2
|
+
|
|
3
|
+
DEFAULT_BASE_URL = "https://api.gitcode.com/api/v5"
|
|
4
|
+
DEFAULT_TIMEOUT = 30.0
|
|
5
|
+
DEFAULT_TOKEN_ENV = "GITCODE_ACCESS_TOKEN"
|
|
6
|
+
DEFAULT_CA_ENV = "GITCODE_CA_BUNDLE"
|
|
7
|
+
|
|
8
|
+
__all__ = ["DEFAULT_BASE_URL", "DEFAULT_TIMEOUT", "DEFAULT_TOKEN_ENV", "DEFAULT_CA_ENV"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.2.17
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitcode-api
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.17
|
|
4
4
|
Summary: Easy to use Python SDK for the GitCode REST API. Providing builtin CLI tool, and optional LLM integration (MCP, OpenAI tool, and openJiuwen tool) for agents. Community-maintained.
|
|
5
5
|
Author-email: Hugo Huang <hugo@hugohuang.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -37,7 +37,7 @@ Dynamic: license-file
|
|
|
37
37
|
|
|
38
38
|
# GitCode-API
|
|
39
39
|
|
|
40
|
-
[](https://pypi.org/project/gitcode-api) [](https://pepy.tech/projects/gitcode-api) [](https://www.codefactor.io/repository/github/trenza1ore/gitcode-api)
|
|
41
41
|
[](https://cursor.com/en/install-mcp?name=GitCode%20API&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJnaXRjb2RlLWFwaVttY3BdIiwiZ2l0Y29kZS1hcGkiLCJzZXJ2ZSJdLCJlbnYiOnsiR0lUQ09ERV9BQ0NFU1NfVE9LRU4iOiIke2lucHV0OmdpdGNvZGVfYWNjZXNzX3Rva2VufSJ9LCJpbnB1dHMiOlt7ImlkIjoiZ2l0Y29kZV9hY2Nlc3NfdG9rZW4iLCJ0eXBlIjoicHJvbXB0U3RyaW5nIiwiZGVzY3JpcHRpb24iOiJFbnRlciBHSVRDT0RFX0FDQ0VTU19UT0tFTiIsInBhc3N3b3JkIjp0cnVlfV19) [](https://vscode.dev/redirect/mcp/install?name=GitCode%20API&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22--from%22%2C%22gitcode-api%5Bmcp%5D%22%2C%22gitcode-api%22%2C%22serve%22%5D%2C%22env%22%3A%7B%22GITCODE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Agitcode_access_token%7D%22%7D%2C%22inputs%22%3A%5B%7B%22id%22%3A%22gitcode_access_token%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Enter%20GITCODE_ACCESS_TOKEN%22%2C%22password%22%3Atrue%7D%5D%7D)
|
|
42
42
|
[](https://github.com/Trenza1ore/GitCode-API) [](https://gitcode.com/SushiNinja/GitCode-API)
|
|
43
43
|
|
|
@@ -427,6 +427,8 @@ with GitCode(
|
|
|
427
427
|
pulls = client.pulls.list(state="open", per_page=5)
|
|
428
428
|
```
|
|
429
429
|
|
|
430
|
+
> Default CA bundle / `verify` behavior for the built-in `httpx` client is documented under **TLS and certificate verification** in [`docs/sdk/quickstart.rst`](docs/sdk/quickstart.rst) and summarized at the top of [`docs/sdk/client_api.rst`](docs/sdk/client_api.rst).
|
|
431
|
+
|
|
430
432
|
Use `httpx.AsyncClient(verify=...)` with `AsyncGitCode` for async code.
|
|
431
433
|
|
|
432
434
|
The OpenAI tool (`GitCodeOpenAITool`), MCP helpers, and `create_openjiuwen_gitcode_api_tool` accept the same `client=` / `async_client=` arguments (OpenAI and MCP also accept a shared `GitCodeLLMTool` via `tool=`). Build `GitCode` / `AsyncGitCode` with your custom `http_client` once and pass it through so LLM tool calls reuse the same TLS settings.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "gitcode-api"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.17"
|
|
4
4
|
description = "Easy to use Python SDK for the GitCode REST API. Providing builtin CLI tool, and optional LLM integration (MCP, OpenAI tool, and openJiuwen tool) for agents. Community-maintained."
|
|
5
5
|
keywords = [
|
|
6
6
|
"gitcode", "git", "devops", "api", "sdk", "python", "httpx", "client",
|
|
@@ -94,7 +94,7 @@ gitcode-api = "gitcode_api.cli:main"
|
|
|
94
94
|
default-groups = ['dev']
|
|
95
95
|
|
|
96
96
|
[tool.setuptools.package-data]
|
|
97
|
-
gitcode_api = ["**/version.txt"]
|
|
97
|
+
gitcode_api = ["**/version.txt", "**/py.typed"]
|
|
98
98
|
|
|
99
99
|
[tool.coverage.run]
|
|
100
100
|
omit = ["tests/*"]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""Tests for issue/PR ``.gitcode`` template resolution helpers."""
|
|
2
2
|
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
3
5
|
import httpx
|
|
4
6
|
import pytest
|
|
5
|
-
from typing import Optional
|
|
6
7
|
|
|
7
|
-
from gitcode_api import AsyncGitCode
|
|
8
8
|
from gitcode_api._exceptions import GitCodeHTTPStatusError
|
|
9
9
|
|
|
10
10
|
# ``_resolution_sources_*`` probes ``GET /repos/{owner}/{repo}`` for every candidate; stub these.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.2.15
|
|
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
|
|
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
|
|
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
|