Commit 18c84ff3 authored by Siarhei Khaletski (EPAM)'s avatar Siarhei Khaletski (EPAM) 🚩 Committed by Yan Sushchynski (EPAM)
Browse files

GONRG-2756: Added versioning

parent 229d8618
......@@ -20,9 +20,25 @@ import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
COMMIT_BASED_VERSION = "0.0.5"
def prepare_version():
version = os.getenv("CI_COMMIT_TAG", '')
if version.startswith('v'):
# release tag version, e.g. v0.9.0
version = version[1:]
else:
# we assume that it is commit version
# https://packaging.python.org/guides/distributing-packages-using-setuptools/#local-version-identifiers
commit = os.environ["CI_COMMIT_SHORT_SHA"]
version = f"{COMMIT_BASED_VERSION}.dev+{commit}"
return version
setuptools.setup(
name="osdu_api",
version=os.environ["VERSION"],
version=prepare_version(),
author="OSDU team",
description="A package to interface with OSDU microservices",
packages=setuptools.find_packages(exclude=["*test*"]),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment