-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·50 lines (45 loc) · 1.45 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
import os
import sys
import subprocess
from setuptools import setup
from setuptools import find_packages
def get_version():
try:
output = (
subprocess.check_output(
["git", "log", "--pretty=format:%ad %H", "--date=short"]
)
.decode()
.splitlines()
)
except subprocess.CalledProcessError as e:
print("Error executing git log:", e)
return None
main_version = output[0][:7]
sub_version = len([i for i in output if i.startswith(main_version)])
year, month = main_version.split("-")
return f"{year}.{int(month)}.{sub_version}"
VERSION = get_version()
if sys.argv[1] == "publish":
print("version:", VERSION)
os.system("rm -rf dist/")
os.system("python3 setup.py bdist_wheel")
os.system("twine upload dist/*")
else:
setup(
name="MeMeST",
version=VERSION,
author="Xin-Xin Ma",
description="Multi-Repository Sync Tool",
description_content_type="text/markdown",
long_description_content_type="text/markdown",
long_description=open("./Readme.md", "r").read(),
packages=find_packages(),
data_files=[("", ["LICENSE"])],
license="GPL",
project_urls={
"Source": "https://github.com/xxmawhu/memest.git",
},
entry_points={"console_scripts": ["memest=mest.main:main"]},
install_requires=["termcolor", "loguru", "psutil"],
)