mirror of
https://github.com/python-escpos/python-escpos
synced 2025-08-24 09:03:34 +00:00
add version-strings into the module
The version string is in the module as __version__ available. In the doc the version will be automatically parsed. The version comes from the installed module if on read the docs or directly from setuptools_scm if you are working locally. The CLI will issue the version string if you call it with the option 'version'. The CLI does not accept commands like '--version', since this would not be conform with the rest of the interface (and argparse). The configuration for loading the version-string is adapted from pimutils/vdirsyncer. It autogenerates a version string setuptools_scm at install-time and then adds it to the __version__ member in __init__.py I adapted the GitHub-template with a fitting comment and bumped the changelog. closes #141
This commit is contained in:
17
setup.py
17
setup.py
@@ -45,9 +45,24 @@ class Tox(test_command):
|
||||
errno = tox.cmdline(args=args)
|
||||
sys.exit(errno)
|
||||
|
||||
|
||||
setuptools_scm_template = """\
|
||||
# coding: utf-8
|
||||
# file generated by setuptools_scm
|
||||
# don't change, don't track in version control
|
||||
from __future__ import unicode_literals
|
||||
|
||||
version = '{version}'
|
||||
|
||||
"""
|
||||
|
||||
|
||||
setup(
|
||||
name='python-escpos',
|
||||
use_scm_version=True,
|
||||
use_scm_version={
|
||||
'write_to': 'src/escpos/version.py',
|
||||
'write_to_template': setuptools_scm_template,
|
||||
},
|
||||
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',
|
||||
|
Reference in New Issue
Block a user