-
Notifications
You must be signed in to change notification settings - Fork 95
/
setup.py
74 lines (64 loc) · 2.09 KB
/
setup.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env python3
import sys
if sys.version_info < (3, 6, 0):
print("Python 3.6+ is required")
exit(1)
import io # noqa E402
import os # noqa E402
from setuptools import find_packages, setup # noqa E402
from pathlib import Path # noqa E402
from typing import List # noqa E402
import ast # noqa E402
import re # noqa E402
import distutils.text_file
CURDIR = Path(__file__).parent
EXCLUDE_FROM_PACKAGES = ["tests"]
with io.open(os.path.join(CURDIR, "README.md"), "r", encoding="utf-8") as f:
README = f.read()
def get_version() -> str:
main_file = CURDIR / "pyxtermjs" / "app.py"
_version_re = re.compile(r"__version__\s+=\s+(?P<version>.*)")
with open(main_file, "r", encoding="utf8") as f:
match = _version_re.search(f.read())
version = match.group("version") if match is not None else '"unknown"'
return str(ast.literal_eval(version))
setup(
name="pyxtermjs",
version=get_version(),
author="Chad Smith",
author_email="chadsmith.software@gmail.com",
description="interactive terminal in the browser",
long_description=README,
long_description_content_type="text/markdown",
url="https://github.com/cs01/pyxtermjs",
license="License :: OSI Approved :: MIT License",
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
include_package_data=True,
keywords=[
"xterm",
"xterm.js",
"javascript",
"terminal-emulators",
"browser",
"tty",
"pty",
"console",
"terminal",
],
scripts=[],
entry_points={"console_scripts": ["pyxtermjs = pyxtermjs.app:main"]},
extras_require={},
zip_safe=False,
python_requires=">=3.6",
install_requires=distutils.text_file.TextFile(
filename="./requirements.txt"
).readlines(),
classifiers=[
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3 :: Only",
],
)