graphene-mongo
graphene-mongo copied to clipboard
Graphql dependency error
Resolves https://github.com/graphql-python/graphene-mongo/issues/189 with the introduction of the graphene v3.0 package as well. All tests pass.
Also resolves #187 as well.
cc @abawchen
@abawchen Any way we can merge and release this?
Hi, I also have an issue where I can't install Flask-GraphQL
because the version of graphene doesn't match with 3.0b7
.
How can we fix this?
fyi graphene 3.1 solves quite a bit of dephell that's still existing in 3.0 ref https://github.com/ciscorn/starlette-graphene3/issues/26#issuecomment-1141215649
in comparison:
$ pipgrip --tree graphene==3.1 graphql-core==3.2.*
graphene==3.1 (3.1)
├── aniso8601<10,>=8 (9.0.1)
├── graphql-core<3.3,>=3.1 (3.2.1)
└── graphql-relay<3.3,>=3.1 (3.2.0)
└── graphql-core<3.3,>=3.2 (3.2.1)
graphql-core==3.2.* (3.2.1)
$ pipgrip --tree graphene==3.1 graphql-core==3.1.*
graphene==3.1 (3.1)
├── aniso8601<10,>=8 (9.0.1)
├── graphql-core<3.3,>=3.1 (3.1.7)
└── graphql-relay<3.3,>=3.1 (3.1.5)
└── graphql-core<3.2,>=3.1 (3.1.7)
graphql-core==3.1.* (3.1.7)
$ pipgrip --tree graphene==3.0
graphene==3.0 (3.0)
├── aniso8601<10,>=8 (9.0.1)
├── graphql-core~=3.1.2 (3.1.7)
└── graphql-relay<4,>=3.0 (3.1.5)
└── graphql-core<3.2,>=3.1 (3.1.7)
fyi graphene 3.1 solves quite a bit of dephell that's still existing in 3.0 ref ciscorn/starlette-graphene3#26 (comment)
in comparison:
$ pipgrip --tree graphene==3.1 graphql-core==3.2.* graphene==3.1 (3.1) ├── aniso8601<10,>=8 (9.0.1) ├── graphql-core<3.3,>=3.1 (3.2.1) └── graphql-relay<3.3,>=3.1 (3.2.0) └── graphql-core<3.3,>=3.2 (3.2.1) graphql-core==3.2.* (3.2.1) $ pipgrip --tree graphene==3.1 graphql-core==3.1.* graphene==3.1 (3.1) ├── aniso8601<10,>=8 (9.0.1) ├── graphql-core<3.3,>=3.1 (3.1.7) └── graphql-relay<3.3,>=3.1 (3.1.5) └── graphql-core<3.2,>=3.1 (3.1.7) graphql-core==3.1.* (3.1.7) $ pipgrip --tree graphene==3.0 graphene==3.0 (3.0) ├── aniso8601<10,>=8 (9.0.1) ├── graphql-core~=3.1.2 (3.1.7) └── graphql-relay<4,>=3.0 (3.1.5) └── graphql-core<3.2,>=3.1 (3.1.7)
Have you run the tests with graphene 3.1?
I have run the test suite make test
with graphene 3.1.1 and all tests pass
py.test graphene_mongo/tests --cov=graphene_mongo --cov-report=html --cov-report=term
======================================================================================== test session starts =========================================================================================
platform darwin -- Python 3.8.9, pytest-6.2.2, py-1.11.0, pluggy-0.13.1
rootdir: /Users/leonardlu/Code/graphene-mongo, configfile: setup.cfg
plugins: cov-2.11.1
collected 96 items
graphene_mongo/tests/test_converter.py .................................... [ 37%]
graphene_mongo/tests/test_fields.py ....... [ 44%]
graphene_mongo/tests/test_inputs.py .. [ 46%]
graphene_mongo/tests/test_mutation.py .. [ 48%]
graphene_mongo/tests/test_query.py ......... [ 58%]
graphene_mongo/tests/test_relay_query.py ........................ [ 83%]
graphene_mongo/tests/test_types.py ........... [ 94%]
graphene_mongo/tests/test_utils.py ..... [100%]
========================================================================================== warnings summary ==========================================================================================
venv/lib/python3.8/site-packages/mongoengine/base/metaclasses.py:308
/Users/leonardlu/Code/graphene-mongo/venv/lib/python3.8/site-packages/mongoengine/base/metaclasses.py:308: SyntaxWarning: Trying to set a collection on a subclass (Child)
warnings.warn(msg, SyntaxWarning)
venv/lib/python3.8/site-packages/mongoengine/base/metaclasses.py:308
/Users/leonardlu/Code/graphene-mongo/venv/lib/python3.8/site-packages/mongoengine/base/metaclasses.py:308: SyntaxWarning: Trying to set a collection on a subclass (AnotherChild)
warnings.warn(msg, SyntaxWarning)
graphene_mongo/tests/test_inputs.py: 3 warnings
graphene_mongo/tests/test_mutation.py: 3 warnings
graphene_mongo/tests/test_query.py: 9 warnings
graphene_mongo/tests/test_relay_query.py: 101 warnings
/Users/leonardlu/Code/graphene-mongo/venv/lib/python3.8/site-packages/graphene/types/field.py:126: DeprecationWarning: The get_resolver method is being deprecated, please rename it to wrap_resolve.
warn_deprecation(
-- Docs: https://docs.pytest.org/en/stable/warnings.html
---------- coverage: platform darwin, python 3.8.9-final-0 -----------
Name Stmts Miss Cover
------------------------------------------------------
graphene_mongo/__init__.py 4 0 100%
graphene_mongo/advanced_types.py 41 0 100%
graphene_mongo/converter.py 306 72 76%
graphene_mongo/fields.py 334 66 80%
graphene_mongo/registry.py 37 5 86%
graphene_mongo/types.py 130 8 94%
graphene_mongo/utils.py 141 36 74%
------------------------------------------------------
TOTAL 993 187 81%
Coverage HTML written to dir htmlcov
================================================================================== 96 passed, 118 warnings in 0.64s ==================================================================================
With graphene==3.0
py.test graphene_mongo/tests --cov=graphene_mongo --cov-report=html --cov-report=term
ImportError while loading conftest '/Users/leonardlu/Code/graphene-mongo/graphene_mongo/tests/conftest.py'.
graphene_mongo/__init__.py:1: in <module>
from .fields import MongoengineConnectionField
graphene_mongo/fields.py:6: in <module>
import graphene
venv/lib/python3.8/site-packages/graphene/__init__.py:2: in <module>
from .relay import (
venv/lib/python3.8/site-packages/graphene/relay/__init__.py:1: in <module>
from .node import Node, is_node, GlobalID
venv/lib/python3.8/site-packages/graphene/relay/node.py:4: in <module>
from graphql_relay import from_global_id, to_global_id
venv/lib/python3.8/site-packages/graphql_relay/__init__.py:7: in <module>
from .connection.connection import (
venv/lib/python3.8/site-packages/graphql_relay/connection/connection.py:3: in <module>
from graphql import (
E ImportError: cannot import name 'resolve_thunk' from 'graphql' (/Users/leonardlu/Code/graphene-mongo/venv/lib/python3.8/site-packages/graphql/__init__.py)
make: *** [test] Error 4
@blochs : Now you have the permission to merge, free to go. Thanks.
for stability as @leonardwellthy mentions, and to increase cross-compatibility as I mentioned, could this PR bump graphene to 3.1 instead of to 3.0?