Skip to content
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

Running python manage.py test with -Wall option displays DeprecationError for psycopg2 #56

Open
nam20485 opened this issue May 1, 2018 · 3 comments

Comments

@nam20485
Copy link
Member

nam20485 commented May 1, 2018

As recommended in Django Unit Testing instructions, I added the -Wall argument to python.exe in the python -Wall manage.py test command. When the production API image is built and the test-entrypoint.sh command is run, it now reports an error concerning psycopg2 being deprecated in favor of django.db.backends.postgresql:

$ bin/test.sh -p
Creating network "[secure]resiliencebackend_default" with the default driver
Postgres is up
/usr/local/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/local/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/local/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/local/lib/python3.6/site-packages/django_db_geventpool/backends/postgresql_psycopg2/base.py:13: RemovedInDjango30Warning: The django.db.backends.postgresql_psycopg2 module is deprecated in favor of django.db.backends.postgresql.
  from django.db.backends.postgresql_psycopg2.base import CursorWrapper

Is it necessary for us continue to use the psycopg2 module to connect to postgres, or can we update to the official and recommended DB connector?

@znmeb
Copy link
Contributor

znmeb commented May 1, 2018

I vote for updating but does it impact any other teams?

@bhgrant8
Copy link
Member

bhgrant8 commented May 1, 2018

yeah, did not know psycog2 was depreciated. would agree to update

@bhgrant8
Copy link
Member

bhgrant8 commented May 2, 2018

Looks like it was actually an alias since 1.9 so, should have 0 impact on projects, if we update:

https://docs.djangoproject.com/en/2.0/releases/2.0/#id1

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

No branches or pull requests

3 participants