Skip to content

Commit

Permalink
Merge pull request #859 from projectsyn/renovate/pygithub-2.x
Browse files Browse the repository at this point in the history
Update dependency PyGithub to v2
  • Loading branch information
simu committed Oct 9, 2023
2 parents 3eb2430 + 9297a28 commit a94a4a7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions commodore/dependency_syncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def sync_dependencies(
deps = read_dependency_list(dependency_list, depfilter)
dep_count = len(deps)

gh = github.Github(config.github_token)
gh = github.Github(auth=github.Auth.Token(config.github_token))
# Keep track of how many PRs we've created to better avoid running into rate limits
update_count = 0
for i, dn in enumerate(deps, start=1):
Expand Down Expand Up @@ -218,10 +218,10 @@ def ensure_pr(
try:
if not has_sync_pr:
sync_pr = gr.create_pull(
f"Update from {deptype} template",
pr_body,
gr.default_branch,
branch_name,
title=f"Update from {deptype} template",
body=pr_body,
)
else:
sync_pr = [pr for pr in prs if pr.head.ref == branch_name][0]
Expand Down
13 changes: 8 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pyxdg = "0.28"
cruft = "2.15.0"
oauthlib = "3.2.2"
pyjwt = "2.8.0"
PyGithub = "1.59.1"
PyGithub = "2.1.1"
reclass-rs = "0.1.1"

[tool.poetry.dev-dependencies]
Expand Down
7 changes: 3 additions & 4 deletions tests/test_dependency_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def _setup_gh_pr_response(method, pr_body=""):
{
"title": "Update from package template",
"body": pr_body,
"draft": False,
"base": "master",
"head": "template-sync",
}
Expand Down Expand Up @@ -249,7 +248,7 @@ def test_ensure_pr(tmp_path: Path, config: Config, pr_exists: bool):
pname = "projectsyn/package-foo"
dependency_syncer.ensure_branch(p, "template-sync")

gh = github.Github(config.github_token)
gh = github.Github(auth=github.Auth.Token(config.github_token))
gr = gh.get_repo(pname)

msg = dependency_syncer.ensure_pr(
Expand Down Expand Up @@ -287,7 +286,7 @@ def test_ensure_pr_no_permission(tmp_path: Path, config: Config, pr_exists: bool
pname = "projectsyn/package-foo"
dependency_syncer.ensure_branch(p, "template-sync")

gh = github.Github(config.github_token)
gh = github.Github(auth=github.Auth.Token(config.github_token))
gr = gh.get_repo(pname)

msg = dependency_syncer.ensure_pr(p, pname, gr, "template-sync", [], "")
Expand Down Expand Up @@ -324,7 +323,7 @@ def test_ensure_pr_comment(tmp_path: Path, config: Config):
pname = "projectsyn/package-foo"
dependency_syncer.ensure_branch(p, "template-sync")

gh = github.Github(config.github_token)
gh = github.Github(auth=github.Auth.Token(config.github_token))
gr = gh.get_repo(pname)

msg = dependency_syncer.ensure_pr(
Expand Down

0 comments on commit a94a4a7

Please sign in to comment.