mirror of
https://github.com/graphql-python/graphene.git
synced 2025-09-21 19:32:33 +03:00
Merge branch 'master' into contributing
This commit is contained in:
commit
226a14aba0
|
@ -3,8 +3,6 @@ matrix:
|
||||||
include:
|
include:
|
||||||
- env: TOXENV=py27
|
- env: TOXENV=py27
|
||||||
python: 2.7
|
python: 2.7
|
||||||
- env: TOXENV=py34
|
|
||||||
python: 3.4
|
|
||||||
- env: TOXENV=py35
|
- env: TOXENV=py35
|
||||||
python: 3.5
|
python: 3.5
|
||||||
- env: TOXENV=py36
|
- env: TOXENV=py36
|
||||||
|
|
|
@ -143,4 +143,5 @@ https://docs.graphene-python.org/en/latest/
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
||||||
See [Contributing](CONTRIBUTING.md)
|
See [Contributing](CONTRIBUTING.md)
|
||||||
|
|
8
graphene/tests/issues/test_956.py
Normal file
8
graphene/tests/issues/test_956.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import graphene
|
||||||
|
|
||||||
|
|
||||||
|
def test_issue():
|
||||||
|
options = {"description": "This my enum", "deprecation_reason": "For the funs"}
|
||||||
|
new_enum = graphene.Enum("MyEnum", [("some", "data")], **options)
|
||||||
|
assert new_enum._meta.description == options["description"]
|
||||||
|
assert new_enum._meta.deprecation_reason == options["deprecation_reason"]
|
|
@ -46,7 +46,12 @@ class EnumMeta(SubclassWithMeta_Meta):
|
||||||
def __call__(cls, *args, **kwargs): # noqa: N805
|
def __call__(cls, *args, **kwargs): # noqa: N805
|
||||||
if cls is Enum:
|
if cls is Enum:
|
||||||
description = kwargs.pop("description", None)
|
description = kwargs.pop("description", None)
|
||||||
return cls.from_enum(PyEnum(*args, **kwargs), description=description)
|
deprecation_reason = kwargs.pop("deprecation_reason", None)
|
||||||
|
return cls.from_enum(
|
||||||
|
PyEnum(*args, **kwargs),
|
||||||
|
description=description,
|
||||||
|
deprecation_reason=deprecation_reason,
|
||||||
|
)
|
||||||
return super(EnumMeta, cls).__call__(*args, **kwargs)
|
return super(EnumMeta, cls).__call__(*args, **kwargs)
|
||||||
# return cls._meta.enum(*args, **kwargs)
|
# return cls._meta.enum(*args, **kwargs)
|
||||||
|
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -76,10 +76,9 @@ setup(
|
||||||
"Programming Language :: Python :: 2",
|
"Programming Language :: Python :: 2",
|
||||||
"Programming Language :: Python :: 2.7",
|
"Programming Language :: Python :: 2.7",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.3",
|
|
||||||
"Programming Language :: Python :: 3.4",
|
|
||||||
"Programming Language :: Python :: 3.5",
|
"Programming Language :: Python :: 3.5",
|
||||||
"Programming Language :: Python :: 3.6",
|
"Programming Language :: Python :: 3.6",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
"Programming Language :: Python :: Implementation :: PyPy",
|
"Programming Language :: Python :: Implementation :: PyPy",
|
||||||
],
|
],
|
||||||
keywords="api graphql protocol rest relay graphene",
|
keywords="api graphql protocol rest relay graphene",
|
||||||
|
@ -88,7 +87,7 @@ setup(
|
||||||
"six>=1.10.0,<2",
|
"six>=1.10.0,<2",
|
||||||
"graphql-core>=2.1,<3",
|
"graphql-core>=2.1,<3",
|
||||||
"graphql-relay>=0.4.5,<1",
|
"graphql-relay>=0.4.5,<1",
|
||||||
"aniso8601>=3,<4",
|
"aniso8601>=3,<=6.0.*",
|
||||||
],
|
],
|
||||||
tests_require=tests_require,
|
tests_require=tests_require,
|
||||||
extras_require={
|
extras_require={
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -9,7 +9,7 @@ deps =
|
||||||
setenv =
|
setenv =
|
||||||
PYTHONPATH = .:{envdir}
|
PYTHONPATH = .:{envdir}
|
||||||
commands =
|
commands =
|
||||||
py{27,34,py}: py.test --cov=graphene graphene examples {posargs}
|
py{27,py}: py.test --cov=graphene graphene examples {posargs}
|
||||||
py{35,36,37}: py.test --cov=graphene graphene examples tests_asyncio {posargs}
|
py{35,36,37}: py.test --cov=graphene graphene examples tests_asyncio {posargs}
|
||||||
|
|
||||||
[testenv:pre-commit]
|
[testenv:pre-commit]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user