Skip to content

Commit

Permalink
github: Use Auth in latest PyGithub
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Mar 8, 2025
1 parent 22809df commit a80e2bf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions services/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
from typing import Any

from github import Github, GithubException # , Auth
from github import Auth, Github, GithubException
from requests.exceptions import RequestException

from utils import utc_date
Expand All @@ -22,13 +22,13 @@ class MyGithub(Service):

def __init__(self, url: str, creds: dict) -> None:
super().__init__(url)
for key in ("login_or_token", "token"):
if key in creds:
token = creds.pop(key)
options: dict[str, Any] = {
# NOTE: Uncomment when latest PyGithub is published on Tumbleweed
# "auth" = Auth.Token(**creds),
# "seconds_between_requests" = 0.0,
"auth": Auth.Token(token=token),
"user_agent": f"bugme/{VERSION}",
}
options |= creds
self.client = Github(**options)
self.tag = "gh"
if os.getenv("DEBUG"):
Expand Down

0 comments on commit a80e2bf

Please sign in to comment.