Repository: graphql-python/graphene
Pull request #935 (2019-04-05 00:26:19)

Update aniso8601 dependency to allow versions 4+.
I accidentally updated my local aniso8601 to 6.0.0. My projects were running fine with graphene==2.1.3 and aniso8601==6.0.0. Later, I noticed the pip warnings telling me they were incompatible versions.

I ran tox against aniso8601 versions 4.0.0, 5.0.0, and 6.0.0 and compared against the results from running against 3.0.2. Results look the same at a glance.



Patch:
diff --git a/docs/execution/execute.rst b/docs/execution/execute.rst
index 1c28548..f4a1e75 100644
--- a/docs/execution/execute.rst
+++ b/docs/execution/execute.rst
@@ -48,12 +48,14 @@ You can pass variables to a query via ``variables``.
 
     schema = graphene.Schema(Query)
     result = schema.execute(
-        '''query getUser($id: ID) {
+        '''
+          query getUser($id: ID) {
             user(id: $id) {
-                id
-                firstName
-                lastName
+              id
+              firstName
+              lastName
             }
-        }''',
+          }
+        ''',
         variables={'id': 12},
     )
diff --git a/docs/execution/middleware.rst b/docs/execution/middleware.rst
index f7dac70..ad109e4 100644
--- a/docs/execution/middleware.rst
+++ b/docs/execution/middleware.rst
@@ -16,7 +16,7 @@ Resolve arguments
 
 Middlewares ``resolve`` is invoked with several arguments:
 
-- ``next`` represents the execution chain. Call ``next`` to continue evalution.
+- ``next`` represents the execution chain. Call ``next`` to continue evaluation.
 - ``root`` is the root value object passed throughout the query.
 - ``info`` is the resolver info.
 - ``args`` is the dict of arguments passed to the field.
diff --git a/docs/types/enums.rst b/docs/types/enums.rst
index 4e019ee..02cc267 100644
--- a/docs/types/enums.rst
+++ b/docs/types/enums.rst
@@ -59,7 +59,9 @@ you can add description etc. to your enum without changing the original:
 
 .. code:: python
 
-    graphene.Enum.from_enum(AlreadyExistingPyEnum, description=lambda value: return 'foo' if value == AlreadyExistingPyEnum.Foo else 'bar')
+    graphene.Enum.from_enum(
+        AlreadyExistingPyEnum,
+        description=lambda v: return 'foo' if v == AlreadyExistingPyEnum.Foo else 'bar')
 
 
 Notes
diff --git a/graphene/relay/connection.py b/graphene/relay/connection.py
index 927dfcc..047f2b4 100644
--- a/graphene/relay/connection.py
+++ b/graphene/relay/connection.py
@@ -53,7 +53,7 @@ class Connection(ObjectType):
     def __init_subclass_with_meta__(cls, node=None, name=None, **options):
         _meta = ConnectionOptions(cls)
         assert node, "You have to provide a node in {}.Meta".format(cls.__name__)
-        assert issubclass(
+        assert isinstance(node, NonNull) or issubclass(
             node, (Scalar, Enum, ObjectType, Interface, Union, NonNull)
         ), ('Received incompatible node "{}" for Connection {}.').format(
             node, cls.__name__
diff --git a/graphene/types/enum.py b/graphene/types/enum.py
index 6e6bab8..7b8e71f 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/graphene/types/uuid.py b/graphene/types/uuid.py
index abb8f11..b9687e1 100644
--- a/graphene/types/uuid.py
+++ b/graphene/types/uuid.py
@@ -1,5 +1,5 @@
 from __future__ import absolute_import
-
+import six
 from uuid import UUID as _UUID
 
 from graphql.language import ast
@@ -12,8 +12,9 @@ class UUID(Scalar):
 
     @staticmethod
     def serialize(uuid):
-        if isinstance(uuid, str):
+        if isinstance(uuid, six.string_types):
             uuid = _UUID(uuid)
+
         assert isinstance(uuid, _UUID), "Expected UUID instance, received {}".format(
             uuid
         )
diff --git a/setup.py b/setup.py
index 48e5be3..82bb011 100644
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,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={


Test patch:
diff --git a/graphene/relay/tests/test_connection.py b/graphene/relay/tests/test_connection.py
index ca43f39..6686f96 100644
--- a/graphene/relay/tests/test_connection.py
+++ b/graphene/relay/tests/test_connection.py
@@ -108,6 +108,17 @@ def test_edge_with_bases():
     assert edge_fields["other"].type == String
 
 
+def test_edge_with_nonnull_node():
+    class MyObjectConnection(Connection):
+        class Meta:
+            node = NonNull(MyObject)
+
+    edge_fields = MyObjectConnection.Edge._meta.fields
+    assert isinstance(edge_fields["node"], Field)
+    assert isinstance(edge_fields["node"].type, NonNull)
+    assert edge_fields["node"].type.of_type == MyObject
+
+
 def test_pageinfo():
     assert PageInfo._meta.name == "PageInfo"
     fields = PageInfo._meta.fields
diff --git a/graphene/tests/issues/test_956.py b/graphene/tests/issues/test_956.py
new file mode 100644
index 0000000..72ff971
--- /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"]