Skip to content

Commit

Permalink
style: beautify 76ed593
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 27, 2024
1 parent 76ed593 commit 34226d2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
4 changes: 1 addition & 3 deletions semantic_release/changelog/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,5 @@ def make_changelog_context(
repo_owner=hvcs_client.owner,
history=release_history,
hvcs_type=hvcs_client.__class__.__name__.lower(),
filters=(
*hvcs_client.get_changelog_context_filters(),
),
filters=(*hvcs_client.get_changelog_context_filters(),),
)
4 changes: 3 additions & 1 deletion semantic_release/cli/commands/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def publish(cli_ctx: CliContextObj, tag: str = "latest") -> None:
)

if not isinstance(hvcs_client, RemoteHvcsBase):
log.info("Remote does not support artifact upload. Exiting with no action taken...")
log.info(
"Remote does not support artifact upload. Exiting with no action taken..."
)
ctx.exit(0)

if runtime.global_cli_options.noop:
Expand Down
2 changes: 2 additions & 0 deletions semantic_release/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ class UnexpectedResponse(SemanticReleaseBaseError):
is not found.
"""


class IncompleteReleaseError(SemanticReleaseBaseError):
"""
Raised when there is a failure amongst one of the api requests when creating a
release on a remote hvcs.
"""


class AssetUploadError(SemanticReleaseBaseError):
"""
Raised when there is a failure uploading an asset to a remote hvcs's release artifact
Expand Down
19 changes: 15 additions & 4 deletions tests/unit/semantic_release/changelog/test_changelog_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def changelog_tpl_github_context() -> str:
"""
).lstrip()


@pytest.fixture
def changelog_tpl_gitea_context() -> str:
"""Returns an changelog template which uses all the Gitea configured filters"""
Expand All @@ -65,6 +66,7 @@ def changelog_tpl_gitea_context() -> str:
"""
).lstrip()


@pytest.fixture
def changelog_tpl_gitlab_context() -> str:
"""Returns an changelog template which uses all the GitLab configured filters"""
Expand All @@ -90,6 +92,7 @@ def changelog_tpl_gitlab_context() -> str:
"""
).lstrip()


@pytest.fixture
def changelog_tpl_bitbucket_context() -> str:
"""Returns an changelog template which uses all the BitBucket configured filters"""
Expand Down Expand Up @@ -194,7 +197,9 @@ def test_changelog_context_bitbucket(
)

env = environment(trim_blocks=True, lstrip_blocks=True, keep_trailing_newline=True)
context = make_changelog_context(hvcs_client=hvcs, release_history=artificial_release_history)
context = make_changelog_context(
hvcs_client=hvcs, release_history=artificial_release_history
)
context.bind_to_environment(env)

# Create changelog from template with environment
Expand Down Expand Up @@ -235,7 +240,9 @@ def test_changelog_context_github(
)

env = environment(trim_blocks=True, lstrip_blocks=True, keep_trailing_newline=True)
context = make_changelog_context(hvcs_client=hvcs, release_history=artificial_release_history)
context = make_changelog_context(
hvcs_client=hvcs, release_history=artificial_release_history
)
context.bind_to_environment(env)

# Create changelog from template with environment
Expand Down Expand Up @@ -274,7 +281,9 @@ def test_changelog_context_gitea(
)

env = environment(trim_blocks=True, lstrip_blocks=True, keep_trailing_newline=True)
context = make_changelog_context(hvcs_client=hvcs, release_history=artificial_release_history)
context = make_changelog_context(
hvcs_client=hvcs, release_history=artificial_release_history
)
context.bind_to_environment(env)

# Create changelog from template with environment
Expand Down Expand Up @@ -316,7 +325,9 @@ def test_changelog_context_gitlab(
)

env = environment(trim_blocks=True, lstrip_blocks=True, keep_trailing_newline=True)
context = make_changelog_context(hvcs_client=hvcs, release_history=artificial_release_history)
context = make_changelog_context(
hvcs_client=hvcs, release_history=artificial_release_history
)
context.bind_to_environment(env)

# Create changelog from template with environment
Expand Down
1 change: 0 additions & 1 deletion tests/unit/semantic_release/hvcs/test__base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class ArbitraryHvcs(HvcsBase):

def remote_url(self, use_token: bool) -> str:
return super().remote_url(use_token)

Expand Down

0 comments on commit 34226d2

Please sign in to comment.