-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
62 lines (56 loc) · 2.66 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
''' tagsPlorer setup script (C) 2017-2021 Arne Bachmann https://github.com/ArneBachmann/tagsplorer '''
import os, shutil, subprocess, sys, time
from setuptools import setup
from tagsplorer.constants import MAJOR_VERSION
if os.path.exists(".git"):
so, se = subprocess.Popen("git describe --always", shell = True, stdout = subprocess.PIPE).communicate()
micro = "-" + so.strip().decode(sys.stdout.encoding).strip()
else: micro = ""
lt = time.localtime()
versionString = "%d.%d.%d" % (MAJOR_VERSION, lt.tm_year * 100 + lt.tm_mon, lt.tm_mday * 10000 + lt.tm_hour * 100 + lt.tm_min) if any(_ in sys.argv for _ in ('clean', 'build')) else open(os.path.join(os.path.dirname(os.path.join(__file__)), "tagsplorer", "VERSION"), "r", encoding = "utf-8").read()
if 'clean' not in sys.argv:
with open(os.path.join(os.path.dirname(os.path.join(__file__)), "tagsplorer", "VERSION"), "w", encoding = "utf-8") as fd: fd.write(versionString)
setup(
name = 'tagsPlorer',
version = versionString,
description = "tagsPlorer V" + versionString + micro,
description_content_type = "text/markdown",
long_description = open("README.md", "r", encoding = "utf-8").read(),
long_description_content_type = "text/markdown",
classifiers = [c.strip() for c in """
Development Status :: 5 - Production/Stable
Intended Audience :: Other Audience
Intended Audience :: System Administrators
License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
""".split('\n') if c.strip()], # https://pypi.python.org/pypi?:action=list_classifiers
keywords = '',
author = 'Arne Bachmann',
author_email = '[email protected]',
maintainer = 'Arne Bachmann',
maintainer_email = '[email protected]',
url = 'http://github.com/ArneBachmann/tagsplorer',
license = 'MPL-2.0',
packages = ["tagsplorer"],
#package_dir = {"tagsplorer": ""},
package_data = {"tagsplorer": ["VERSION"]},
zip_safe = False,
entry_points = {
'console_scripts': [
'tp=tagsplorer.tp:main',
'tpserve=tagsplorer.serve:main'
]
},
)
if "clean" in sys.argv:
try: shutil.rmtree("tagsplorer.egg-info") # if keeping this folder, built files will remain no matter what exclude options are configured above (MANIFEST.in or exclude_...)
except: pass # noqa: E722
try: shutil.rmtree("build")
except: pass # noqa: E722
try: shutil.rmtree("dist")
except: pass # noqa: E722