Skip to content

Graphql dependency error #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2022

Conversation

blochs
Copy link
Collaborator

@blochs blochs commented Feb 7, 2022

Resolves #189 with the introduction of the graphene v3.0 package as well.
All tests pass.

@blochs
Copy link
Collaborator Author

blochs commented Feb 7, 2022

Also resolves #187 as well.

@blochs
Copy link
Collaborator Author

blochs commented Feb 7, 2022

cc @abawchen

@blochs
Copy link
Collaborator Author

blochs commented Mar 17, 2022

@abawchen Any way we can merge and release this?

@johhnry
Copy link

johhnry commented May 31, 2022

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?

@ddelange
Copy link

ddelange commented May 31, 2022

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)

@blochsbek
Copy link
Collaborator

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?

@leonardwellthy
Copy link
Contributor

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
Copy link
Contributor

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

@abawchen
Copy link
Collaborator

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

@ddelange
Copy link

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?

@abawchen abawchen merged commit 889eda8 into graphql-python:master Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

graphql_relay dependency error
6 participants