-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
62 lines (52 loc) · 1.7 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
import os
import shutil
import sys
from setuptools import setup, find_packages
version = None
with open("tranci/__init__.py", "r") as f:
for line in f.readlines():
if line.startswith("__version__"):
version = line.split("=", 1)[1].strip().replace('"', "")
if version is None:
print("where's the version?!?!??!!")
sys.exit(1)
print(f"version {version}")
with open("README.md", "r") as f:
long_description = f.read()
current_dir_mess = os.listdir(".")
if any(
(
"dist" in current_dir_mess,
"tranci.egg-info" in current_dir_mess,
"build" in current_dir_mess,
)
):
print("cleaning up your previous mess...")
shutil.rmtree("dist", ignore_errors=True)
shutil.rmtree("tranci.egg-info", ignore_errors=True)
shutil.rmtree("build", ignore_errors=True)
print("done!")
setup(
name="tranci",
version=version,
description="Tranci: a no-dependencies, lightweight, easy-to-use ANSI library",
long_description=long_description,
long_description_content_type="text/markdown",
author="Butterroach",
author_email="[email protected]",
url="https://github.com/Butterroach/tranci",
license="LGPLv3+",
packages=find_packages(),
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
],
python_requires=">=3.9",
project_urls={
"Source": "https://github.com/Butterroach/tranci",
"Bug Tracker": "https://github.com/Butterroach/tranci/issues",
},
)