gitcode-api 1.2.15__py3-none-any.whl → 1.2.16__py3-none-any.whl

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.
@@ -16,6 +16,7 @@ from ._exceptions import GitCodeConfigurationError, GitCodeHTTPStatusError
16
16
  DEFAULT_BASE_URL = "https://api.gitcode.com/api/v5"
17
17
  DEFAULT_TIMEOUT = 30.0
18
18
  DEFAULT_TOKEN_ENV = "GITCODE_ACCESS_TOKEN"
19
+ DEFAULT_CA_ENV = "GITCODE_CA_BUNDLE"
19
20
 
20
21
 
21
22
  def _drop_none_values(mapping: Dict[str, Any]) -> Dict[str, Any]:
@@ -215,7 +216,8 @@ class SyncAPIClient(BaseGitCodeClient):
215
216
  ) -> None:
216
217
  """Create or reuse an ``httpx.Client`` for synchronous requests."""
217
218
  super().__init__(api_key=api_key, owner=owner, repo=repo, base_url=base_url, timeout=timeout, decrypt=decrypt)
218
- self._client = http_client or httpx.Client(timeout=self.timeout)
219
+ verify = os.environ.get(DEFAULT_CA_ENV, "").strip() or os.environ.get("REQUESTS_CA_BUNDLE", "").strip() or True
220
+ self._client = http_client or httpx.Client(timeout=self.timeout, verify=verify)
219
221
 
220
222
  def request(
221
223
  self,
@@ -289,7 +291,8 @@ class AsyncAPIClient(BaseGitCodeClient):
289
291
  ) -> None:
290
292
  """Create or reuse an ``httpx.AsyncClient`` for asynchronous requests."""
291
293
  super().__init__(api_key=api_key, owner=owner, repo=repo, base_url=base_url, timeout=timeout, decrypt=decrypt)
292
- self._client = http_client or httpx.AsyncClient(timeout=self.timeout)
294
+ verify = os.environ.get(DEFAULT_CA_ENV, "").strip() or os.environ.get("REQUESTS_CA_BUNDLE", "").strip() or True
295
+ self._client = http_client or httpx.AsyncClient(timeout=self.timeout, verify=verify)
293
296
 
