-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
150 lines (131 loc) · 3.75 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/usr/bin/env python
# --------------------------------------------------------------------
# Copyright (c) TokenChain. All rights reserved.
# Licensed under the MIT License.
# See License.txt in the project root for license information.
#
#
# :copyright: © 2021 by the TokenChain.
# :license: MIT License
# --------------------------------------------------------------------
import codecs
import os
import platform
import pypandoc
from setuptools import (
find_packages,
setup,
)
_dir = os.path.dirname(__file__)
py_version = platform.python_version()
def find_version() -> str:
f = codecs.open('version', 'r', 'utf-8-sig')
new_ver = f.readline().strip().replace("\n", "")
f.close()
edit_at_line(new_ver)
return new_ver
def edit_at_line(version: str):
file = 'moody/__init__.py'
lines = []
with open(file, "r") as f:
lines = f.readlines()
f.close()
o = 0
for h in lines:
if "__version__" in h:
lines[o] = f"__version__ = '{version}'"
break
o += 1
if len(lines) > 0:
with open(file, "w") as f:
f.write("".join(lines))
f.close()
_dir = os.path.dirname(__file__)
py_version = platform.python_version()
EXTRAS_REQUIRE = {
"tester": [
"coverage",
"pep8",
"pyflakes",
"pylint",
"pytest-cov"
],
"docs": [
"mock",
"sphinx-better-theme>=0.1.4",
"click>=5.1",
"configparser==3.5.0",
"contextlib2>=0.5.4",
"py-solc>=0.4.0",
"pytest>=2.7.2",
"sphinx",
"pdoc3",
"sphinx_rtd_theme>=0.1.9",
"toposort>=1.4",
"urllib3",
"wheel >= 0.31.0"
],
"dev": [
"bumpversion",
"flaky>=3.3.0",
"hypothesis>=3.31.2",
"pytest>=3.5.0,<4",
"pytest-mock==1.*",
"pytest-pythonpath>=0.3",
"pytest-watch==4.*",
"pytest-xdist==1.*",
"setuptools>=38.6.0",
"tox>=1.8.0",
"twine >= 1.11.0",
"tqdm",
"pyinstall",
"when-changed"
]
}
EXTRAS_REQUIRE['dev'] = (
EXTRAS_REQUIRE['tester'] +
EXTRAS_REQUIRE['docs'] +
EXTRAS_REQUIRE['dev']
)
install_requires = [
"mypy-extensions==0.4.3",
"web3>=5.20.0",
"eth-utils==1.10.0",
"eth-uniswap==0.0.2"
]
def convert_rst():
output = pypandoc.convert_file(os.path.join('README.md'), 'rst', format='md', outputfile='README.rst')
io = open('README.rst', 'r')
package_description = io.read()
io.close()
return "see from the github."
setup(
name='moodyeth',
version=find_version(),
description='A Python API for interacting with Ethereum based networks',
long_description=convert_rst(),
long_description_content_type='text/x-rst',
keywords='ethereum eth-api eth-api-python eth-base cli sdk pentest',
url='https://github.com/tokenchain/moodyeth',
author='Heskemo',
author_email='topdog@onekexx.com',
license='MIT License',
zip_safe=False,
python_requires='>=3.8,<4',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Topic :: Software Development :: Code Generators',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
packages=find_packages(exclude=['examples', 'lab', 'test']),
include_package_data=True,
install_requires=install_requires,
tests_require=EXTRAS_REQUIRE['tester'],
extras_require=EXTRAS_REQUIRE,
)