graphene-mongo icon indicating copy to clipboard operation
graphene-mongo copied to clipboard

Graphql dependency error

Open blochs opened this issue 3 years ago • 5 comments

Resolves https://github.com/graphql-python/graphene-mongo/issues/189 with the introduction of the graphene v3.0 package as well. All tests pass.

blochs avatar Feb 07 '22 16:02 blochs

Also resolves #187 as well.

blochs avatar Feb 07 '22 16:02 blochs

cc @abawchen

blochs avatar Feb 07 '22 18:02 blochs

@abawchen Any way we can merge and release this?

blochs avatar Mar 17 '22 14:03 blochs

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?

johhnry avatar May 31 '22 15:05 johhnry

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)

ddelange avatar May 31 '22 15:05 ddelange

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?

blochsbek avatar Sep 08 '22 20:09 blochsbek

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 ==================================================================================

leonardwellthy avatar Sep 11 '22 02:09 leonardwellthy

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

leonardwellthy avatar Sep 11 '22 02:09 leonardwellthy

@blochs : Now you have the permission to merge, free to go. Thanks.

abawchen avatar Sep 13 '22 02:09 abawchen

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?

ddelange avatar Sep 13 '22 05:09 ddelange