bugdantic 0.2.3__tar.gz → 0.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bugdantic
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Bugzilla client based on pydantic
5
5
  Author-email: James Graham <james@hoppipolla.co.uk>
6
6
  Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
@@ -118,6 +118,7 @@ class Bug(BaseModel):
118
118
 
119
119
  # BMO specific custom fields
120
120
  cf_last_resolved: Optional[datetime] = None
121
+ cf_size_estimate: Optional[str] = None
121
122
  cf_user_story: Optional[str] = None
122
123
  cf_webcompat_priority: Optional[str] = None
123
124
  cf_webcompat_score: Optional[str] = None
@@ -220,6 +221,15 @@ class WebcompatPriority(enum.StrEnum):
220
221
  requested = "?"
221
222
 
222
223
 
224
+ class SizeEstimate(enum.StrEnum):
225
+ unset = "---"
226
+ XS = "XS"
227
+ S = "S"
228
+ M = "M"
229
+ L = "L"
230
+ XL = "XL"
231
+
232
+
223
233
  class BugUpdate(BaseModel):
224
234
  ids: Optional[list[int]] = None
225
235
  id_or_alias: Optional[int | str] = None
@@ -259,6 +269,7 @@ class BugUpdate(BaseModel):
259
269
  work_time: Optional[str] = None
260
270
 
261
271
  # BMO specific custom fields
272
+ cf_size_estimate: Optional[SizeEstimate] = None
262
273
  cf_user_story: Optional[str] = None
263
274
  cf_webcompat_priority: Optional[WebcompatPriority] = None
264
275
  cf_webcompat_score: Optional[str] = None
@@ -359,6 +370,7 @@ class Bugzilla:
359
370
  def bug(
360
371
  self, bug_id: int, include_fields: Optional[list[str]] = None
361
372
  ) -> Optional[Bug]:
373
+ """Get a single bug specified by id"""
362
374
  search_result = BugSearch.model_validate(
363
375
  self.request("GET", f"bug/{bug_id}", include_fields=include_fields)
364
376
  )
@@ -370,9 +382,29 @@ class Bugzilla:
370
382
  assert len(bugs) == 1
371
383
  return bugs[0]
372
384
 
385
+ def bugs(
386
+ self,
387
+ bug_ids: Sequence[int],
388
+ include_fields: Optional[list[str]] = None,
389
+ page_size: int = 100,
390
+ ) -> list[Bug]:
391
+ """Get multiple bugs specified by id"""
392
+ results: list[Bug] = []
393
+ for bug_ids_chunk in [
394
+ bug_ids[n : n + page_size] for n in range(0, len(bug_ids), page_size)
395
+ ]:
396
+ results.extend(
397
+ self.search(
398
+ {"id": ",".join(str(id) for id in bug_ids_chunk)},
399
+ include_fields=include_fields,
400
+ )
401
+ )
402
+ return results
403
+
373
404
  def bug_history(
374
405
  self, bug_id: int, new_since: Optional[datetime] = None
375
406
  ) -> BugHistory:
407
+ """Get the history of a single bug"""
376
408
  params = {}
377
409
  if new_since is not None:
378
410
  params["new_since"] = new_since.strftime("%Y-%m-%dT%H:%M:%SZ")
@@ -393,6 +425,7 @@ class Bugzilla:
393
425
  include_fields: Optional[list[str]] = None,
394
426
  page_size: int = 100,
395
427
  ) -> list[Bug]:
428
+ """Search for bugs using the bugzilla query API"""
396
429
  query = {**query}
397
430
  paginate = False
398
431
  offset = 0
@@ -427,6 +460,7 @@ class Bugzilla:
427
460
  def update_bugs(
428
461
  self, update_params: BugUpdate, bug_id: Optional[int] = None
429
462
  ) -> list[BugUpdateResponse]:
463
+ """Update one or more bugs"""
430
464
  if bug_id is None:
431
465
  if update_params.ids:
432
466
  id_str = str(update_params.ids[0])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bugdantic
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Bugzilla client based on pydantic
5
5
  Author-email: James Graham <james@hoppipolla.co.uk>
6
6
  Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
@@ -5,7 +5,7 @@ authors = [
5
5
  {name = "James Graham", email = "james@hoppipolla.co.uk"}
6
6
  ]
7
7
 
8
- version = "0.2.3"
8
+ version = "0.2.5"
9
9
  requires-python = ">=3.11"
10
10
  classifiers = [
11
11
  "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
File without changes
File without changes
File without changes
File without changes