forked from ConsenSysMesh/py-eip712-structs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
83 lines (62 loc) · 1.94 KB
/
setup.py
File metadata and controls
83 lines (62 loc) · 1.94 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import shlex
import sys
from pathlib import Path
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
NAME = "eip712-structs"
VERSION = "1.2.0"
install_requirements = [
"eth-utils>=1.4.0",
]
test_requirements = [
"coveralls==1.8.0",
"pytest==4.6.2",
"pytest-cov==2.7.1",
"web3==4.9.2",
]
def get_file_text(filename):
file_path = Path(__file__).parent / filename
if not file_path.exists():
return ""
else:
file_text = file_path.read_text().strip()
return file_text
long_description = get_file_text("README.md")
class PyTest(TestCommand):
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ""
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
class CoverallsCommand(TestCommand):
description = "Run the coveralls command"
user_options = [("coveralls-args=", "a", "Arguments to pass to coveralls")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.coveralls_args = ""
def run_tests(self):
import coveralls.cli
errno = coveralls.cli.main(shlex.split(self.coveralls_args))
sys.exit(errno)
setup(
name=NAME,
version=VERSION,
author="AJ Grubbs",
packages=find_packages(),
install_requires=install_requirements,
tests_require=test_requirements,
cmdclass={
"test": PyTest,
"coveralls": CoverallsCommand,
},
description="A python library for EIP712 objects",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
keywords="ethereum eip712 solidity",
url="https://github.com/ConsenSys/py-eip712-structs",
)