-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
69 lines (53 loc) · 1.6 KB
/
setup.py
File metadata and controls
69 lines (53 loc) · 1.6 KB
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
import typing
import requests
import setuptools
PROJECT_NAME = "ex_dataclass"
VERSION = "1.2.0"
AUTHOR = "ShadowYD"
E_MAIL = "972367265@qq.com"
GIT_URL= "https://github.com/Shadow-linux/ex_dataclass"
READ_ME = "README_PYPI.md"
READ_ME_RST = "README.rst"
def md_to_rst(from_file, to_file):
"""
将markdown格式转换为rst格式
@param from_file: {str} markdown文件的路径
@param to_file: {str} rst文件的路径
"""
response = requests.post(
url='http://c.docverter.com/convert',
data={'to': 'rst', 'from': 'markdown'},
files={'input_files[]': open(from_file, 'rb')}
)
if response.ok:
with open(to_file, "wb") as f:
f.write(response.content)
def description() -> str:
return "A more powerful data model management than DataClass that reduces maintenance costs and improves coding efficiency."
def long_description() -> str:
# md_to_rst(READ_ME, READ_ME_RST)
with open(READ_ME_RST, "r") as fd:
content = fd.read()
return content
def package_data() -> typing.Dict:
return {
"example": [
"example/*"
]
}
def main():
setuptools.setup(
name=PROJECT_NAME,
version=VERSION,
author=AUTHOR,
author_email=E_MAIL,
description=description(),
long_description=long_description(),
url=GIT_URL,
include_package_data=True,
package_data=package_data(),
packages=setuptools.find_packages(),
python_requires=">=3.7",
)
if __name__ == '__main__':
main()