Skip to content

Commit

Permalink
versioning from git-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
yaghoubi committed Sep 30, 2024
1 parent 2697624 commit 3b74376
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import subprocess

from setuptools import setup, find_packages

version = "0.1.7"

def get_version():
try:
# Run the git describe command to get the latest tag
version = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode('utf-8')
except subprocess.CalledProcessError:
# If there is an error (e.g., no git or no tags), fall back to a default version
version = "0.0.1"

return version


setup(
name='django_daisy',
version='0.1.7',
version=get_version(),
packages=find_packages(),
include_package_data=True,
install_requires=[], # Add dependencies here
Expand Down

0 comments on commit 3b74376

Please sign in to comment.