@@ -140,13 +140,15 @@ async def estimate_cost(
140140 plan_data = GITHUB_PLANS .get (plan_key )
141141 if plan_data :
142142 plan_cost = plan_data ["price_monthly" ] * users
143- breakdown .append ({
144- "item" : f"GitHub { plan_key } plan" ,
145- "quantity" : users ,
146- "unit" : "users" ,
147- "unit_price" : plan_data ["price_monthly" ],
148- "monthly_cost" : round (plan_cost , 2 ),
149- })
143+ breakdown .append (
144+ {
145+ "item" : f"GitHub { plan_key } plan" ,
146+ "quantity" : users ,
147+ "unit" : "users" ,
148+ "unit_price" : plan_data ["price_monthly" ],
149+ "monthly_cost" : round (plan_cost , 2 ),
150+ }
151+ )
150152 total += plan_cost
151153
152154 # 2. Copilot cost
@@ -155,13 +157,15 @@ async def estimate_cost(
155157 copilot_data = GITHUB_COPILOT_PLANS .get (copilot_key )
156158 if copilot_data :
157159 copilot_cost = copilot_data ["price_monthly" ] * users
158- breakdown .append ({
159- "item" : f"GitHub Copilot { copilot_key } " ,
160- "quantity" : users ,
161- "unit" : "users" ,
162- "unit_price" : copilot_data ["price_monthly" ],
163- "monthly_cost" : round (copilot_cost , 2 ),
164- })
160+ breakdown .append (
161+ {
162+ "item" : f"GitHub Copilot { copilot_key } " ,
163+ "quantity" : users ,
164+ "unit" : "users" ,
165+ "unit_price" : copilot_data ["price_monthly" ],
166+ "monthly_cost" : round (copilot_cost , 2 ),
167+ }
168+ )
165169 total += copilot_cost
166170
167171 # 3. Actions minutes (beyond free tier)
@@ -172,67 +176,77 @@ async def estimate_cost(
172176 runner = GITHUB_ACTIONS_RUNNERS .get (runner_key )
173177 rate = runner ["per_minute" ] if runner else 0.008
174178 actions_cost = billable_mins * rate
175- breakdown .append ({
176- "item" : f"Actions minutes ({ runner_key } )" ,
177- "quantity" : billable_mins ,
178- "unit" : f"billable minutes (after { free_mins } free)" ,
179- "unit_price" : rate ,
180- "monthly_cost" : round (actions_cost , 2 ),
181- })
179+ breakdown .append (
180+ {
181+ "item" : f"Actions minutes ({ runner_key } )" ,
182+ "quantity" : billable_mins ,
183+ "unit" : f"billable minutes (after { free_mins } free)" ,
184+ "unit_price" : rate ,
185+ "monthly_cost" : round (actions_cost , 2 ),
186+ }
187+ )
182188 total += actions_cost
183189
184190 # 4. Codespaces compute
185191 if codespaces_hours > 0 :
186192 cs_rate = GITHUB_ADDONS ["Codespaces Compute" ]["price" ]
187193 core_hours = codespaces_hours * codespaces_cores
188194 cs_cost = core_hours * cs_rate
189- breakdown .append ({
190- "item" : "Codespaces Compute" ,
191- "quantity" : core_hours ,
192- "unit" : "core-hours" ,
193- "unit_price" : cs_rate ,
194- "monthly_cost" : round (cs_cost , 2 ),
195- })
195+ breakdown .append (
196+ {
197+ "item" : "Codespaces Compute" ,
198+ "quantity" : core_hours ,
199+ "unit" : "core-hours" ,
200+ "unit_price" : cs_rate ,
201+ "monthly_cost" : round (cs_cost , 2 ),
202+ }
203+ )
196204 total += cs_cost
197205
198206 # 5. Codespaces storage
199207 if codespaces_storage_gb > 0 :
200208 cs_stor_rate = GITHUB_ADDONS ["Codespaces Storage" ]["price" ]
201209 cs_stor_cost = codespaces_storage_gb * cs_stor_rate
202- breakdown .append ({
203- "item" : "Codespaces Storage" ,
204- "quantity" : codespaces_storage_gb ,
205- "unit" : "GB" ,
206- "unit_price" : cs_stor_rate ,
207- "monthly_cost" : round (cs_stor_cost , 2 ),
208- })
210+ breakdown .append (
211+ {
212+ "item" : "Codespaces Storage" ,
213+ "quantity" : codespaces_storage_gb ,
214+ "unit" : "GB" ,
215+ "unit_price" : cs_stor_rate ,
216+ "monthly_cost" : round (cs_stor_cost , 2 ),
217+ }
218+ )
209219 total += cs_stor_cost
210220
211221 # 6. Git LFS
212222 if lfs_packs > 0 :
213223 lfs_rate = GITHUB_ADDONS ["Git LFS Data" ]["price" ]
214224 lfs_cost = lfs_packs * lfs_rate
215- breakdown .append ({
216- "item" : "Git LFS Data Packs" ,
217- "quantity" : lfs_packs ,
218- "unit" : "50 GB packs" ,
219- "unit_price" : lfs_rate ,
220- "monthly_cost" : round (lfs_cost , 2 ),
221- })
225+ breakdown .append (
226+ {
227+ "item" : "Git LFS Data Packs" ,
228+ "quantity" : lfs_packs ,
229+ "unit" : "50 GB packs" ,
230+ "unit_price" : lfs_rate ,
231+ "monthly_cost" : round (lfs_cost , 2 ),
232+ }
233+ )
222234 total += lfs_cost
223235
224236 # 7. GHAS
225237 if ghas_committers > 0 :
226238 ghas_data = GITHUB_SECURITY_PRODUCTS ["GitHub Advanced Security (GHAS)" ]
227239 ghas_rate = ghas_data ["price_monthly_per_committer" ]
228240 ghas_cost = ghas_committers * ghas_rate
229- breakdown .append ({
230- "item" : "GitHub Advanced Security (GHAS)" ,
231- "quantity" : ghas_committers ,
232- "unit" : "active committers" ,
233- "unit_price" : ghas_rate ,
234- "monthly_cost" : round (ghas_cost , 2 ),
235- })
241+ breakdown .append (
242+ {
243+ "item" : "GitHub Advanced Security (GHAS)" ,
244+ "quantity" : ghas_committers ,
245+ "unit" : "active committers" ,
246+ "unit_price" : ghas_rate ,
247+ "monthly_cost" : round (ghas_cost , 2 ),
248+ }
249+ )
236250 total += ghas_cost
237251
238252 return {
@@ -304,30 +318,32 @@ def _get_copilot(plan_filter: str | None = None) -> list[dict[str, Any]]:
304318 if plan_filter :
305319 if name .lower () != plan_filter .strip ().lower ():
306320 continue
307- result .append ({
308- "name" : name ,
309- "price_monthly" : data ["price_monthly" ],
310- "price_annual" : data ["price_annual" ],
311- "target" : data ["target" ],
312- "includes" : data ["includes" ],
313- })
321+ result .append (
322+ {
323+ "name" : name ,
324+ "price_monthly" : data ["price_monthly" ],
325+ "price_annual" : data ["price_annual" ],
326+ "target" : data ["target" ],
327+ "includes" : data ["includes" ],
328+ }
329+ )
314330 return result
315331
316332 @staticmethod
317333 def _get_actions () -> dict [str , Any ]:
318334 runners = []
319335 for label , data in GITHUB_ACTIONS_RUNNERS .items ():
320- runners .append ({
321- "runner" : label ,
322- "per_minute" : data ["per_minute" ],
323- "os" : data ["os" ],
324- "cores" : data ["cores" ],
325- })
336+ runners .append (
337+ {
338+ "runner" : label ,
339+ "per_minute" : data ["per_minute" ],
340+ "os" : data ["os" ],
341+ "cores" : data ["cores" ],
342+ }
343+ )
326344 return {
327345 "runners" : runners ,
328- "free_minutes" : {
329- plan : info for plan , info in GITHUB_ACTIONS_FREE_MINUTES .items ()
330- },
346+ "free_minutes" : {plan : info for plan , info in GITHUB_ACTIONS_FREE_MINUTES .items ()},
331347 "multipliers" : {
332348 "Linux" : 1 ,
333349 "Windows" : 2 ,
0 commit comments