eamigo86 / graphene-django-extras

Extras functionalities for Graphene-Django
MIT License
416 stars 106 forks source link

ImportError: cannot import name 'QUERY_TERMS' #63

Closed aldarund closed 6 years ago

aldarund commented 6 years ago

After last update deps for graphene-django-extras from 0.3.8a9 to 0.3.8a10 via renovate my CI test now throwing a error on launching backend. Work fine with 0.3.8a9.


Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/management/base.py", line 350, in execute
    self.check()
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/management/base.py", line 379, in check
    include_deployment_checks=include_deployment_checks,
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 60, in _run_checks
    issues.extend(super()._run_checks(**kwargs))
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/management/base.py", line 366, in _run_checks
    return checks.run_checks(**kwargs)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/checks/registry.py", line 71, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique
    all_namespaces = _load_all_namespaces(resolver)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces
    url_patterns = getattr(resolver, 'url_patterns', [])
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/utils/functional.py", line 37, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/urls/resolvers.py", line 533, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/utils/functional.py", line 37, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django/urls/resolvers.py", line 526, in urlconf_module
    return import_module(self.urlconf_name)
  File "/pipeline/source/back/venv/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/pipeline/source/back/hamachi_gql/urls.py", line 22, in <module>
    from core.gq.views import HamachiGraphQLView
  File "/pipeline/source/back/core/gq/views.py", line 1, in <module>
    from graphene_django_extras.views import AuthenticatedGraphQLView
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/graphene_django_extras/__init__.py", line 5, in <module>
    from .fields import DjangoObjectField, DjangoFilterListField, DjangoFilterPaginateListField, \
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/graphene_django_extras/fields.py", line 7, in <module>
    from graphene_django.filter.utils import get_filtering_args_from_filterset
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/graphene_django/filter/utils.py", line 3, in <module>
    from .filterset import custom_filterset_factory, setup_filterset
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/graphene_django/filter/filterset.py", line 5, in <module>
    from django_filters import Filter, MultipleChoiceFilter
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django_filters/__init__.py", line 7, in <module>
    from .filterset import FilterSet
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django_filters/filterset.py", line 15, in <module>
    from .filters import (
  File "/pipeline/source/back/venv/lib/python3.6/site-packages/django_filters/filters.py", line 9, in <module>
    from django.db.models.sql.constants import QUERY_TERMS
ImportError: cannot import name 'QUERY_TERMS'

My req file

beautifulsoup4==4.6.3
dj-database-url==0.5.0
Django==2.1
django-admin-interface==0.6.3
django-anymail==3.0
django-colorfield==0.1.15
django-cors-headers==2.4.0
django-extensions==2.1.0
django-fsm==2.6.0
django-graphiql-debug-toolbar==0.1.1
django-graphql-extensions==0.0.4
django-graphql-jwt==0.1.10
django-mail-templated-simple==3.2
graphene==2.1.3
graphene-django==2.1.0
graphene-django-extras==0.3.8a10
Jinja2==2.10
pinax-stripe==4.4.0
psycopg2==2.7.5
pyjade==4.0.0
python-dateutil==2.7.3
python-decouple==3.1
PyYAML==3.13
requests==2.19.1
six==1.11.0
stringcase==1.2.0
matplotlib==2.2.3
zappa==0.46.2
zappa-django-utils==0.4.0
django-storages==1.6.6
boto3==1.7.75
faker==0.9.0
raven==6.9.0
django-constance==2.2.0
django-picklefield==1.0.0
attrs==18.1.0
simplejson==3.16.0
phonenumbers==8.9.10
eamigo86 commented 6 years ago

Hi @aldarund, thanks for report this, this. The problem is because django-filter<2.x isnot compatible with django<=2.1. Please try this:

pip install django-fllter>=2.0

or downgrade the Django version.

In the last release, I freeze the django-filter version to 1.1.0 because it last version have some reported errors compatibility with lastest graphene-django version, But I will work on temporally fix that in my way from my module.

aldarund commented 6 years ago

relevant PR in django-graphene https://github.com/graphql-python/graphene-django/pull/492