This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
77 lines (63 loc) · 2.36 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
75
76
77
import os
import glob
import shutil
import setuptools
from teos import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
# Remove undesired files
wildcards = ["**/__pycache__", "**/.DS_Store"]
for entry in wildcards:
for file_dir in glob.glob(entry, recursive=True):
if os.path.isdir(file_dir):
shutil.rmtree(file_dir)
elif os.path.isfile(file_dir):
os.remove(file_dir)
# Installing common library only
if os.getenv("COMMON_ONLY", False):
PACKAGES = ["common"]
CONSOLE_SCRIPTS = []
with open("common/requirements.txt") as f:
requirements = [r for r in f.read().split("\n") if len(r)]
else:
PACKAGES = ["common", "teos", "teos.cli", "teos.protobuf", "teos.utils"]
CONSOLE_SCRIPTS = ["teosd=teos.teosd:run", "teos-cli=teos.cli.teos_cli:run"]
with open("requirements.txt") as f:
requirements = [r for r in f.read().split("\n") if len(r)]
# Add additional scripts if DEV=1
if os.getenv("DEV", False):
# Add missing requirements
with open("contrib/client/requirements.txt") as f:
requirements_client = [r for r in f.read().split("\n") if len(r)]
requirements = list(set(requirements).union(requirements_client))
# Extend packages
PACKAGES.extend(["contrib", "contrib.client"])
# Add console scripts
CONSOLE_SCRIPTS.append("teos-client=contrib.client.teos_client:run")
CLASSIFIERS = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Internet",
"Topic :: Utilities",
"Topic :: Software Development :: Libraries :: Python Modules",
]
setuptools.setup(
name="python-teos",
version=__version__,
author="Talaia Labs",
author_email="[email protected]",
description="The Eye of Satoshi - Lightning Watchtower",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/talaia-labs/python-teos",
packages=setuptools.find_packages(include=PACKAGES),
classifiers=CLASSIFIERS,
python_requires=">=3.7",
install_requires=requirements,
entry_points={"console_scripts": CONSOLE_SCRIPTS},
)