|
1 | 1 |
|
2 | | -from setuptools import setup |
3 | | - |
4 | | -setup(name="python_epson_printer", |
5 | | - version="1.7.1", |
6 | | - description="A library to control Epson thermal printers based on ESC/POS language", |
7 | | - url="https://github.com/benoitguigal/python-epson-printer", |
8 | | - author="benoitguigal", |
9 | | - author_email="benoit.guigal@gmail.com", |
10 | | - packages=['epson_printer'], |
11 | | - install_requires=[ |
12 | | - 'pyusb==1.0.0b1', |
13 | | - 'Pillow==2.6' |
14 | | - ]) |
| 2 | +# Always prefer setuptools over distutils |
| 3 | +from setuptools import setup, find_packages |
| 4 | +import os |
| 5 | +import re |
| 6 | + |
| 7 | + |
| 8 | +def get_version(package): |
| 9 | + """ |
| 10 | + Return package version as listed in `__version__` in `init.py`. |
| 11 | + """ |
| 12 | + init_py = open(os.path.join(package, '__init__.py')).read() |
| 13 | + return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) |
| 14 | + |
| 15 | +setup( |
| 16 | + name='python-epson-printer', |
| 17 | + |
| 18 | + # Versions should comply with PEP440. For a discussion on single-sourcing |
| 19 | + # the version across setup.py and the project code, see |
| 20 | + # https://packaging.python.org/en/latest/single_source_version.html |
| 21 | + version=get_version('epson_printer'), |
| 22 | + |
| 23 | + description='A library to control Epson thermal printers based on ESC/POS language', |
| 24 | + |
| 25 | + # The project's main homepage. |
| 26 | + url='https://github.com/benoitguigal/python-epson-printer/', |
| 27 | + |
| 28 | + # Author details |
| 29 | + author='Benoit Guigal', |
| 30 | + author_email='benoit.guigal@gmail.com', |
| 31 | + |
| 32 | + # Choose your license |
| 33 | + license='MIT', |
| 34 | + |
| 35 | + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers |
| 36 | + classifiers=[ |
| 37 | + # How mature is this project? Common values are |
| 38 | + # 3 - Alpha |
| 39 | + # 4 - Beta |
| 40 | + # 5 - Production/Stable |
| 41 | + 'Development Status :: 4 - Beta', |
| 42 | + |
| 43 | + # Indicate who your project is intended for |
| 44 | + 'Intended Audience :: Developers', |
| 45 | + 'Topic :: Software Development :: Build Tools', |
| 46 | + |
| 47 | + # Pick your license as you wish (should match "license" above) |
| 48 | + 'License :: OSI Approved :: MIT License', |
| 49 | + |
| 50 | + # Specify the Python versions you support here. In particular, ensure |
| 51 | + # that you indicate whether you support Python 2, Python 3 or both. |
| 52 | + 'Programming Language :: Python :: 2', |
| 53 | + 'Programming Language :: Python :: 2.6', |
| 54 | + 'Programming Language :: Python :: 2.7', |
| 55 | + ], |
| 56 | + |
| 57 | + # What does your project relate to? |
| 58 | + keywords='epson printer escpos', |
| 59 | + |
| 60 | + # You can just specify the packages manually here if your project is |
| 61 | + # simple. Or you can use find_packages(). |
| 62 | + packages=find_packages(exclude=['tests*']), |
| 63 | + |
| 64 | + # List run-time dependencies here. These will be installed by pip when |
| 65 | + # your project is installed. For an analysis of "install_requires" vs pip's |
| 66 | + # requirements files see: |
| 67 | + # https://packaging.python.org/en/latest/requirements.html |
| 68 | + install_requires=[ |
| 69 | + 'pyusb>=1.0.0', |
| 70 | + 'Pillow>=3.1.0', |
| 71 | + 'numpy>=1.11.0' |
| 72 | + ] |
| 73 | + |
| 74 | +) |
0 commit comments