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,22 +1,6 @@
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
VERSION = (2, 0, 0, 'alpha', 0)
__version__ = get_version(VERSION)
if not __SETUP__:
from .types import (
from .types import (
AbstractType,
ObjectType,
InputObjectType,
@ -36,8 +20,8 @@ if not __SETUP__:
Union,
Context,
ResolveInfo
)
from .relay import (
)
from .relay import (
Node,
is_node,
GlobalID,
@ -45,11 +29,17 @@ if not __SETUP__:
Connection,
ConnectionField,
PageInfo
)
from .utils.resolve_only_args import resolve_only_args
from .utils.module_loading import lazy_import
)
from .utils.resolve_only_args import resolve_only_args
from .utils.module_loading import lazy_import
__all__ = [
VERSION = (2, 0, 0, 'alpha', 0)
__version__ = get_version(VERSION)
__all__ = [
'__version__',
'ObjectType',
'InputObjectType',
'Interface',
@ -85,4 +75,4 @@ if not __SETUP__:
# 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',