Skip to content

Commit

Permalink
fix(version): dynamic versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianLusina committed Aug 16, 2023
1 parent e473997 commit 0db7347
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
13 changes: 13 additions & 0 deletions kvault/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Contains version information about package
"""
import os

__version__ = os.environ.get(
"PACKAGE_VERSION",
os.environ.get("CI_COMMIT_TAG",
os.environ.get("GITHUB_REF_NAME",
os.environ.get("VERSION", "0.1-dev")
)
)
)
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tool.poetry]
name = "kvault"
version = "0.1.0"
# This version field is not being used. The version field is dynamicall updated as below
version = "0.0.0"
description = "Simple Miniature key-value datastore"
authors = ["BrianLusina <[email protected]>"]
license = "MIT"
Expand All @@ -27,6 +28,13 @@ python-dotenv = "^1.0.0"
[tool.poetry.group.dev.dependencies]
pytest-cov = "^4.1.0"

[tool.setuptools.dynamic]
version = { attr = "kvault.__version__" }

# Reference: https://github.com/tiangolo/poetry-version-plugin
[tool.poetry-version-plugin]
source = "git-tag"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 0db7347

Please sign in to comment.