types-psycopg2 should be optional dependency?
I noticed that adding django-types to my project installed types-psycopg2 too
But I'm not using Postgres db and I don't have psycopg2 installed
In Django that's an optional dependency that has to be installed manually
I'd be curious what happens when it's not installed and someone tries to use a Django Postgres specific thing, since we depend on the types:
https://github.com/sbdchd/django-types/blob/610f267873cbc2eca8a49434cd0b7a6b323807df/django-stubs/db/backends/utils.pyi#L11
I have this workaround in my pyproject.toml file which avoids types-psycopg2 getting installed when using uv. It seems to work fine, so I'm just confirming that making it an optional dependency should be fine if you're not using Postgres specific things (I don't know what would happen if you do). Maybe make a django-types[psycopg2] optional dependency group?
[tool.uv]
# Remove unused dependencies https://github.com/astral-sh/uv/issues/4422
override-dependencies = [
"types-psycopg2 ; sys_platform == 'never'", # unused from django-types
]