Skip to content

Commit

Permalink
Release patch-v0.16.0 and plugin-v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed May 6, 2022
1 parent e9fe4f2 commit e7ad910
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.plugin.toml
Original file line number Diff line number Diff line change
@@ -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 <mtkennerly@gmail.com>"]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <mtkennerly@gmail.com>"]
Expand Down
35 changes: 29 additions & 6 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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()

0 comments on commit e7ad910

Please sign in to comment.