RES-1160 | Drop the requests dependency, use stdlib urllib - #50
Open
alexrecuenco-hf wants to merge 2 commits into
Open
RES-1160 | Drop the requests dependency, use stdlib urllib#50alexrecuenco-hf wants to merge 2 commits into
alexrecuenco-hf wants to merge 2 commits into
Conversation
neo.py imports requests but the composite action runs it directly via the runner's global python3, without ever installing dependencies (no setup-python, no pip install step). This only worked by accident on runners whose global python happens to have requests preinstalled (e.g. GitHub-hosted ubuntu-latest, which is also why this repo's own CI never caught it). Self-hosted runners with a leaner base image don't have it, and the action fails with ModuleNotFoundError. Since the only use of requests here is a couple of authenticated GET requests with Link-header pagination, urllib.request covers it without adding a dependency the action has no way to install for itself.
alexrecuenco-hf
commented
Aug 5, 2026
thilinajayanath
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
neo.pyruns directly against whateverpython3is on the runner'sPATH— the composite action never runsactions/setup-pythonor installs any dependencies (seeaction.yml). It only worked becauserequestshappened to be preinstalled on GitHub-hostedubuntu-latestrunners (which is also why this repo's own CI, which runs onubuntu-latest, never caught it).On leaner/custom self-hosted runner images without
requestspreinstalled globally, this action fails with:Rather than pushing every consumer to provision
requestsglobally on their runner images, this replaces the one placerequestsis used (a couple of authenticatedGETs against the compare API, withLink-header pagination) withurllib.requestfrom the standard library. No behavior change, no new dependency to manage — the action now works on any Python 3 runner out of the box.Test plan
./neo/tests.py TestChangedFiles -v— all unit tests pass unchanged./neo/tests.py IntegrationTest -v— both integration tests pass against the real GitHub API, includingtest_pagination, which exercises the rewrittenLinkheader parsing/pagination against this repo's own commit historyrequestsanywhere in the repo