Skip to content

Fix deprecated GitHub authentication in retrosheet.py - #501

Closed
yasumorishima wants to merge 2 commits into
jldbc:masterfrom
yasumorishima:fix/issue-455-retrosheet-deprecated-auth
Closed

yasumorishima wants to merge 2 commits into
jldbc:masterfrom
yasumorishima:fix/issue-455-retrosheet-deprecated-auth

Conversation

@yasumorishima

Copy link
Copy Markdown

Summary

  • Replace deprecated Github(login_or_token) with Github(auth=Auth.Token(...)) in retrosheet.py
  • Handles empty token case by falling back to unauthenticated Github()
  • Affects 5 call sites: events(), rosters(), _roster(), schedules(), season_game_logs()

Closes #455

Details

PyGithub deprecated the login_or_token parameter in favor of auth=Auth.Token(...). The old usage triggers:

DeprecationWarning: Argument login_or_token is deprecated, please use auth=github.Auth.Token(...) instead

Before:

from github import Github
g = Github(GH_TOKEN)

After:

from github import Auth, Github
g = Github(auth=Auth.Token(GH_TOKEN)) if GH_TOKEN else Github()

Replace deprecated `Github(token)` with `Github(auth=Auth.Token(token))`
to avoid DeprecationWarning from PyGithub.
@yasumorishima

Copy link
Copy Markdown
Author

Bundled into #514 with my other open fixes so they can be reviewed in one go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

retrosheet using deprecated GitHub authentication

1 participant