294
297
  async def request(
295
298
  self,
gitcode_api/version.txt CHANGED
@@ -1 +1 @@
1
- 1.2.15
1
+ 1.2.16
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitcode-api
3
- Version: 1.2.15
3
+ Version: 1.2.16
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
- [![PyPI - Version](https://img.shields.io/pypi/v/gitcode-api?link=https%3A%2F%2Fpypi.org%2Fproject%2Fgitcode-api%2F&uuid=1d56ca66edb448b88c30fbfd677b8542)](https://pypi.org/project/gitcode-api) [![PyPI Downloads](https://static.pepy.tech/personalized-badge/gitcode-api?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=RED&left_text=downloads&uuid=03b2f61f19894ce49501bb9e856b434a)](https://pepy.tech/projects/gitcode-api) [![CodeFactor](https://www.codefactor.io/repository/github/trenza1ore/gitcode-api/badge)](https://www.codefactor.io/repository/github/trenza1ore/gitcode-api)
40
+ [![PyPI - Version](https://img.shields.io/pypi/v/gitcode-api?link=https%3A%2F%2Fpypi.org%2Fproject%2Fgitcode-api%2F&uuid=da2880de93fd4f4e9d40eeb7df479829)](https://pypi.org/project/gitcode-api) [![PyPI Downloads](https://static.pepy.tech/personalized-badge/gitcode-api?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=RED&left_text=downloads&uuid=d8567ce466b142c6acc4b21bdec35cbd)](https://pepy.tech/projects/gitcode-api) [![CodeFactor](https://www.codefactor.io/repository/github/trenza1ore/gitcode-api/badge)](https://www.codefactor.io/repository/github/trenza1ore/gitcode-api)
41
41
  [![Install in Cursor](https://img.shields.io/badge/Install_in-Cursor-000000?logoColor=white)](https://cursor.com/en/install-mcp?name=GitCode%20API&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJnaXRjb2RlLWFwaVttY3BdIiwiZ2l0Y29kZS1hcGkiLCJzZXJ2ZSJdLCJlbnYiOnsiR0lUQ09ERV9BQ0NFU1NfVE9LRU4iOiIke2lucHV0OmdpdGNvZGVfYWNjZXNzX3Rva2VufSJ9LCJpbnB1dHMiOlt7ImlkIjoiZ2l0Y29kZV9hY2Nlc3NfdG9rZW4iLCJ0eXBlIjoicHJvbXB0U3RyaW5nIiwiZGVzY3JpcHRpb24iOiJFbnRlciBHSVRDT0RFX0FDQ0VTU19UT0tFTiIsInBhc3N3b3JkIjp0cnVlfV19) [![Install in VS Code](https://img.shields.io/badge/Install_in-VS_Code-0098FF?logo=visualstudiocode&logoColor=white)](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
  [![GitHub Badge](https://img.shields.io/badge/github-repo-blue?logo=github&link=https%3A%2F%2Fgithub.com%2FTrenza1ore%2FGitCode-API)](https://github.com/Trenza1ore/GitCode-API) [![GitCode Badge](https://img.shields.io/badge/gitcode-repo-brown?logo=gitcode&link=https%3A%2F%2Fgitcode.com%2FSushiNinja%2FGitCode-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/__init__.py,sha256=vqRBOTuk4UygSh2y4wZSTiK2FNY8DSqjcSGjC3W0ifg,539
2
2
  gitcode_api/__main__.py,sha256=Yd8P4MSNcWFqUTKnUaNibbWX4Vd-MVVNmhPFaohzqcA,137
3
- gitcode_api/_base_client.py,sha256=PFsTMZJI4p5INjubRa4H4JcybYLGt-B9VkSAfTgpxfI,13280
3
+ gitcode_api/_base_client.py,sha256=knOWB3ppW2AEEFuSjC89F7AYVEhcRE4KMVtEqlT8Jzk,13587
4
4
  gitcode_api/_base_resource.py,sha256=mlKe1b_1AKcqxhptaCpP-AOjKkLNzCbYG-Pkp1HYWrA,2238
5
5
  gitcode_api/_cli_banner.py,sha256=3DsoJ2qZ-mWWB4yD-cnxDN_osXzrUKabrA5tbV6752M,978
6
6
  gitcode_api/_client.py,sha256=bmZxBHdfshM5Kv_EurHUVu8rsEj0k3Up3ATSIPaFrvc,8258
@@ -10,7 +10,7 @@ gitcode_api/cli.py,sha256=Z-X5gK8iI2wCEXqT-igVKpVzO4ZhaRYaxmTbqMbIUx8,18735
10
10
  gitcode_api/py.typed,sha256=mDShSrm8qg9qjacQc2F-rI8ATllqP6EdgHuEYxuCXZ0,7
11
11
  gitcode_api/run_mcp.py,sha256=3_JOrjg9_yL-0M-H-F8mPgxdVKh7K2ggipu7UHeNCg0,147
12
12
  gitcode_api/utils.py,sha256=51QmPTQPeNsPSGf2IzhwmiEO1H2GkJrp2A7vkzhOOag,1351
13
- gitcode_api/version.txt,sha256=CR1Vtk3iATNBumC-6iLKE5LhwljWj_KqLo-QHPlyPWM,7
13
+ gitcode_api/version.txt,sha256=4VkQEA8HJ0Uo1YxpYgTG7ZV380aDnxGbtKY9rf37tsU,7
14
14
  gitcode_api/llm/__init__.py,sha256=rU75ZlJvTWNVxBLc3QzdfWmSjqVc9z6hfQ8z6jVVKOk,1693
15
15
  gitcode_api/llm/_tool.py,sha256=b65iUiHo1H29uA6mFM3WlD0zZlISsENx1tpEqlkiUoA,16239
16
16
  gitcode_api/llm/jiuwen.py,sha256=qca2y4544xoRYFOCMbkjiUZZLpJGMcBkK4w5bqs60-4,4276
@@ -22,9 +22,9 @@ gitcode_api/resources/account.py,sha256=mnc2p7wI-nBnHFNdWPNiHfmZpT6d3RDQC777gewt
22
22
  gitcode_api/resources/collaboration.py,sha256=TK0QXG_ymE4vbtHyP3Y-M39oG9zQE44UU5-UnPhF2WM,112388
23
23
  gitcode_api/resources/misc.py,sha256=w7bq8rmgKr2ScBKeWZ3EZJmAdylDdPtSPrhi3AQre7w,34747
24
24
  gitcode_api/resources/repositories.py,sha256=EAK2znZhEsgVUu-NDEQslSEEYJzvb-kHuh4mW57y6sc,78178
25
- gitcode_api-1.2.15.dist-info/licenses/LICENSE,sha256=gOACXuWhMu6PJKVLr9RQbxX3HULnZIGNXCaMFJIXhoA,1067
26
- gitcode_api-1.2.15.dist-info/METADATA,sha256=UpCCoL8teAQTmSRO5LDV7qx6dNV6EzgoIfeVnsoS81s,23323
27
- gitcode_api-1.2.15.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
28
- gitcode_api-1.2.15.dist-info/entry_points.txt,sha256=dIPylJcgohIE2RRIlt3In2WzcwDK8TOdkL_ReKuij4o,53
29
- gitcode_api-1.2.15.dist-info/top_level.txt,sha256=gIlg0ptyOUHJT64ajOjWIhRPYgIQnMIvnhhnesw9fxU,12
30
- gitcode_api-1.2.15.dist-info/RECORD,,
25
+ gitcode_api-1.2.16.dist-info/licenses/LICENSE,sha256=gOACXuWhMu6PJKVLr9RQbxX3HULnZIGNXCaMFJIXhoA,1067
26
+ gitcode_api-1.2.16.dist-info/METADATA,sha256=KKD1GlaXWDlszyfUX3Ar7vd6DA9PDNBAsSj_0-4fwYg,23592
27
+ gitcode_api-1.2.16.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
28
+ gitcode_api-1.2.16.dist-info/entry_points.txt,sha256=dIPylJcgohIE2RRIlt3In2WzcwDK8TOdkL_ReKuij4o,53
29
+ gitcode_api-1.2.16.dist-info/top_level.txt,sha256=gIlg0ptyOUHJT64ajOjWIhRPYgIQnMIvnhhnesw9fxU,12
30
+ gitcode_api-1.2.16.dist-info/RECORD,,