-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
108 lines (96 loc) · 3.13 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import codecs
import os
from setuptools import find_packages, setup
# Functions/ global variables
HERE = os.path.abspath(os.path.dirname(__file__))
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("VERSION"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f:
return f.read()
# Metadata
NAME = "coloring"
VERSION = get_version(f"src/{NAME}/consts.py")
LICENSE = "MIT"
DESCRIPTION = "Coloring is an other python library used to colorize texts in terminal using ANSI escape with a pythonic API."
LONG_DESCRIPTION = read("README.md")
LONG_DESCRIPTION_CONTENT_TYPE = "text/markdown"
URL = "https://github.com/nazime/" + NAME
PROJECT_URLS = {
"Documentation": "https://" + NAME + ".readthedocs.org/",
"Bug Tracker": URL + "/issues",
"Source Code": URL,
}
AUTHOR = "Nazime LAKEHAL"
AUTHOR_EMAIL = "[email protected]"
MAINTAINER = AUTHOR
MAINTAINER_EMAIL = AUTHOR_EMAIL
KEYWORDS = []
CLASSIFIERS = [
"Development Status :: 3 - Alpha",
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
]
# Packages information
PACKAGES = find_packages(where="src")
PACKAGE_DIR = {"": "src"}
INSTALL_REQUIRES = []
EXTRAS_REQUIRE = {
"docs": ["sphinx", "sphinx_rtd_theme", "sphinxcontrib.napoleon"],
"tests": [
"coverage",
"hypothesis",
"pytest>=4.3.0", # 4.3.0 dropped last use of `convert`
],
}
EXTRAS_REQUIRE["dev"] = (
EXTRAS_REQUIRE["tests"] + EXTRAS_REQUIRE["docs"] + ["pre-commit"]
)
EXTRAS_REQUIRE["travis"] = EXTRAS_REQUIRE["dev"] + ["tox", "codecov"]
PYTHON_REQUIRES = ">=3.6"
ZIP_SAFE = False
ENTRY_POINTS = {"console_scripts": ["coloring=coloring.__main__:main"]}
INCLUDE_PACKAGE_DATA = False
PACKAGE_DATA = {NAME: ["data/*"]}
if __name__ == "__main__":
setup(
# Metadata
name=NAME,
version=VERSION,
license=LICENSE,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type=LONG_DESCRIPTION_CONTENT_TYPE,
url=URL,
project_urls=PROJECT_URLS,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
keywords=KEYWORDS,
classifiers=CLASSIFIERS,
# Package information
packages=PACKAGES,
package_dir=PACKAGE_DIR,
install_requires=INSTALL_REQUIRES,
python_requires=PYTHON_REQUIRES,
extras_require=EXTRAS_REQUIRE,
zip_safe=ZIP_SAFE,
include_package_data=INCLUDE_PACKAGE_DATA,
entry_points=ENTRY_POINTS,
package_data=PACKAGE_DATA,
)