Skip to content

Commit

Permalink
Don't summarize changes during implicit activation
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Jun 13, 2023
1 parent 80ae33c commit b92d3bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion poetry_dynamic_versioning/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def apply(*, standalone: bool) -> None:
if not name:
raise RuntimeError("Unable to determine a dynamic version")

report_apply(name)
if standalone:
report_apply(name)


def report_apply(name: str) -> None:
Expand Down
11 changes: 8 additions & 3 deletions poetry_dynamic_versioning/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def _should_apply(command: str) -> bool:
return command not in ["run", "shell", cli.Command.dv, cli.Command.dv_enable]


def _apply_version_via_plugin(poetry: Poetry, retain: bool = False, force: bool = False) -> None:
def _apply_version_via_plugin(
poetry: Poetry, retain: bool = False, force: bool = False, standalone: bool = False
) -> None:
name = _get_and_apply_version(
name=poetry.local_config["name"],
original=poetry.local_config["version"],
Expand All @@ -80,7 +82,8 @@ def _apply_version_via_plugin(poetry: Poetry, retain: bool = False, force: bool
poetry._package._version = PoetryCoreVersion.parse(version)
poetry._package._pretty_version = version

cli.report_apply(name)
if standalone:
cli.report_apply(name)


class DynamicVersioningCommand(Command):
Expand All @@ -93,7 +96,9 @@ def __init__(self, application: Application):

def handle(self) -> int:
_state.cli_mode = True
_apply_version_via_plugin(self._application.poetry, retain=True, force=True)
_apply_version_via_plugin(
self._application.poetry, retain=True, force=True, standalone=True
)
return 0


Expand Down

0 comments on commit b92d3bd

Please sign in to comment.