diff --git a/doc/conf.py b/doc/conf.py index 8e26290..fe25835 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -15,11 +15,13 @@ import sys import os on_rtd = os.getenv('READTHEDOCS') == 'True' +from setuptools_scm import get_version # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) +root = os.path.relpath(os.path.join(os.path.dirname(__file__), '..')) # -- General configuration ------------------------------------------------ @@ -64,9 +66,9 @@ copyright = u'2016, Manuel F Martinez and others' # built documents. # # The short X.Y version. -version = '1.0.8' +version = get_version(root=root) # The full version, including alpha/beta/rc tags. -release = '1.0.8' +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/requirements.txt b/doc/requirements.txt index 1cdf7f4..fd5f86f 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,4 +2,5 @@ pyusb Pillow>=2.0 qrcode>=4.0 pyserial -sphinx-rtd-theme \ No newline at end of file +sphinx-rtd-theme +setuptools-scm \ No newline at end of file diff --git a/setup.py b/setup.py index 2727221..b2f2ba4 100755 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ class Tox(TestCommand): setup( name='python-escpos', - version='1.0.9-dev', + use_scm_version=True, url='https://github.com/python-escpos/python-escpos', download_url='https://github.com/python-escpos/python-escpos/archive/master.zip', description='Python library to manipulate ESC/POS Printers', @@ -72,6 +72,9 @@ setup( 'pyserial', 'six', ], + setup_requires=[ + 'setuptools_scm', + ], tests_require=['tox', 'nose'], cmdclass={'test': Tox}, )