forked from graphql-python/graphql-core-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
86 lines (72 loc) · 2.63 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
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
import ast
import re
_version_re = re.compile(r"VERSION\s+=\s+(.*)")
with open("graphql/__init__.py", "rb") as f:
version = ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1))
path_copy = sys.path[:]
sys.path.append("graphql")
try:
from pyutils.version import get_version
version = get_version(version)
except Exception:
version = ".".join([str(v) for v in version])
sys.path[:] = path_copy
install_requires = ["six>=1.10.0", "promise>=2.1", "rx>=1.6,<3"]
tests_requires = [
"pytest>=3.3,<4.0",
"pytest-django==2.9.1",
"pytest-cov==2.3.1",
"coveralls",
"gevent>=1.1",
"six>=1.10.0",
"pytest-benchmark==3.0.0",
"pytest-mock==1.2",
]
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ["graphql", "-vrsx"]
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name="graphql-core",
version=version,
description="GraphQL implementation for Python",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
url="https://github.com/graphql-python/graphql-core",
download_url="https://github.com/graphql-python/graphql-core/releases",
author="Syrus Akbary, Jake Heinz, Taeho Kim",
author_email="me@syrusakbary.com",
license="MIT",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: PyPy",
"License :: OSI Approved :: MIT License",
"Topic :: Database :: Front-Ends",
"Topic :: Internet :: WWW/HTTP",
],
keywords="api graphql protocol rest",
packages=find_packages(exclude=["tests", "tests_py35", "tests.*", "tests_py35.*"]),
install_requires=install_requires,
tests_require=tests_requires,
cmdclass={"test": PyTest},
extras_require={"gevent": ["gevent>=1.1"], "test": tests_requires},
package_data={"graphql": ["py.typed"]},
)