Skip to content

Commit 0a889d1

Browse files
committed
chore: make lint happy
Signed-off-by: Chojan Shang <psiace@apache.org>
1 parent 97dd364 commit 0a889d1

2 files changed

Lines changed: 22 additions & 7 deletions

File tree

docker/setup-bub-workspace.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
builtin skill directories (SKILL.md, scripts/, etc.) into workspace/.agent/skills/
99
so they behave as project skills and script paths resolve correctly.
1010
"""
11+
1112
from __future__ import annotations
1213

1314
import os

scripts/install-skill-from-github.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env python3
2-
"""Install a skill from a GitHub repo. Project copy: SSL-friendly + git fallback for old Git.
2+
"""Install a skill from a GitHub repo. SSL-friendly + git fallback for old Git.
33
4-
Same CLI as bub skill-installer so the agent can run: uv run scripts/install-skill-from-github.py --repo owner/repo --path path/to/skill.
4+
Same CLI as bub skill-installer; agent runs: uv run scripts/install-skill-from-github.py
5+
--repo owner/repo --path path/to/skill.
56
"""
7+
68
from __future__ import annotations
79

810
import argparse
@@ -63,6 +65,7 @@ def _ssl_context():
6365
ctx = ssl.create_default_context()
6466
try:
6567
import certifi
68+
6669
ctx.load_verify_locations(certifi.where())
6770
except ImportError:
6871
pass
@@ -157,10 +160,21 @@ def _validate_skill_name(name: str) -> None:
157160
def _git_sparse_checkout(repo_url: str, ref: str, paths: list[str], dest_dir: str) -> str:
158161
repo_dir = os.path.join(dest_dir, "repo")
159162
try:
160-
_run_git([
161-
"git", "clone", "--filter=blob:none", "--depth", "1",
162-
"--sparse", "--single-branch", "--branch", ref, repo_url, repo_dir,
163-
])
163+
_run_git(
164+
[
165+
"git",
166+
"clone",
167+
"--filter=blob:none",
168+
"--depth",
169+
"1",
170+
"--sparse",
171+
"--single-branch",
172+
"--branch",
173+
ref,
174+
repo_url,
175+
repo_dir,
176+
]
177+
)
164178
_run_git(["git", "-C", repo_dir, "sparse-checkout", "set", *paths])
165179
_run_git(["git", "-C", repo_dir, "checkout", ref])
166180
return repo_dir
@@ -201,7 +215,7 @@ def _prepare_repo(source: Source, method: str, tmp_dir: str) -> str:
201215
if method in ("download", "auto"):
202216
try:
203217
return _download_repo_zip(source.owner, source.repo, source.ref, tmp_dir)
204-
except InstallError as exc:
218+
except InstallError:
205219
if method == "download":
206220
raise
207221
# auto: fall back to git on any download error (HTTP, SSL, timeout)

0 commit comments

Comments
 (0)