-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
82 lines (73 loc) · 2.34 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
import setuptools
import os, glob
with open("README.md", "r") as fh:
long_description = fh.read()
def get_version():
import os
vf = 'version.txt'
maxversions = [9, 9, 9, 9, 9, 9, 9]
def add_version(version, index=-1):
if index == -1: index = len(version) - 1
version[index] += 1
if version[index] > maxversions[len(version) - index - 1]:
version[index] = 0
if index == 0:
raise Exception('Max version number reached. %s' % (version))
return add_version(version, index - 1)
else:
return version
if not os.path.exists(vf):
raise Exception('version.txt not found or is invalid')
# f=open(vf,'w')
# f.write(str(249))
# f.close()
with open(vf, 'r') as f:
numbers = f.read().strip()
if numbers == '':
raise Exception('version.txt not found or is invalid')
version = numbers.split('.')
version = [int(x) for x in version]
version = add_version(version)
version = '.'.join([str(x) for x in version])
with open(vf, 'w') as f:
f.write(version)
return version
packages=setuptools.find_packages(exclude=['local','local.*'])
print('packages:', packages)
version = get_version()
print("version:", version)
setuptools.setup(
executable=True,
name="freehub", # Replace with your own username
version=version,
author="WangPei",
author_email="1535376447@qq.com",
description="With one command, upload file to freehub , or download from freehub. Easy to use. ",
long_description=long_description,
long_description_content_type="text/markdown",
url="http://github.com/Peiiii/freehub",
packages=packages,
package_dir={'freehub': 'freehub'},
install_requires=[
'dulwich',
'fire'
],
entry_points={
'console_scripts': [
'freehub = freehub.clitools.cli:main',
]
},
include_package_data=True,
package_data={
'freehub': [
'data/*', 'data/*/*', 'data/*/*/*', 'data/*/*/*/*', 'data/*/*/*/*/*', 'data/*/*/*/*/*/*',
'data/*/*/*/*/*/*/*',
]
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.0',
)