diff --git a/.travis.yml b/.travis.yml index 53878e74..33c8665a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,6 @@ matrix: include: - env: TOXENV=py27 python: 2.7 - - env: TOXENV=py34 - python: 3.4 - env: TOXENV=py35 python: 3.5 - env: TOXENV=py36 diff --git a/README.md b/README.md index 842f043e..8e4e912d 100644 --- a/README.md +++ b/README.md @@ -143,4 +143,5 @@ https://docs.graphene-python.org/en/latest/ ## Contributing + See [Contributing](CONTRIBUTING.md) diff --git a/graphene/tests/issues/test_956.py b/graphene/tests/issues/test_956.py new file mode 100644 index 00000000..72ff9713 --- /dev/null +++ b/graphene/tests/issues/test_956.py @@ -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"] diff --git a/graphene/types/enum.py b/graphene/types/enum.py index 6e6bab8f..7b8e71f5 100644 --- a/graphene/types/enum.py +++ b/graphene/types/enum.py @@ -46,7 +46,12 @@ class EnumMeta(SubclassWithMeta_Meta): def __call__(cls, *args, **kwargs): # noqa: N805 if cls is Enum: 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 cls._meta.enum(*args, **kwargs) diff --git a/setup.py b/setup.py index 48e5be35..c75df0ba 100644 --- a/setup.py +++ b/setup.py @@ -76,10 +76,9 @@ setup( "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.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", ], keywords="api graphql protocol rest relay graphene", @@ -88,7 +87,7 @@ setup( "six>=1.10.0,<2", "graphql-core>=2.1,<3", "graphql-relay>=0.4.5,<1", - "aniso8601>=3,<4", + "aniso8601>=3,<=6.0.*", ], tests_require=tests_require, extras_require={ diff --git a/tox.ini b/tox.ini index 2b7ae59c..c1dbd01d 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ deps = setenv = PYTHONPATH = .:{envdir} 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} [testenv:pre-commit]