Use new pygithub global lazy feature
Requires 2.6.0. Means data is only fetched if it is accessed, so fewer API calls for us (hopefully).
This commit is contained in:
parent
ca6dd299ee
commit
1ef3f8f5f5
@ -72,6 +72,7 @@ def get_github(write: bool = False) -> Github:
|
|||||||
kwargs['per_page'] = 100
|
kwargs['per_page'] = 100
|
||||||
kwargs['timeout'] = sum(REQUESTS_TIMEOUT)
|
kwargs['timeout'] = sum(REQUESTS_TIMEOUT)
|
||||||
kwargs['seconds_between_requests'] = None
|
kwargs['seconds_between_requests'] = None
|
||||||
|
kwargs['lazy'] = True
|
||||||
gh = Github(**kwargs)
|
gh = Github(**kwargs)
|
||||||
if auth is None and not write:
|
if auth is None and not write:
|
||||||
print(f"[Warning] Rate limit status: {gh.get_rate_limit().core}", file=sys.stderr)
|
print(f"[Warning] Rate limit status: {gh.get_rate_limit().core}", file=sys.stderr)
|
||||||
|
|||||||
2
poetry.lock
generated
2
poetry.lock
generated
@ -927,4 +927,4 @@ files = [
|
|||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.1"
|
lock-version = "2.1"
|
||||||
python-versions = "^3.10"
|
python-versions = "^3.10"
|
||||||
content-hash = "8137910be83a0332aa71d0b3db583e40b251c17e9238f537a47d7fd892a16850"
|
content-hash = "a3bec96df66794a5e5342117a9c6d70dce2cc233611f0479275c8eed6dc54211"
|
||||||
|
|||||||
@ -6,7 +6,7 @@ authors = ["Christoph Reiter <reiter.christoph@gmail.com>"]
|
|||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.10"
|
python = "^3.10"
|
||||||
PyGithub = "^2.1.1"
|
PyGithub = "^2.6.0"
|
||||||
tabulate = "^0.9.0"
|
tabulate = "^0.9.0"
|
||||||
requests = "^2.28.1"
|
requests = "^2.28.1"
|
||||||
requests-cache = "^1.0.0"
|
requests-cache = "^1.0.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user