mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Make google auth package dependency explicit to simplify code
Previously google auth library was explicitly installed only for the cloud variant of Khoj to minimize packages installed for non production use-cases. But it was being implicitly installed as a dependency of an explicit package in the default installation anyway. Making the dependency on google auth package explicit simplifies the conditional import of google auth in code while not incurring any additional cost in terms of space or complexity.
This commit is contained in:
@@ -89,6 +89,7 @@ dependencies = [
|
||||
"anthropic == 0.49.0",
|
||||
"docx2txt == 0.8",
|
||||
"google-genai == 1.5.0",
|
||||
"google-auth ~= 2.23.3",
|
||||
"pyjson5 == 1.6.7",
|
||||
"resend == 1.0.1",
|
||||
"email-validator == 2.2.0",
|
||||
@@ -107,7 +108,6 @@ khoj = "khoj.main:run"
|
||||
[project.optional-dependencies]
|
||||
prod = [
|
||||
"gunicorn == 22.0.0",
|
||||
"google-auth == 2.23.3",
|
||||
"stripe == 7.3.0",
|
||||
"twilio == 8.11",
|
||||
"boto3 >= 1.34.57",
|
||||
|
||||
@@ -43,12 +43,9 @@ class MagicLinkForm(BaseModel):
|
||||
if not state.anonymous_mode:
|
||||
missing_requirements = []
|
||||
from authlib.integrations.starlette_client import OAuth, OAuthError
|
||||
from google.auth.transport import requests as google_requests
|
||||
from google.oauth2 import id_token
|
||||
|
||||
try:
|
||||
from google.auth.transport import requests as google_requests
|
||||
from google.oauth2 import id_token
|
||||
except ImportError:
|
||||
missing_requirements += ["Install the Khoj production package with `pip install khoj[prod]`"]
|
||||
if not os.environ.get("RESEND_API_KEY") and (
|
||||
not os.environ.get("GOOGLE_CLIENT_ID") or not os.environ.get("GOOGLE_CLIENT_SECRET")
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user