Skip to content

Commit

Permalink
expose version
Browse files Browse the repository at this point in the history
  • Loading branch information
dkaslovsky committed Sep 5, 2020
1 parent 27cbd1c commit 57be484
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.1.0 / 2020-09-05
* [Added] version is exposed as `coupled_biased_random_walks.__version__`

## 2.0.0 / 2020-08-30
* [Added] type hints
* [Changed] removed support for Python 2 and <3.7
Expand Down
1 change: 1 addition & 0 deletions coupled_biased_random_walks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
CBRWFitError,
CBRWScoreError,
)
from coupled_biased_random_walks._version import __version__ # noqa: F401
1 change: 1 addition & 0 deletions coupled_biased_random_walks/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '2.1.0'
27 changes: 24 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
import os
from setuptools import setup


with open('README.md') as f:
dir_name = os.path.dirname(__file__)

readme_path = os.path.join(dir_name, 'README.md')
with open(readme_path, 'r') as f:
long_description = f.read()

with open('requirements.txt') as f:
requirements_path = os.path.join(dir_name, 'requirements.txt')
with open(requirements_path, 'r') as f:
requirements = f.read().splitlines()

version_path = os.path.join('coupled_biased_random_walks', '_version.py')
with open(version_path, 'r') as f:
version = f.read()


def parse_version(version_str: str) -> str:
"""
Parse the package version
:param version_str: string of the form "__version__ = 'x.y.z'"
"""
try:
version = version_str.split('=')[1]
except IndexError:
return 'unknown'
return version.strip(' \'\"\n')


setup(
name='coupled_biased_random_walks',
version='2.0.0',
version=parse_version(version),
author='Daniel Kaslovsky',
author_email='dkaslovsky@gmail.com',
license='MIT',
Expand Down

0 comments on commit 57be484

Please sign in to comment.