simonw / django-sql-dashboard

Django app for building dashboards using raw SQL queries
https://django-sql-dashboard.datasette.io/
Apache License 2.0
437 stars 37 forks source link

Update to python3.12, django4.2 and psycopg3 #160

Open radudum10 opened 7 months ago

radudum10 commented 7 months ago

why

  1. Django 4.2 introduced support for psycopg3 and also a deprecation note: Support for psycopg2 is likely to be deprecated and removed at some point in the future. (https://django.readthedocs.io/en/latest/releases/4.2.html#psycopg-3-support)
  2. Users of django-sql-dashboard trying to update to psycopg3 will get a module not found error caused by the following import in views.py:
    from psycopg2.extensions import quote_ident

    (which is also unused, I think :smile:)

    what this PR aims to improve

    • addopts in pytest.ini: When I ran the tests for the first time (in docker) there was a problem with the import of pytest_use_postgresql so I've modify it.
    • Python version update to 3.12 in Docker.
    • The test packages: Django >= 4.2, psycopg >= 3.0, required python >= 3.8 (check https://www.psycopg.org/psycopg3/docs/basic/install.html#supported-systems).
    • Deleted unused imports from views.py.

Thanks for this repo!