Skip to content

Commit

Permalink
Add version info. closes lanpa#350 (lanpa#354)
Browse files Browse the repository at this point in the history
* add version info and appends git sha for setup.py

* add default version info if setup.py is not run.
  • Loading branch information
lanpa authored Feb 10, 2019
1 parent 8a862c8 commit 28cbf7f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ def run(self):
with open('HISTORY.rst') as history_file:
history = history_file.read()

version = '1.6'
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
version_git = version + '+' + sha[:7]

with open('tensorboardX/__init__.py', 'a') as f:
f.write('\n__version__ = "{}"\n'.format(version_git))


requirements = [
'numpy',
'protobuf >= 3.2.0',
Expand All @@ -43,7 +51,7 @@ def run(self):

setup(
name='tensorboardX',
version='1.6',
version=version,
description='TensorBoardX lets you watch Tensors Flow without Tensorflow',
long_description=history,
author='Tzu-Wei Huang',
Expand Down
2 changes: 2 additions & 0 deletions tensorboardX/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
from .record_writer import RecordWriter
from .torchvis import TorchVis
from .writer import FileWriter, SummaryWriter

__version__ = "1.6" # will be overwritten if run setup.py

0 comments on commit 28cbf7f

Please sign in to comment.