Skip to content

Commit

Permalink
set version in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rmrao committed May 1, 2020
1 parent 1d71bc8 commit 0cfd203
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os


def get_version():
directory = os.path.abspath(os.path.dirname(__file__))
init_file = os.path.join(directory, 'tape', '__init__.py')
with open(init_file) as f:
for line in f:
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")


with open('README.md', 'r') as rf:
Expand All @@ -14,7 +27,7 @@
setup(
name='tape_proteins',
packages=find_packages(),
version='0.4',
version=get_version(),
description="Repostory of Protein Benchmarking and Modeling",
author="Roshan Rao, Nick Bhattacharya, Neil Thomas",
author_email='[email protected], [email protected], [email protected]',
Expand Down
2 changes: 2 additions & 0 deletions tape/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import importlib
import pkgutil

__version__ = '0.4'


# Import all the models and configs
for _, name, _ in pkgutil.iter_modules([str(Path(__file__).parent / 'models')]):
Expand Down

0 comments on commit 0cfd203

Please sign in to comment.