Skip to content

Commit

Permalink
improve setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lanpa committed Jul 4, 2019
1 parent ee90302 commit e136d41
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions setup.py
Expand Up @@ -30,18 +30,16 @@ def run(self):
with open('HISTORY.rst') as history_file:
history = history_file.read()

# comment if preparing PyPI package
# version = '1.8'
preparing_PyPI_package = False
version_git = version = '1.8'

# if os.path.exists('.git'):
# sha = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
# version_git = version + '+' + sha[:7]
# else:
# version_git = version
if not preparing_PyPI_package:
if os.path.exists('.git'):
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
version_git = version_git + '+' + sha[:7]

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

requirements = [
'numpy',
Expand Down Expand Up @@ -90,8 +88,8 @@ def run(self):


# checklist: update History.rst readme.md
# version=version_git <--- change to sha-less version (in setup.py)
# __version__ = "1.x" (__init__.py)
# change preparing_PyPI_package to True
# remove __version__ = "1.old" in __init__.py
# commit
# add tag
# python setup.py sdist bdist_wheel --universal
Expand Down

0 comments on commit e136d41

Please sign in to comment.