forked from python-escpos/python-escpos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·45 lines (33 loc) · 1.09 KB
/
setup.py
File metadata and controls
executable file
·45 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python
"""Setup script for python package."""
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}'
"""
setup(
use_scm_version={
"write_to": "src/escpos/version.py",
"write_to_template": setuptools_scm_template,
},
platforms="any",
package_dir={"": "src"},
packages=find_packages(where="src", exclude=["tests", "tests.*"]),
package_data={"escpos": ["capabilities.json"]},
entry_points={"console_scripts": ["python-escpos = escpos.cli:main"]},
)