-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupcommon.py
49 lines (42 loc) · 1.37 KB
/
setupcommon.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
#!/usr/bin/python3
# -*- encoding: utf-8 -*-
import os
import subprocess
import sys
def get_version():
try:
version = subprocess.check_output(["git", "describe", "--abbrev=0"])
version = version.decode("utf-8").lstrip("v")
return version.strip()
except Exception as e:
print(e, file=sys.stderr)
print("Couldn't get git version",
file=sys.stderr)
# Don't raise an error, it's nicer to return None so we can use a
# ternary if
return None
def read_file(name):
name = os.path.join(os.path.dirname(__file__), name)
with open(name) as input_file:
return input_file.read()
__version__ = (0, 1, 0)
setupdata = {
"name": "DC reloaded",
"description": "A small CPU simulator",
"version": get_version() or ".".join(__version__),
"long_description": read_file("README.md"),
"author": "Daniel Schadt",
"author_email": "[email protected]",
"url": "https://github.com/Kingdread/dc-reloaded",
"license": "GPL",
"classifiers": [
"Intended Audience :: Developers",
"Intended Audience :: Education",
"License :: OSI Approved :: GNU General Public License v3 or later "
"(GPLv3+)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Assembly",
"Topic :: Education",
],
}