Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jackietung-redpanda committed Aug 30, 2024
1 parent 8c56abc commit 2917d30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_plugin_uploader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: install deps
working-directory: resources/plugin_uploader
run: pip install -r requirements_dev.txt
run: pip install -r requirements_test.txt

- name: run unit tests
working-directory: resources/plugin_uploader
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

- name: install deps
working-directory: resources/plugin_uploader
run: pip install -r requirements_dev.txt
run: pip install -r requirements_test.txt

- name: run pyright
working-directory: resources/plugin_uploader
Expand Down
10 changes: 3 additions & 7 deletions resources/plugin_uploader/plugin_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import click

from pydantic import BaseModel
from contextlib import contextmanager


# Partial schema of goreleaser metadata.json
Expand Down Expand Up @@ -68,9 +69,7 @@ def get_binary_sha256_digest(filepath: str) -> str:
def get_artifacts(artifacts_file: str) -> list[Artifact]:
with open(artifacts_file, "r") as f:
data = json.load(f)
assert (
type(data) is list
), f"Expected {artifacts_file} to contain a JSON list payload"
assert isinstance(data, list), f"Expected {artifacts_file} to contain a JSON list payload"
result = []
for item in data:
artifact = Artifact(**item)
Expand All @@ -81,9 +80,7 @@ def get_artifacts(artifacts_file: str) -> list[Artifact]:
def get_metadata(metadata_file: str) -> Metadata:
with open(metadata_file, "r") as f:
data = json.load(f)
assert (
type(data) is dict
), f"Expected {metadata_file} to contain a JSON dict payload"
assert isinstance(data, dict), f"Expected {metadata_file} to contain a JSON dict payload"
return Metadata(**data)


Expand Down Expand Up @@ -155,7 +152,6 @@ def create_tar_gz_archive(single_filepath: str) -> str:
TAG_GOARCH = "redpanda/goarch"
TAG_VERSION = "redpanda/version"

from contextlib import contextmanager


@contextmanager
Expand Down

0 comments on commit 2917d30

Please sign in to comment.