python-escpos/setup.py

127 lines
3.8 KiB
Python
Raw Normal View History

#!/usr/bin/env python
2013-03-14 06:22:43 +00:00
import os
import sys
from setuptools import find_packages, setup
2016-06-19 10:25:40 +00:00
from setuptools.command.test import test as test_command
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)
def read(fname):
"""read file from same path as setup.py"""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
2016-06-19 10:25:40 +00:00
class Tox(test_command):
"""proxy class that enables tox to be run with setup.py test"""
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
"""initialize the user-options"""
2016-06-19 10:25:40 +00:00
test_command.initialize_options(self)
self.tox_args = None
def finalize_options(self):
"""finalize user-options"""
2016-06-19 10:25:40 +00:00
test_command.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
"""run tox and pass on user-options"""
# import here, cause outside the eggs aren't loaded
import tox
import shlex
args = self.tox_args
if args:
args = shlex.split(self.tox_args)
errno = tox.cmdline(args=args)
sys.exit(errno)
2013-03-14 06:22:43 +00:00
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}'
"""
2013-03-14 06:22:43 +00:00
setup(
2016-02-11 17:37:13 +00:00
name='python-escpos',
use_scm_version={
'write_to': 'src/escpos/version.py',
'write_to_template': setuptools_scm_template,
},
2016-02-11 17:37:13 +00:00
url='https://github.com/python-escpos/python-escpos',
download_url='https://github.com/python-escpos/python-escpos/archive/master.zip',
2013-03-14 06:22:43 +00:00
description='Python library to manipulate ESC/POS Printers',
2016-03-28 15:18:28 +00:00
bugtrack_url='https://github.com/python-escpos/python-escpos/issues',
2013-03-14 06:22:43 +00:00
license='GNU GPL v3',
2016-03-08 17:26:23 +00:00
long_description=read('README.rst'),
author='Manuel F Martinez and others',
2013-03-14 06:22:43 +00:00
author_email='manpaz@bashlinux.com',
maintainer='Patrick Kanzler',
maintainer_email='patrick.kanzler@fablab.fau.de',
keywords=[
'ESC/POS',
'thermoprinter',
'voucher printer',
'printing',
'receipt,',
],
platforms='any',
package_dir={"": "src"},
packages=find_packages(where="src", exclude=["tests", "tests.*"]),
2013-03-14 06:22:43 +00:00
package_data={'': ['COPYING']},
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
2013-03-14 06:22:43 +00:00
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
2016-06-24 09:52:10 +00:00
'Operating System :: OS Independent',
2013-03-14 06:22:43 +00:00
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
2013-03-14 06:22:43 +00:00
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Office/Business :: Financial :: Point-Of-Sale',
2013-03-14 06:22:43 +00:00
],
install_requires=[
'pyusb>=1.0.0',
'Pillow>=2.0',
'qrcode>=4.0',
'pyserial',
'six',
'appdirs',
2016-03-15 20:47:23 +00:00
'pyyaml',
2016-07-23 08:00:40 +00:00
'argparse',
'argcomplete',
],
setup_requires=[
'setuptools_scm',
],
tests_require=['tox', 'nose', 'scripttest', 'mock', 'hypothesis'],
cmdclass={'test': Tox},
entry_points={
'console_scripts': [
'python-escpos = escpos.cli:main'
]
},
2013-03-14 06:22:43 +00:00
)