Skip to content

Remove PyGithub from PEX, replace with stdlib urllib#249

Open
gibsondan wants to merge 1 commit into
mainfrom
remove-pygithub-from-pex
Open

Remove PyGithub from PEX, replace with stdlib urllib#249
gibsondan wants to merge 1 commit into
mainfrom
remove-pygithub-from-pex

Conversation

@gibsondan

Copy link
Copy Markdown
Member

Summary

  • Drop the PyGithub dependency from the dagster-cloud PEX build in scripts/release.py.
  • Rewrite src/fetch_github_avatar.py and src/create_or_update_comment.py to call the GitHub REST API directly via urllib.request (paginated comment lookup preserved, anonymous-commit safety added).

Both call sites only used a tiny slice of PyGithub, so stdlib was a cleaner swap than pulling in another GitHub client. Result: smaller PEX, one fewer transitive dependency.

Replaces #248 (rebased onto a clean branch).

Test plan

  • Build the PEX (update_dagster_cloud_pex) and confirm it no longer ships the github package.
  • Trigger a PR-driven branch deploy and verify the build-status comment is created on first run, updated on subsequent runs, and that the avatar URL is fetched correctly.
  • Confirm anonymous/no-author commits don't crash fetch_github_avatar.py (prints empty line).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
from_gh_action View in Cloud May 22, 2026 at 09:19 PM (UTC)

@gibsondan gibsondan force-pushed the remove-pygithub-from-pex branch 5 times, most recently from 099d7a6 to c2979a3 Compare May 22, 2026 21:11
The PEX only used PyGithub for two small scripts (fetch_github_avatar.py
and create_or_update_comment.py). Rewriting them against requests (which
is already a transitive dep in the PEX) drops PyGithub and gives us
automatic retry on transient 5xx/429 via urllib3 Retry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gibsondan gibsondan force-pushed the remove-pygithub-from-pex branch from c2979a3 to 5122ffe Compare May 22, 2026 21:13
@gibsondan gibsondan requested a review from shalabhc May 22, 2026 21:14
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.

2 participants