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
|
2016-06-19 10:25:40 +00:00
|
|
|
from setuptools.command.test import test as test_command
|
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-06-19 10:25:40 +00:00
|
|
|
class Tox(test_command):
|
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"""
|
2016-06-19 10:25:40 +00:00
|
|
|
test_command.initialize_options(self)
|
2015-12-30 15:58:28 +00:00
|
|
|
self.tox_args = None
|
|
|
|
|
|
|
|
def finalize_options(self):
|
2016-01-05 09:39:28 +00:00
|
|
|
"""finalize user-options"""
|
2016-06-19 10:25:40 +00:00
|
|
|
test_command.finalize_options(self)
|
2015-12-30 15:58:28 +00:00
|
|
|
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
|
|
|
|
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-02-11 17:37:13 +00:00
|
|
|
name='python-escpos',
|
2016-07-17 09:17:43 +00:00
|
|
|
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',
|
2017-01-29 23:39:43 +00:00
|
|
|
license='MIT',
|
2016-03-08 17:26:23 +00:00
|
|
|
long_description=read('README.rst'),
|
2016-04-02 18:12:36 +00:00
|
|
|
author='Manuel F Martinez and others',
|
2013-03-14 06:22:43 +00:00
|
|
|
author_email='manpaz@bashlinux.com',
|
2016-04-02 18:12:36 +00:00
|
|
|
maintainer='Patrick Kanzler',
|
2016-09-02 14:56:12 +00:00
|
|
|
maintainer_email='dev@pkanzler.de',
|
2016-04-02 18:12:36 +00:00
|
|
|
keywords=[
|
|
|
|
'ESC/POS',
|
|
|
|
'thermoprinter',
|
|
|
|
'voucher printer',
|
|
|
|
'printing',
|
|
|
|
'receipt,',
|
|
|
|
],
|
|
|
|
platforms='any',
|
2016-06-20 14:41:46 +00:00
|
|
|
package_dir={"": "src"},
|
|
|
|
packages=find_packages(where="src", exclude=["tests", "tests.*"]),
|
2016-08-30 10:26:09 +00:00
|
|
|
package_data={'': ['COPYING', 'src/escpos/capabilities.json']},
|
|
|
|
include_package_data=True,
|
2013-03-14 06:22:43 +00:00
|
|
|
classifiers=[
|
2016-04-02 18:12:36 +00:00
|
|
|
'Development Status :: 4 - Beta',
|
|
|
|
'Environment :: Console',
|
2013-03-14 06:22:43 +00:00
|
|
|
'Intended Audience :: Developers',
|
2017-01-29 23:39:43 +00:00
|
|
|
'License :: OSI Approved :: MIT License',
|
2016-06-24 09:52:10 +00:00
|
|
|
'Operating System :: OS Independent',
|
2013-03-14 06:22:43 +00:00
|
|
|
'Programming Language :: Python',
|
2016-01-07 22:22:31 +00:00
|
|
|
'Programming Language :: Python :: 2',
|
|
|
|
'Programming Language :: Python :: 2.7',
|
|
|
|
'Programming Language :: Python :: 3',
|
2016-04-02 18:12:36 +00:00
|
|
|
'Programming Language :: Python :: 3.3',
|
2016-01-07 22:22:31 +00:00
|
|
|
'Programming Language :: Python :: 3.4',
|
2016-04-02 18:12:36 +00:00
|
|
|
'Programming Language :: Python :: 3.5',
|
2017-05-24 08:58:55 +00:00
|
|
|
'Programming Language :: Python :: 3.6',
|
|
|
|
'Programming Language :: Python :: 3.7',
|
2016-04-02 18:12:36 +00:00
|
|
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
|
|
'Programming Language :: Python :: Implementation :: PyPy',
|
2013-03-14 06:22:43 +00:00
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
2016-06-20 14:20:47 +00:00
|
|
|
'Topic :: Office/Business :: Financial :: Point-Of-Sale',
|
2013-03-14 06:22:43 +00:00
|
|
|
],
|
2015-11-27 20:51:58 +00:00
|
|
|
install_requires=[
|
2016-06-20 14:26:25 +00:00
|
|
|
'pyusb>=1.0.0',
|
2015-11-27 20:51:58 +00:00
|
|
|
'Pillow>=2.0',
|
|
|
|
'qrcode>=4.0',
|
|
|
|
'pyserial',
|
2016-03-03 03:21:35 +00:00
|
|
|
'six',
|
2016-03-15 19:00:19 +00:00
|
|
|
'appdirs',
|
2017-08-09 08:41:25 +00:00
|
|
|
'PyYAML',
|
2016-07-23 08:00:40 +00:00
|
|
|
'argparse',
|
|
|
|
'argcomplete',
|
2017-05-16 18:55:30 +00:00
|
|
|
'future',
|
2017-06-11 08:06:57 +00:00
|
|
|
'viivakoodi>=0.8'
|
2015-11-27 20:51:58 +00:00
|
|
|
],
|
2016-03-09 11:01:02 +00:00
|
|
|
setup_requires=[
|
|
|
|
'setuptools_scm',
|
|
|
|
],
|
2017-01-30 00:26:50 +00:00
|
|
|
tests_require=[
|
|
|
|
'jaconv',
|
|
|
|
'tox',
|
2017-08-04 12:01:26 +00:00
|
|
|
'pytest!=3.2.0',
|
2017-01-30 00:26:50 +00:00
|
|
|
'pytest-cov',
|
|
|
|
'pytest-mock',
|
|
|
|
'nose',
|
|
|
|
'scripttest',
|
|
|
|
'mock',
|
2017-09-27 08:38:42 +00:00
|
|
|
'hypothesis',
|
2017-01-30 00:26:50 +00:00
|
|
|
'flake8'
|
|
|
|
],
|
2015-12-30 15:58:28 +00:00
|
|
|
cmdclass={'test': Tox},
|
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
|
|
|
)
|