-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathsetup.py
55 lines (45 loc) · 1.72 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
from setuptools import setup, find_packages
from setuptools.command.install import install
import sys
import os
from legions.version import __version__
def read_file(fname):
"""
return file contents
:param fname: path relative to setup.py
:return: file contents
"""
with open(os.path.join(os.path.dirname(__file__), fname), "r") as fd:
return fd.read()
class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version"""
description = "verify that the git tag matches our version"
def run(self):
tag = os.getenv("CIRCLE_TAG")
if tag != __version__:
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, __version__
)
sys.exit(info)
setup(
name="legions",
version=__version__,
# description="Handy toolkit for (security) researchers poking around Ethereum nodes and contracts, now with a slick command-line interface, with auto complete commands and history.",
long_description=read_file("Readme.md") if os.path.isfile("Readme.md") else "",
long_description_content_type="text/markdown",
url="https://github.com/consensys/Legions",
author="Shayan Eskandari - ConsenSys Diligence",
author_email="[email protected]",
license="MIT",
packages=find_packages(exclude=["contrib", "docs", "tests"]),
package_data={
"legions": ["commands/**", "utils/**", "network/**", "commands/more/**"],
},
install_requires=read_file("requirements.txt").split("\n"),
entry_points="""
[console_scripts]
legions=legions.main:main
""",
cmdclass={"verify": VerifyVersionCommand},
zip_safe=False,
)