-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
70 lines (60 loc) · 1.64 KB
/
setup.py
File metadata and controls
70 lines (60 loc) · 1.64 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
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
import os
from os.path import exists, join
from setuptools import find_packages, setup
def get_version():
# type: () -> str
"""
Retrieves the version information for this package.
"""
filename = "strec/version.py"
with open(filename) as fptr:
# pylint: disable=invalid-name, exec-used
obj = compile(fptr.read(), filename, "single")
data = {} # type: ignore
exec(obj, data)
return data["VERSION"]
with open("docs/README.rst") as fptr:
LONG_DESCRIPTION = fptr.read()
if os.geteuid() == 0:
CONF_TARGET = "/usr/share/strec/conf.d"
else:
from os.path import expanduser, join
CONF_TARGET = join(expanduser("~"), ".strec", "conf.d")
if not exists(CONF_TARGET):
os.makedirs(CONF_TARGET)
print("Created folder for config files: %r" % CONF_TARGET)
setup(
name="strec",
version=get_version(),
description="Generic Coloriser",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/x-rst",
author="Michel Albert",
author_email="michel@albert.lu",
license="GPL",
install_requires=[
"blessings",
"blessings",
"pyyaml",
"typing_extensions",
],
extras_require={
"doc": [
"furo",
"sphinx",
],
"test": [
"pytest",
"pytest-cov",
],
},
entry_points={"console_scripts": ["strec=strec.cli:main"]},
data_files=[
(
CONF_TARGET,
[join("configs", _) for _ in os.listdir("configs") if _[-1] != "~"],
)
],
packages=find_packages(exclude=["tests.*", "tests"]),
zip_safe=False,
)