Skip to content

Commit

Permalink
feat: slower alternative for get_required_deps
Browse files Browse the repository at this point in the history
  • Loading branch information
saxenabhishek committed Mar 14, 2022
1 parent adbe19a commit d0bd294
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bench/utils/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,14 @@ def get_required_deps(org, name, branch, deps="hooks.py"):
import requests
import base64

url = f"https://api.github.com/repos/{org}/{name}/contents/{name}/{deps}"
git_api_url = f"https://api.github.com/repos/{org}/{name}/contents/{name}/{deps}"
params = {"branch": branch or "develop"}
res = requests.get(url=url, params=params).json()
res = requests.get(url=git_api_url, params=params).json()

if "message" in res:
git_url = f"https://raw.githubusercontent.com/{org}/{name}/{params['branch']}/{deps}"
return requests.get(git_url).text

return base64.decodebytes(res["content"].encode()).decode()


Expand Down

0 comments on commit d0bd294

Please sign in to comment.