Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add git tag version in wheel build
  • Loading branch information
Angeluz-07 committed Apr 17, 2020
commit 28e4dc60f303043a9e31ba350bb507136617fdf1
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
from setuptools import setup, find_packages
import sys


def get_version() -> str:
version = {}
path_to_file_with_version = "time_tracker_api/__init__.py"
try:
with open(path_to_file_with_version) as fp:
exec(fp.read(), version)
__version__ = version['__version__']
return __version__
except KeyError:
print(f'Error: No variable ___version___ in {path_to_file_with_version}')
sys.exit()


setup(
name="time-tracker-backend",
version=get_version(),
packages=find_packages(),
include_package_data=True,
)