From 64bdf4846dd79c82b091243da4d79b86e1773031 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 09:02:36 -0600 Subject: [PATCH] chore: upgrade required python version to 3.7 --- .github/workflows/deploy.yml | 2 +- github_deploy/commands/_repo_utils.py | 8 ++++---- github_deploy/commands/_utils.py | 4 ++-- github_deploy/commands/delete.py | 4 ++-- github_deploy/main.py | 2 +- setup.py | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 43ab2a6..b02f205 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.6.x' + python-version: '3.7.x' - name: Upgrade pip run: pip install -U pip diff --git a/github_deploy/commands/_repo_utils.py b/github_deploy/commands/_repo_utils.py index ac6c068..438d970 100644 --- a/github_deploy/commands/_repo_utils.py +++ b/github_deploy/commands/_repo_utils.py @@ -10,7 +10,7 @@ async def list_repos(*, session, org, token): url = REPOS_URL.format(org=org) - click.echo("Retrieving repos at {}".format(url)) + click.echo(f"Retrieving repos at {url}") response = await get(session=session, url=url, headers=get_headers(token=token)) return response @@ -25,7 +25,7 @@ async def delete_content( exists, current_sha, ): - data = {"message": "Deleted {}".format(dest)} + data = {"message": f"Deleted {dest}"} if exists: data["sha"] = current_sha @@ -75,9 +75,9 @@ async def upload_content( return data = { - "message": "Updated {}".format(dest) + "message": f"Updated {dest}" if exists - else "Added {}".format(dest), + else f"Added {dest}", "content": base64_content, } if exists: diff --git a/github_deploy/commands/_utils.py b/github_deploy/commands/_utils.py index 3289654..afc4b79 100644 --- a/github_deploy/commands/_utils.py +++ b/github_deploy/commands/_utils.py @@ -1,5 +1,5 @@ def get_repo(*, org, project): - return "{org}/{project}".format(project=project, org=org) + return f"{org}/{project}" def can_upload(*, repo, include_private): @@ -12,6 +12,6 @@ def can_upload(*, repo, include_private): def get_headers(*, token): return { - "Authorization": "Bearer {token}".format(token=token), + "Authorization": f"Bearer {token}", "Accept": "application/vnd.github+json", } diff --git a/github_deploy/commands/delete.py b/github_deploy/commands/delete.py index 9cafec6..9b7209e 100644 --- a/github_deploy/commands/delete.py +++ b/github_deploy/commands/delete.py @@ -51,7 +51,7 @@ async def handle_file_delete(*, repo, dest, token, semaphore, session): ) return click.style( - "No content found at {repo}/{dest}".format(repo=repo, dest=dest), + f"No content found at {repo}/{dest}", fg="blue", bold=True, ) @@ -100,7 +100,7 @@ async def main(org, token, dest): ) click.echo( click.style( - 'Deleting "{path}" for all repositories:'.format(path=dest), + f'Deleting "{dest}" for all repositories:', fg="blue", ) ) diff --git a/github_deploy/main.py b/github_deploy/main.py index 246c985..c93ad51 100644 --- a/github_deploy/main.py +++ b/github_deploy/main.py @@ -28,7 +28,7 @@ def get_command(self, ctx, name): eval(code, ns, ns) return ns["main"] - ctx.fail("Invalid Command \"{name}\"".format(name=name)) + ctx.fail(f"Invalid Command \"{name}\"") main = GithubDeploy( diff --git a/setup.py b/setup.py index 5369b06..b8719f4 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ author_email="jtonye@ymail.com", license="MIT", packages=find_packages(), - python_requires=">=3.6", + python_requires=">=3.7", extras_require=extras_require, install_requires=[ "asyncclick",