2013-03-14 06:22:43 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2015-12-30 15:58:28 +00:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
from setuptools import setup
|
|
|
|
from setuptools.command.test import test as TestCommand
|
|
|
|
|
2016-01-08 02:34:14 +00:00
|
|
|
|
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
|
|
|
|
2015-12-30 15:58:28 +00:00
|
|
|
class Tox(TestCommand):
|
2016-01-05 09:39:28 +00:00
|
|
|
"""proxy class that enables tox to be run with setup.py test"""
|
2015-12-30 15:58:28 +00:00
|
|
|
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
|
|
|
|
|
|
|
|
def initialize_options(self):
|
2016-01-05 09:39:28 +00:00
|
|
|
"""initialize the user-options"""
|
2015-12-30 15:58:28 +00:00
|
|
|
TestCommand.initialize_options(self)
|
|
|
|
self.tox_args = None
|
|
|
|
|
|
|
|
def finalize_options(self):
|
2016-01-05 09:39:28 +00:00
|
|
|
"""finalize user-options"""
|
2015-12-30 15:58:28 +00:00
|
|
|
TestCommand.finalize_options(self)
|
|
|
|
self.test_args = []
|
|
|
|
self.test_suite = True
|
|
|
|
|
|
|
|
def run_tests(self):
|
2016-01-05 09:39:28 +00:00
|
|
|
"""run tox and pass on user-options"""
|
2016-01-08 02:34:14 +00:00
|
|
|
# import here, cause outside the eggs aren't loaded
|
2015-12-30 15:58:28 +00:00
|
|
|
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
|
|
|
|
|
|
|
setup(
|
|
|
|
name='escpos',
|
2015-10-27 20:45:15 +00:00
|
|
|
version='1.0.8',
|
2015-06-04 22:55:14 +00:00
|
|
|
url='https://github.com/manpaz/python-escpos',
|
|
|
|
download_url='https://github.com/manpaz/python-escpos.git',
|
2013-03-14 06:22:43 +00:00
|
|
|
description='Python library to manipulate ESC/POS Printers',
|
|
|
|
license='GNU GPL v3',
|
2015-12-30 15:58:28 +00:00
|
|
|
long_description=read('README'),
|
2013-03-14 06:22:43 +00:00
|
|
|
author='Manuel F Martinez',
|
|
|
|
author_email='manpaz@bashlinux.com',
|
|
|
|
platforms=['linux'],
|
|
|
|
packages=[
|
|
|
|
'escpos',
|
|
|
|
],
|
|
|
|
package_data={'': ['COPYING']},
|
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 1 - Alpha',
|
|
|
|
'License :: OSI Approved :: GNU GPL v3',
|
|
|
|
'Operating System :: GNU/Linux',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Programming Language :: Python',
|
2016-01-07 22:22:31 +00:00
|
|
|
'Programming Language :: Python :: 2',
|
|
|
|
'Programming Language :: Python :: 2.7',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3.4',
|
2015-11-27 20:51:58 +00:00
|
|
|
'Topic :: System :: Peripherals',
|
2013-03-14 06:22:43 +00:00
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
|
|
],
|
2015-11-27 20:51:58 +00:00
|
|
|
install_requires=[
|
|
|
|
'pyusb',
|
|
|
|
'Pillow>=2.0',
|
|
|
|
'qrcode>=4.0',
|
|
|
|
'pyserial',
|
|
|
|
],
|
2015-12-30 15:58:28 +00:00
|
|
|
tests_require=['tox'],
|
|
|
|
cmdclass={'test': Tox},
|
2013-03-14 06:22:43 +00:00
|
|
|
)
|