mirror of
https://github.com/element-hq/synapse.git
synced 2025-11-09 00:02:41 -05:00
Fix deprecation warning in release script (#19080)
This commit is contained in:
parent
45a042ae88
commit
a092d2053a
1
changelog.d/19080.misc
Normal file
1
changelog.d/19080.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Update deprecated code in the release script to prevent a warning message from being printed.
|
||||||
@ -38,6 +38,7 @@ import attr
|
|||||||
import click
|
import click
|
||||||
import git
|
import git
|
||||||
import github
|
import github
|
||||||
|
import github.Auth
|
||||||
from click.exceptions import ClickException
|
from click.exceptions import ClickException
|
||||||
from git import GitCommandError, Repo
|
from git import GitCommandError, Repo
|
||||||
from github import BadCredentialsException, Github
|
from github import BadCredentialsException, Github
|
||||||
@ -429,7 +430,7 @@ def _publish(gh_token: str) -> None:
|
|||||||
|
|
||||||
if gh_token:
|
if gh_token:
|
||||||
# Test that the GH Token is valid before continuing.
|
# Test that the GH Token is valid before continuing.
|
||||||
gh = Github(gh_token)
|
gh = Github(auth=github.Auth.Token(token=gh_token))
|
||||||
gh.get_user()
|
gh.get_user()
|
||||||
|
|
||||||
# Make sure we're in a git repo.
|
# Make sure we're in a git repo.
|
||||||
@ -442,7 +443,7 @@ def _publish(gh_token: str) -> None:
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Publish the draft release
|
# Publish the draft release
|
||||||
gh = Github(gh_token)
|
gh = Github(auth=github.Auth.Token(token=gh_token))
|
||||||
gh_repo = gh.get_repo("element-hq/synapse")
|
gh_repo = gh.get_repo("element-hq/synapse")
|
||||||
for release in gh_repo.get_releases():
|
for release in gh_repo.get_releases():
|
||||||
if release.title == tag_name:
|
if release.title == tag_name:
|
||||||
@ -487,8 +488,13 @@ def _upload(gh_token: Optional[str]) -> None:
|
|||||||
click.echo(f"Tag {tag_name} ({tag.commit}) is not currently checked out!")
|
click.echo(f"Tag {tag_name} ({tag.commit}) is not currently checked out!")
|
||||||
click.get_current_context().abort()
|
click.get_current_context().abort()
|
||||||
|
|
||||||
|
if gh_token:
|
||||||
|
gh = Github(auth=github.Auth.Token(token=gh_token))
|
||||||
|
else:
|
||||||
|
# Use github anonymously.
|
||||||
|
gh = Github()
|
||||||
|
|
||||||
# Query all the assets corresponding to this release.
|
# Query all the assets corresponding to this release.
|
||||||
gh = Github(gh_token)
|
|
||||||
gh_repo = gh.get_repo("element-hq/synapse")
|
gh_repo = gh.get_repo("element-hq/synapse")
|
||||||
gh_release = gh_repo.get_release(tag_name)
|
gh_release = gh_repo.get_release(tag_name)
|
||||||
|
|
||||||
@ -764,7 +770,7 @@ Ask the designated people to do the blog and tweets."""
|
|||||||
def full(gh_token: str) -> None:
|
def full(gh_token: str) -> None:
|
||||||
if gh_token:
|
if gh_token:
|
||||||
# Test that the GH Token is valid before continuing.
|
# Test that the GH Token is valid before continuing.
|
||||||
gh = Github(gh_token)
|
gh = Github(auth=github.Auth.Token(token=gh_token))
|
||||||
gh.get_user()
|
gh.get_user()
|
||||||
|
|
||||||
click.echo("1. If this is a security release, read the security wiki page.")
|
click.echo("1. If this is a security release, read the security wiki page.")
|
||||||
@ -850,7 +856,7 @@ def check_valid_gh_token(gh_token: Optional[str]) -> None:
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gh = Github(gh_token)
|
gh = Github(auth=github.Auth.Token(token=gh_token))
|
||||||
|
|
||||||
# We need to lookup name to trigger a request.
|
# We need to lookup name to trigger a request.
|
||||||
_name = gh.get_user().name
|
_name = gh.get_user().name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user