Skip to content

Commit

Permalink
add versioneer to manage version number
Browse files Browse the repository at this point in the history
  • Loading branch information
arahuja committed May 11, 2016
1 parent 52f1ac2 commit df8b0c0
Show file tree
Hide file tree
Showing 9 changed files with 2,281 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# .coveragerc to control coverage.py
[run]
omit =
test/*
versioneer.py
varcode/_version.py
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
varcode/_version.py export-subst
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ deploy:
secure: "H0prsAPV1n4ksLO0Zp4xq7SuGGRFmo9HhEcEtfPiSTyh8u4Zxbv/bPjyCLVDilBIKieQsuluV6jqoW6Px5LhUGZwq/k7RN7u1eNuahmpkIwWamjdsNORgvHte6inWNjKGo4GJLM232e2A50kkHnJKDZulfE8eGg4FrRQtfKSkik="
on:
branch: master
tags: true
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include varcode/_version.py
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[versioneer]
VCS = git
style = pep440
versionfile_source = varcode/_version.py
versionfile_build = varcode/_version.py
tag_prefix = 'v'
13 changes: 3 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

from __future__ import print_function
import os
import re

from setuptools import setup, find_packages
import versioneer

readme_filename = "README.md"
current_directory = os.path.dirname(__file__)
Expand All @@ -37,20 +37,13 @@
print(e)
print("Failed to convert %s from Markdown to reStructuredText" % readme_filename)

with open('varcode/__init__.py', 'r') as f:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
f.read(),
re.MULTILINE).group(1)

if not version:
raise RuntimeError("Cannot find version information")

if __name__ == '__main__':
setup(
name='varcode',
packages=find_packages(),
version=version,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Variant annotation in Python",
long_description=readme,
url="https://github.com/hammerlab/varcode",
Expand Down
6 changes: 4 additions & 2 deletions varcode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
ExonLoss,
)

__version__ = "0.4.7"

__all__ = [
# basic classes
"Variant",
Expand Down Expand Up @@ -94,3 +92,7 @@
"FrameShift",
"ExonLoss",
]

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
Loading

0 comments on commit df8b0c0

Please sign in to comment.