Skip to content

Commit

Permalink
[Experimental] Add automated versioning with setuptools_scm. (#37)
Browse files Browse the repository at this point in the history
* Attempt to add automated versioning.

* Support sphinx as well.
  • Loading branch information
rexwangcc committed May 2, 2018
1 parent 2da2741 commit db106e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
import os
import sys
from pkg_resources import get_distribution
sys.path.insert(0, os.path.abspath('..'))


Expand All @@ -26,7 +27,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.1.9'
release = get_distribution('sctools').version


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

setup(
name='sctools',
version='0.1.6',
use_scm_version=True,
setup_requires=['setuptools_scm'],
description='Utilities for large-scale distributed single cell data processing',
url='https://github.com/humancellatlas/sctools.git',
author='Ambrose J. Carr',
Expand All @@ -29,6 +30,7 @@
'sphinx',
'sphinxcontrib-napoleon',
'sphinx_rtd_theme',
'setuptools_scm'
],
entry_points={
'console_scripts': [
Expand Down
7 changes: 7 additions & 0 deletions src/sctools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@
from . import reader
from . import metrics
from . import platform
from pkg_resources import get_distribution, DistributionNotFound


try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
pass

0 comments on commit db106e4

Please sign in to comment.