Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version tag to local builds with git #3193

Closed
Closed
Show file tree
Hide file tree
Changes from 4 commits
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
14 changes: 14 additions & 0 deletions composer/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@

"""The Composer Version."""

import inspect
import os
import subprocess

__version__ = '0.21.2'

# Add the git sha to the version if available
file_path = inspect.getfile(lambda: None) # more robust than __file__
cwd = os.path.dirname(file_path)
sha = None
try:
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
__version__ += '+' + sha[:7]
except Exception:
pass
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import os
import site
import subprocess
mvpatel2000 marked this conversation as resolved.
Show resolved Hide resolved
import sys
import textwrap

Expand Down
Loading