fix(git-http): handle relative import when run as top-level script
lint / lint (push) Failing after 2m0s
test / unit (pull_request) Failing after 47s
test / integration (pull_request) Successful in 17s

git_http_backend.py is run as a standalone script in the sidecar
container; relative imports don't work in that context. Fall back
to an absolute import so the module loads correctly either way.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 19:42:27 -04:00
parent a8e880fad6
commit 5c6e456fcc
+5
View File
@@ -16,7 +16,12 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from urllib.parse import urlsplit
try:
from .git_gate import GIT_GATE_TIMEOUT_SECS
except ImportError:
# Running as a top-level script inside the sidecar container
# (python3 /app/git_http_backend.py) rather than as part of a package.
from git_gate import GIT_GATE_TIMEOUT_SECS # type: ignore[no-redef]
DEFAULT_PORT = 9420