Added support for wheel distributions. Fixed #505

This commit is contained in:
Syrus Akbary 2017-07-31 22:30:13 -07:00
parent a4bcb94958
commit 81018268aa
4 changed files with 91 additions and 94 deletions

View File

@ -58,3 +58,4 @@ deploy:
tags: true
password:
secure: LHOp9DvYR+70vj4YVY8+JRNCKUOfYZREEUY3+4lMUpY7Zy5QwDfgEMXG64ybREH9dFldpUqVXRj53eeU3spfudSfh8NHkgqW7qihez2AhSnRc4dK6ooNfB+kLcSoJ4nUFGxdYImABc4V1hJvflGaUkTwDNYVxJF938bPaO797IvSbuI86llwqkvuK2Vegv9q/fy9sVGaF9VZIs4JgXwR5AyDR7FBArl+S84vWww4vTFD33hoE88VR4QvFY3/71BwRtQrnCMm7AOm31P9u29yi3bpzQpiOR2rHsgrsYdm597QzFKVxYwsmf9uAx2bpbSPy2WibunLePIvOFwm8xcfwnz4/J4ONBc5PSFmUytTWpzEnxb0bfUNLuYloIS24V6OZ8BfAhiYZ1AwySeJCQDM4Vk1V8IF6trTtyx5EW/uV9jsHCZ3LFsAD7UnFRTosIgN3SAK3ZWCEk5oF2IvjecsolEfkRXB3q9EjMkkuXRUeFDH2lWJLgNE27BzY6myvZVzPmfwZUsPBlPD/6w+WLSp97Rjgr9zS3T1d4ddqFM4ZYu04f2i7a/UUQqG+itzzuX5DWLPvzuNt37JB45mB9IsvxPyXZ6SkAcLl48NGyKok1f3vQnvphkfkl4lni29woKhaau8xlsuEDrcwOoeAsVcZXiItg+l+z2SlIwM0A06EvQ=
distributions: "sdist bdist_wheel"

View File

@ -1,88 +1,78 @@
from .pyutils.version import get_version
try:
# This variable is injected in the __builtins__ by the build
# process. It used to enable importing subpackages when
# the required packages are not installed
__SETUP__
except NameError:
__SETUP__ = False
from .types import (
AbstractType,
ObjectType,
InputObjectType,
Interface,
Mutation,
Field,
InputField,
Schema,
Scalar,
String, ID, Int, Float, Boolean,
JSONString,
UUID,
List, NonNull,
Enum,
Argument,
Dynamic,
Union,
Context,
ResolveInfo
)
from .relay import (
Node,
is_node,
GlobalID,
ClientIDMutation,
Connection,
ConnectionField,
PageInfo
)
from .utils.resolve_only_args import resolve_only_args
from .utils.module_loading import lazy_import
VERSION = (2, 0, 0, 'alpha', 0)
__version__ = get_version(VERSION)
if not __SETUP__:
__all__ = [
'__version__',
'ObjectType',
'InputObjectType',
'Interface',
'Mutation',
'Field',
'InputField',
'Schema',
'Scalar',
'String',
'ID',
'Int',
'Float',
'Enum',
'Boolean',
'JSONString',
'UUID',
'List',
'NonNull',
'Argument',
'Dynamic',
'Union',
'resolve_only_args',
'Node',
'is_node',
'GlobalID',
'ClientIDMutation',
'Connection',
'ConnectionField',
'PageInfo',
'lazy_import',
'Context',
'ResolveInfo',
from .types import (
AbstractType,
ObjectType,
InputObjectType,
Interface,
Mutation,
Field,
InputField,
Schema,
Scalar,
String, ID, Int, Float, Boolean,
JSONString,
UUID,
List, NonNull,
Enum,
Argument,
Dynamic,
Union,
Context,
ResolveInfo
)
from .relay import (
Node,
is_node,
GlobalID,
ClientIDMutation,
Connection,
ConnectionField,
PageInfo
)
from .utils.resolve_only_args import resolve_only_args
from .utils.module_loading import lazy_import
__all__ = [
'ObjectType',
'InputObjectType',
'Interface',
'Mutation',
'Field',
'InputField',
'Schema',
'Scalar',
'String',
'ID',
'Int',
'Float',
'Enum',
'Boolean',
'JSONString',
'UUID',
'List',
'NonNull',
'Argument',
'Dynamic',
'Union',
'resolve_only_args',
'Node',
'is_node',
'GlobalID',
'ClientIDMutation',
'Connection',
'ConnectionField',
'PageInfo',
'lazy_import',
'Context',
'ResolveInfo',
# Deprecated
'AbstractType',
]
# Deprecated
'AbstractType',
]

View File

@ -7,3 +7,6 @@ omit = graphene/pyutils/*,*/tests/*,graphene/types/scalars.py
[isort]
known_first_party=graphene
[bdist_wheel]
universal=1

View File

@ -1,22 +1,25 @@
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
import sys
import ast
import re
if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins
_version_re = re.compile(r'VERSION\s+=\s+(.*)')
# This is a bit (!) hackish: we are setting a global variable so that the main
# graphql __init__ can detect if it is being loaded by the setup routine, to
# avoid attempting to load components that aren't built yet:
# the numpy distutils extensions that are used by scikit-learn to recursively
# build the compiled extensions in sub-packages is based on the Python import
# machinery.
builtins.__SETUP__ = True
with open('graphene/__init__.py', 'rb') as f:
version = ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1))
version = __import__('graphene').get_version()
path_copy = sys.path[:]
sys.path.append('graphene')
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
class PyTest(TestCommand):
@ -79,7 +82,7 @@ setup(
keywords='api graphql protocol rest relay graphene',
packages=find_packages(exclude=['tests']),
packages=find_packages(exclude=['tests', 'tests.*']),
install_requires=[
'six>=1.10.0',