From e7ad91045c6a70eefbf191ef7e07e57a67b52a39 Mon Sep 17 00:00:00 2001 From: mtkennerly Date: Sat, 7 May 2022 06:09:02 +0800 Subject: [PATCH] Release patch-v0.16.0 and plugin-v0.2.0 --- CHANGELOG.md | 3 ++- pyproject.plugin.toml | 2 +- pyproject.toml | 2 +- tasks.py | 35 +++++++++++++++++++++++++++++------ 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8bde64..0fde7c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -## Unreleased +## poetry-dynamic-versioning: v0.16.0 & poetry-dynamic-versioning-plugin: v0.2.0 (2022-05-07) + * Changed: * Option `tool.poetry-dynamic-versioning.subversion.tag-dir` is now `tool.poetry-dynamic-versioning.tag-dir`. * Added: diff --git a/pyproject.plugin.toml b/pyproject.plugin.toml index 55df150..d587d0c 100644 --- a/pyproject.plugin.toml +++ b/pyproject.plugin.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "poetry-dynamic-versioning-plugin" -version = "0.1.0" +version = "0.2.0" description = "Plugin for Poetry to enable dynamic versioning based on VCS tags" license = "MIT" authors = ["Matthew T. Kennerly "] diff --git a/pyproject.toml b/pyproject.toml index ebc0174..4236086 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "poetry-dynamic-versioning" -version = "0.15.0" +version = "0.16.0" description = "Plugin for Poetry to enable dynamic versioning based on VCS tags" license = "MIT" authors = ["Matthew T. Kennerly "] diff --git a/tasks.py b/tasks.py index 13beab0..14c6a76 100644 --- a/tasks.py +++ b/tasks.py @@ -13,26 +13,34 @@ PLUGIN_LOCK = ROOT / "poetry.plugin.lock" -@task -def patch(ctx): +def switch_to_patch(): if PATCH_PYPROJECT.exists(): PYPROJECT.rename(PLUGIN_PYPROJECT) PATCH_PYPROJECT.rename(PYPROJECT) if PATCH_LOCK.exists(): LOCK.rename(PLUGIN_LOCK) PATCH_LOCK.rename(LOCK) - with ctx.cd(ROOT): - ctx.run("poetry install") -@task -def plugin(ctx): +def switch_to_plugin(): if PLUGIN_PYPROJECT.exists(): PYPROJECT.rename(PATCH_PYPROJECT) PLUGIN_PYPROJECT.rename(PYPROJECT) if PLUGIN_LOCK.exists(): LOCK.rename(PATCH_LOCK) PLUGIN_LOCK.rename(LOCK) + + +@task +def patch(ctx): + switch_to_patch() + with ctx.cd(ROOT): + ctx.run("poetry install") + + +@task +def plugin(ctx): + switch_to_plugin() with ctx.cd(ROOT): ctx.run("poetry install") @@ -67,3 +75,18 @@ def install(ctx): @task def uninstall(ctx): ctx.run("pip uninstall -y poetry-dynamic-versioning poetry-dynamic-versioning-plugin") + + +@task +def release(ctx, patch=False, plugin=False): + started_as_patch = PLUGIN_PYPROJECT.exists() + + if patch: + switch_to_patch() + build(ctx) + if plugin: + switch_to_plugin() + build(ctx) + + if started_as_patch: + switch_to_patch()