python-escpos/setup.py

46 lines
1.1 KiB
Python
Raw Normal View History

#!/usr/bin/env python
"""Setup script for python package."""
2013-03-14 06:22:43 +00:00
import os
import sys
from setuptools import find_packages, setup
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()
setuptools_scm_template = """\
#!/usr/bin/python
# -*- coding: utf-8 -*-
\"\"\"Version identifier.
file generated by setuptools_scm
don't change, don't track in version control
\"\"\"
version = '{version}'
"""
2013-03-14 06:22:43 +00:00
setup(
use_scm_version={
2020-05-09 00:48:24 +00:00
"write_to": "src/escpos/version.py",
"write_to_template": setuptools_scm_template,
},
2020-05-09 00:48:24 +00:00
platforms="any",
package_dir={"": "src"},
packages=find_packages(where="src", exclude=["tests", "tests.*"]),
2020-05-09 00:48:24 +00:00
package_data={"escpos": ["capabilities.json"]},
entry_points={"console_scripts": ["python-escpos = escpos.cli:main"]},
2013-03-14 06:22:43 +00:00
)