Skip to content

Commit 0557983

Browse files
author
Vitaliy Zakaznikov
committed
Updating dependency versions.
Updating github login. Updating actions runners to the latest 2.331.0.
1 parent c331ec9 commit 0557983

File tree

10 files changed

+31
-26
lines changed

10 files changed

+31
-26
lines changed

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@
5555
scripts=["testflows/github/hetzner/runners/bin/github-hetzner-runners"],
5656
zip_safe=False,
5757
install_requires=[
58-
"PyGithub==1.59.0",
58+
"PyGithub==2.8.1",
5959
"hcloud==2.3.0",
60-
"requests-cache==1.1.0",
61-
"PyYAML==6.0.2",
62-
"prometheus_client==0.19.0",
60+
"requests-cache==1.2.1",
61+
"PyYAML==6.0.3",
62+
"prometheus_client==0.24.1",
6363
"streamlit==1.49.1",
64-
"psutil>=5.9.8",
64+
"psutil>=7.2.1",
6565
],
6666
extras_require={"dev": []},
6767
)

testflows/github/hetzner/runners/api_watch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import time
1616

1717
from threading import Event
18-
from github import Github
18+
from github import Auth, Github
1919

2020
from .actions import Action
2121
from . import metrics
@@ -25,7 +25,7 @@ def api_watch(terminate: Event, github_token: str, interval: int = 60):
2525
"""Watch API calls consumption."""
2626

2727
with Action("Logging in to GitHub"):
28-
github = Github(login_or_token=github_token)
28+
github = Github(auth=Auth.Token(github_token))
2929

3030
with Action("Checking current API calls consumption rate"):
3131
calls, total = github.rate_limiting
@@ -44,8 +44,9 @@ def api_watch(terminate: Event, github_token: str, interval: int = 60):
4444

4545
if i >= interval:
4646
with Action("Logging in to GitHub"):
47-
github = Github(login_or_token=github_token)
48-
github.get_rate_limit
47+
github = Github(auth=Auth.Token(github_token))
48+
github.get_rate_limit()
49+
4950
with Action("Checking current API calls consumption rate"):
5051
current, total = github.rate_limiting
5152
next_resettime = github.rate_limiting_resettime

testflows/github/hetzner/runners/bin/github-hetzner-runners

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ from prometheus_client import start_http_server as start_prometheus_server
2929

3030
from hcloud.ssh_keys.domain import SSHKey
3131

32-
from github import Github
32+
from github import Auth, Github
3333
from github.Repository import Repository
3434

3535
from argparse import ArgumentParser, RawTextHelpFormatter, ArgumentTypeError
@@ -492,7 +492,7 @@ def argparser():
492492
action="store_true",
493493
help="do not print volumes",
494494
)
495-
495+
496496
list_parser.set_defaults(func=servers.list)
497497

498498
ssh_client_parser = commands.add_parser(
@@ -1766,7 +1766,7 @@ def main(config, worker_pool: ThreadPoolExecutor, terminate_timeout=60):
17661766
)
17671767

17681768
with Action("Logging in to GitHub"):
1769-
github = Github(login_or_token=config.github_token, per_page=100)
1769+
github = Github(auth=Auth.Token(config.github_token), per_page=100)
17701770

17711771
with Action(f"Getting repository {config.github_repository}"):
17721772
repo: Repository = github.get_repo(config.github_repository)

testflows/github/hetzner/runners/estimate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from .utils import get_runner_server_type_and_location
2626

