2016-08-25 13:55:14 +00:00
|
|
|
#!/usr/bin/env python
|
2013-03-14 06:22:43 +00:00
|
|
|
|
2015-12-30 15:58:28 +00:00
|
|
|
import os
|
|
|
|
import sys
|
2016-06-20 14:41:46 +00:00
|
|
|
from setuptools import find_packages, setup
|
2015-12-30 15:58:28 +00:00
|
|
|
|
2016-01-08 02:34:14 +00:00
|
|
|
|
2016-06-20 14:41:46 +00:00
|
|
|
base_dir = os.path.dirname(__file__)
|
|
|
|
src_dir = os.path.join(base_dir, "src")
|
|
|
|
|
|
|
|
# When executing the setup.py, we need to be able to import ourselves, this
|
|
|
|
# means that we need to add the src/ directory to the sys.path.
|
|
|
|
sys.path.insert(0, src_dir)
|
|
|
|
|
|
|
|
|
2015-12-30 15:58:28 +00:00
|
|
|
def read(fname):
|
|
|
|
"""read file from same path as setup.py"""
|
|
|
|
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
|
|
|
|
2016-01-08 02:34:14 +00:00
|
|
|
|
2016-07-17 09:17:43 +00:00
|
|
|
setuptools_scm_template = """\
|
|
|
|
# coding: utf-8
|
|
|
|
# file generated by setuptools_scm
|
|
|
|
# don't change, don't track in version control
|
2017-01-30 01:29:08 +00:00
|
|
|
from __future__ import absolute_import
|
|
|
|
from __future__ import division
|
|
|
|
from __future__ import print_function
|
2016-07-17 09:17:43 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
version = '{version}'
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2013-03-14 06:22:43 +00:00
|
|
|
setup(
|
2016-07-17 09:17:43 +00:00
|
|
|
use_scm_version={
|
|
|
|
'write_to': 'src/escpos/version.py',
|
|
|
|
'write_to_template': setuptools_scm_template,
|
|
|
|
},
|
2016-04-02 18:12:36 +00:00
|
|
|
platforms='any',
|
2016-06-20 14:41:46 +00:00
|
|
|
package_dir={"": "src"},
|
|
|
|
packages=find_packages(where="src", exclude=["tests", "tests.*"]),
|
2019-06-19 12:14:59 +00:00
|
|
|
package_data={'escpos': ['capabilities.json']},
|
2016-06-23 14:53:58 +00:00
|
|
|
entry_points={
|
|
|
|
'console_scripts': [
|
|
|
|
'python-escpos = escpos.cli:main'
|
|
|
|
]
|
|
|
|
},
|
2013-03-14 06:22:43 +00:00
|
|
|
)
|