Skip to content

Commit

Permalink
fix: correct lint errors
Browse files Browse the repository at this point in the history
GitHub.upload_asset now raises ValueError instead of requests.HTTPError
  • Loading branch information
bernardcooke53 committed Oct 10, 2023
1 parent b1ec8fe commit a13a6c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions semantic_release/cli/commands/version.py
Expand Up @@ -20,20 +20,14 @@
from semantic_release.cli.util import indented, noop_report, rprint
from semantic_release.const import DEFAULT_SHELL, DEFAULT_VERSION
from semantic_release.enums import LevelBump
from semantic_release.version import (
Version,
next_version,
tags_and_versions,
)
from semantic_release.version import Version, next_version, tags_and_versions

log = logging.getLogger(__name__)

if TYPE_CHECKING:
from git import Repo

from semantic_release.version import (
VersionTranslator,
)
from semantic_release.version import VersionTranslator
from semantic_release.version.declaration import VersionDeclarationABC


Expand Down Expand Up @@ -102,7 +96,10 @@ def shell(cmd: str, *, check: bool = True) -> subprocess.CompletedProcess:
if not shell:
raise TypeError("'shell' is None")

return subprocess.run([shell, "-c" if shell != "cmd" else "/c", cmd], check=check) # noqa: S603
return subprocess.run(
[shell, "-c" if shell != "cmd" else "/c", cmd], # noqa: S603
check=check,
)


@click.command(
Expand Down
2 changes: 1 addition & 1 deletion semantic_release/hvcs/github.py
Expand Up @@ -209,7 +209,7 @@ def upload_asset(
"""
url = self.asset_upload_url(release_id)
if url is None:
raise HTTPError(
raise ValueError(
"There is no associated url for uploading asset for release "
f"{release_id}. Release url: "
f"{self.api_url}/repos/{self.owner}/{self.repo_name}/releases/{release_id}"
Expand Down

0 comments on commit a13a6c3

Please sign in to comment.