-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
53 lines (46 loc) · 1.74 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
from email.utils import getaddresses
import toml
from setuptools import find_packages, setup
module = toml.load("pyproject.toml")
module_tool_poetry = module["tool"]["poetry"]
module_name = module_tool_poetry["name"]
module_package_from = module_tool_poetry["packages"][0]["from"]
module_package_include = module_tool_poetry["include"]
module_install_requires = [
k + v.replace("^", "!=").replace("*", "")
if type(v) == str
else k + v["version"].replace("^", "!=").replace("*", "")
for (k, v) in module_tool_poetry["dependencies"].items()
if k != "python"
]
module_devel_requires = [
k + v.replace("^", "!=").replace("*", "")
if type(v) == str
else k + v["version"].replace("^", "!=").replace("*", "")
for (k, v) in module_tool_poetry["dev-dependencies"].items()
]
setup(
name=module_name,
version=module_tool_poetry["version"],
author=", ".join(e[0] for e in getaddresses(module_tool_poetry["authors"])),
author_email=", ".join(e[1] for e in getaddresses(module_tool_poetry["authors"])),
license=module_tool_poetry["license"],
description=module_tool_poetry["description"],
long_description=open(module_tool_poetry["readme"]).read(),
platforms="all",
classifiers=module_tool_poetry["classifiers"],
package_dir={"": module_package_from},
packages=find_packages(module_package_from),
package_data={"": module_package_include},
keywords=", ".join(module_tool_poetry["keywords"]),
python_requires=">=3.7, <4",
install_requires=module_install_requires,
test_suite="tests",
extras_require={
"develop": module_devel_requires,
},
project_urls={
"Documentation": module_tool_poetry["homepage"],
"Source": module_tool_poetry["repository"],
},
)