On one side, this should be documented, and on the other side we should
still allow other fields/forms (array/hstore) to be imported (maybe raise
a RuntimeWarning for the ranges import failure?).
--
Ticket URL: <https://code.djangoproject.com/ticket/24335>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: mjtamlyn (added)
* keywords: => 1.8-beta
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:1>
* owner: => ovangle
* cc: ovangle@… (added)
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:2>
Comment (by mjtamlyn):
Personally I would be happy to simply require psycopg2 >= 2.5 - that
version was released nearly 2 years ago now and I don't see any particular
reason why we need to support older versions.
At the moment there is one mention of the required version, in
`docs/ref/databases.txt`. This was updated to 2.0.9 earlier in this
release cycle to support `UUIDField`.
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:3>
Comment (by ovangle):
I've submitted a patch https://github.com/django/django/pull/4131 which
conditionally defines the classes if an `ImportError` is raised when
importing psycopg2.extras.Range.
I'm happy changing it to require `psycopg2>=2.5`, but obviously since this
is my first contribution a suggestion like that was not my call to make
and the bug as described had been accepted, so I implemented it directly
as stated. Personally, my opinion on these matters is usually "continue
support for the last two major versions of a package".
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:4>
Comment (by mjtamlyn):
Psycopg2 2.6 was released last week -
http://initd.org/psycopg/articles/2015/02/09/psycopg-26-and-255-released/
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:5>
Comment (by ovangle):
I was aware of that, but I meant the two previous major versions (so, not
including the current version). It's arbitrary anyway and since this is
entirely new functionality in an optional module, it's a little early to
be littering the code with conditional imports.
`>= 2.5` is OK with me.
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:6>
Comment (by ovangle):
I was aware of that, but I meant the two previous major versions (so, not
including the current version). It's arbitrary anyway and since this is
entirely new functionality in an optional module, it's a little early to
be littering the code with conditional imports.
`>= 2.5` is OK with me.
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:7>
Comment (by claudep):
Requiring `psycopg2>=2.5` would literally force many users to use a pip-
installed `psycopg2` instead of the system one, as many stable
distributions still have an older version. But if we agree that's an
acceptable requirement for a contrib package, then go for it (and document
it, of course).
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:8>
Comment (by ovangle):
While testing this, it seems that
https://github.com/django/django/commit/39d95fb6ada99c59d47fa0eae6d3128abafe2d58
dropped support for psycopg2 <= 2.4.3 globally (new_array_type was added
in 2.4.3). I'm just going to add a check for the version >= 2.5 into
`django.db.backends.postgres_pyscopg2` and update
`docs/ref/databases.txt`.
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:9>
Comment (by mjtamlyn):
The relevant array code added in that commit is actually only needed for
contrib.postgres in theory, but it might be quite complicated to
conditionally include it as it also changes the way
`GenericIPAddressField` works, I think. For reference, 2.4.3 was released
December 2011.
It is however worth noting that postgres provides an rpm package for rhel6
for psycopg2 2.4.5 if people care about that. Personally, I don't care all
that much about OS level packages. I don't now if we have any kind of
official policy on them.
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:10>
Comment (by ovangle):
I'll defer completing this until I get some consensus about minimum
supported versions.
It seems that `2.5` is an OK minimum for `django.contrib.postgres`, but
`2.4.5` added support for Inet arrays to the `Inet` object, so that's the
current minimum supported version for `db.backends` without a change to
the current code (at least a more informative error than the current one
about new_array_type being unavailable).
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:11>
* owner: ovangle => timgraham
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/4148 New PR] that implements this
proposal from the [https://groups.google.com/d/topic/django-
developers/viXbNzfl64g/discussion mailing list thread]:
* Document 2.4.3 as the minimum if you don't want to use contrib.postgres
* Document 2.5 as the minimum to use contrib.postgres
* Require 2.5+ for Django's test suite to avoid having to add conditional
imports/test skipping.
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:12>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"3adc5f1ee6618a615db07d4a868b366a15c39f82"]:
{{{
#!CommitTicketReference repository=""
revision="3adc5f1ee6618a615db07d4a868b366a15c39f82"
Fixed #24335 -- Bumped required psycopg2 version to 2.4.5 (2.5 for
contrib.postgres).
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:13>
Comment (by Tim Graham <timograham@…>):
In [changeset:"730fb593ad19731e7018dd83236318bfe71de86a"]:
{{{
#!CommitTicketReference repository=""
revision="730fb593ad19731e7018dd83236318bfe71de86a"
[1.8.x] Fixed #24335 -- Bumped required psycopg2 version to 2.4.5 (2.5 for
contrib.postgres).
Backport of 3adc5f1ee6618a615db07d4a868b366a15c39f82 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24335#comment:14>