support psycopg3
this is a bit fiddly because all the supported use-cases but all the tests pass locally with either psycopg version
Thanks for the stab. Is there a way to wrap that compat into something a little more elegant than a big try and except? I'm not an expert on Python backwards compatibility, but I wonder if there's a common pattern from a big library like Django that we can borrow from. (Maybe something our friend Claude would know?)
Thanks for the stab. Is there a way to wrap that compat into something a little more elegant than a big try and except? I'm not an expert on Python backwards compatibility, but I wonder if there's a common pattern from a big library like Django that we can borrow from. (Maybe something our friend Claude would know?)
i followed django https://github.com/django/django/blob/d6e0c710173531645bd3689bc03e9b809aa3d220/django/db/backends/postgresql/psycopg_any.py#L4
i followed django
TIL! ;)
I'm going to blitz through the repo with a machete and update a bunch of other stale stuff while I'm at it here.
Like the versions we're testing and such.
Like the versions we're testing and such.
that would be helpful, thanks. see my latest error with distutils on py 3.12.
maybe we should switch away from setup.py test (see eg https://packaging.python.org/en/latest/discussions/setup-py-deprecated/#python-setup-py-test ) and use eg pytest? happy to make a pr for this tomorrow
maybe we should switch away from
setup.py test(see eg https://packaging.python.org/en/latest/discussions/setup-py-deprecated/#python-setup-py-test ) and use egpytest? happy to make a pr for this tomorrow
I'd be up for this in a separate PR. The main trick is working in those different Django settings tricks. My standard approach for new libraries changed to uv and pyproject.toml a while ago (as seen here). I've been trying to avoid opening that can of worms thus far, but maybe we should.
Looks like I got tests passing, even with 3.13. That's good progress.
@thorntonedgar and @wlorenzetti, do you have any comments or concerns about this implementation?
I'm going to merge this in a few minutes, but before I do I'm going to experiment with asking Claude to drum up some additional unit tests. Mostly as an experiment for me. I'm not optimistic on how well it will do based on some early local tomfoolery.
How come you want dedicated tests for the compt module? It is already tested by running the rest of the suite with each psycopg version
I'm good with what you've got. It's strictly an experiment to see what AI comes up with. I'm just curious. I haven't got to play too much with these tools. I apologize for the indulgence.
Alrighty. I'm good to merge this. I'm going to hammer in a couple long overdue modernizations before I ship a new version like uv for env management and some mypy static type hinting. I expect to get it shipped today. Thank you very much for this excellent pull request and I'll flag you when I get it out on pypi.
Version 2.8.0 is released. Please give it a shot and let me know if you have any troubles.
https://pypi.org/project/django-postgres-copy/#history