Skip to content

Commit e1fa9fd

Browse files
committed
fix(calendar): disable static discovery so packaged builds work
cx_Freeze bundles googleapiclient as .pyc inside library.zip but does not include the discovery_cache JSON data files. With the default static_discovery=True, build() looks for the missing calendar.v3.json and raises UnknownApiNameOrVersion instead of falling back to the network. Force network discovery so the widget works in both dev and packaged installs.
1 parent 35ed361 commit e1fa9fd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/core/widgets/yasb/calendar.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,13 @@ def run(self) -> None: # runs on a thread-pool worker
144144
token_path.parent.mkdir(parents=True, exist_ok=True)
145145
token_path.write_text(creds.to_json(), encoding="utf-8")
146146

147-
service = build("calendar", "v3", credentials=creds, cache_discovery=False)
147+
service = build(
148+
"calendar",
149+
"v3",
150+
credentials=creds,
151+
cache_discovery=False,
152+
static_discovery=False,
153+
)
148154
now = datetime.now(UTC)
149155
grace = timedelta(minutes=self._config.grace_period_minutes)
150156
time_min = (now - grace).isoformat()

0 commit comments

Comments
 (0)