2727
from datetime import timedelta
28-
from github import Github
28+
from github import Auth, Github
2929
from github.Repository import Repository
3030
from github.WorkflowRun import WorkflowRun
3131
from github.WorkflowJob import WorkflowJob
@@ -160,7 +160,7 @@ def login_and_get_prices(
160160
client = Client(token=config.hetzner_token)
161161

162162
with Action("Logging in to GitHub"):
163-
github = Github(login_or_token=config.github_token, per_page=100)
163+
github = Github(auth=Auth.Token(config.github_token), per_page=100)
164164

165165
with Action(f"Getting repository {config.github_repository}"):
166166
repo: Repository = github.get_repo(config.github_repository)

testflows/github/hetzner/runners/hclient.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ def __init__(
1212
poll_interval=1,
1313
):
1414
super().__init__(
15-
token, api_endpoint, project_name, project_version, poll_interval
15+
token=token,
16+
api_endpoint=api_endpoint,
17+
application_name=project_name,
18+
application_version=project_version,
19+
poll_interval=poll_interval,
1620
)

testflows/github/hetzner/runners/scale_down.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from .hclient import HClient as Client
4545
from .ordered_set import OrderedSet as set
4646

47-
from github import Github
47+
from github import Auth, Github
4848
from github.Repository import Repository
4949
from github.SelfHostedActionsRunner import SelfHostedActionsRunner
5050

@@ -284,7 +284,7 @@ def scale_down(
284284
client = Client(token=hetzner_token)
285285

286286
with Action("Logging in to GitHub"):
287-
github = Github(login_or_token=github_token, per_page=100)
287+
github = Github(auth=Auth.Token(github_token), per_page=100)
288288

289289
with Action(f"Getting repository {github_repository}"):
290290
repo: Repository = github.get_repo(github_repository)

testflows/github/hetzner/runners/scale_up.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
from hcloud.images.domain import Image
5252
from hcloud.helpers.labels import LabelValidator
5353

54-
from github import Github
54+
from github import Auth, Github
5555
from github.Repository import Repository
5656
from github.WorkflowRun import WorkflowRun
5757
from github.SelfHostedActionsRunner import SelfHostedActionsRunner
@@ -1338,7 +1338,7 @@ def create_runner_server(
13381338
futures.append(future)
13391339

13401340
with Action("Logging in to GitHub"):
1341-
github = Github(login_or_token=github_token, per_page=100)
1341+
github = Github(auth=Auth.Token(github_token), per_page=100)
13421342

13431343
with Action(f"Getting repository {github_repository}"):
13441344
repo: Repository = github.get_repo(github_repository)

testflows/github/hetzner/runners/scripts/startup-arm64.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ cd /home/ubuntu
99

1010
# GitHub Actions Runner - update version and checksum when upgrading
1111
# https://github.com/actions/runner/releases
12-
ACTIONS_RUNNER_VERSION="2.330.0"
13-
ACTIONS_RUNNER_SHA256="9cb43527912086c7c8fb4119cb06409fcbcbd6f93a2d8507f30b07c495620f5c"
12+
ACTIONS_RUNNER_VERSION="2.331.0"
13+
ACTIONS_RUNNER_SHA256="f5863a211241436186723159a111f352f25d5d22711639761ea24c98caef1a9a"
1414

1515
ACTIONS_RUNNER_ARCH="arm64"
1616
ACTIONS_RUNNER_FILE="actions-runner-linux-${ACTIONS_RUNNER_ARCH}-${ACTIONS_RUNNER_VERSION}.tar.gz"

testflows/github/hetzner/runners/scripts/startup-x64.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ cd /home/ubuntu
99

1010
# GitHub Actions Runner - update version and checksum when upgrading
1111
# https://github.com/actions/runner/releases
12-
ACTIONS_RUNNER_VERSION="2.330.0"
13-
ACTIONS_RUNNER_SHA256="af5c33fa94f3cc33b8e97937939136a6b04197e6dadfcfb3b6e33ae1bf41e79a"
12+
ACTIONS_RUNNER_VERSION="2.331.0"
13+
ACTIONS_RUNNER_SHA256="5fcc01bd546ba5c3f1291c2803658ebd3cedb3836489eda3be357d41bfcf28a7"
1414

1515
ACTIONS_RUNNER_ARCH="x64"
1616
ACTIONS_RUNNER_FILE="actions-runner-linux-${ACTIONS_RUNNER_ARCH}-${ACTIONS_RUNNER_VERSION}.tar.gz"

testflows/github/hetzner/runners/servers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import os
1616
import sys
1717

18-
from github import Github
18+
from github import Auth, Github
1919
from github.Repository import Repository
2020
from github.SelfHostedActionsRunner import SelfHostedActionsRunner
2121

@@ -57,7 +57,7 @@ def list(args, config: Config):
5757
client = Client(token=config.hetzner_token)
5858

5959
with Action("Logging in to GitHub"):
60-
github = Github(login_or_token=config.github_token)
60+
github = Github(auth=Auth.Token(config.github_token))
6161

6262
with Action(f"Getting repository {config.github_repository}"):
6363
repo: Repository = github.get_repo(config.github_repository)
@@ -207,7 +207,7 @@ def delete(args, config: Config):
207207
client = Client(token=config.hetzner_token)
208208

209209
with Action("Logging in to GitHub"):
210-
github = Github(login_or_token=config.github_token)
210+
github = Github(auth=Auth.Token(config.github_token))
211211

212212
with Action(f"Getting repository {config.github_repository}"):
213213
repo: Repository = github.get_repo(config.github_repository)

0 commit comments

Comments
 (0)