Merge lp:~cjwatson/storm/require-psycopg2-2.3.0 into lp:storm

Proposed by Colin Watson
Status: Merged
Merged at revision: 497
Proposed branch: lp:~cjwatson/storm/require-psycopg2-2.3.0
Merge into: lp:storm
Diff against target: 30 lines (+4/-5)
2 files modified
setup.py (+1/-1)
storm/databases/postgres.py (+3/-4)
To merge this branch: bzr merge lp:~cjwatson/storm/require-psycopg2-2.3.0
Reviewer Review Type Date Requested Status
Adam Collard (community) Approve
Review via email: mp+368206@code.launchpad.net

Commit message

Require psycopg2 >= 2.3.0 for two-phase commit support.

Description of the change

Some of Storm's tests fail with older versions of psycopg2, because two-phase commit support was only introduced in 2.3.0. This impedes establishing test matrixes to work out whether workarounds for old bugs are still necessary (I ran into this while looking into the state of Unicode query support).

It looks as though most of Storm would probably still work OK with earlier versions, and just require a little extra code to ensure that we raise FeatureError or similar when somebody tries to use two-phase commits with an old psycopg2 version. However, I can't find any evidence of anyone complaining about this in the seven years since Storm gained two-phase commit support, and psycopg2 2.3.0 was released in December 2010, so doing work to support older versions now doesn't seem like a sensible use of time.

To post a comment you must log in.
Revision history for this message
Adam Collard (adam-collard) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'setup.py'
2--- setup.py 2019-05-30 13:21:20 +0000
3+++ setup.py 2019-05-31 18:48:17 +0000
4@@ -21,7 +21,7 @@
5 "fixtures >= 0.3.5",
6 # pgbouncer (the Python module) is not yet packaged in Ubuntu.
7 "pgbouncer >= 0.0.7",
8- "psycopg2 >= 2.0.13",
9+ "psycopg2 >= 2.3.0",
10 "testresources >= 0.2.4",
11 "testtools >= 0.9.8",
12 # timeline is not yet packaged in Ubuntu.
13
14=== modified file 'storm/databases/postgres.py'
15--- storm/databases/postgres.py 2016-04-28 11:57:12 +0000
16+++ storm/databases/postgres.py 2019-05-31 18:48:17 +0000
17@@ -26,10 +26,9 @@
18
19 from storm.databases import dummy
20
21-# PostgreSQL support in Storm requires psycopg2 2.0.7 or greater.
22-# Earlier versions of psyocpg2 contain data loss bugs.
23-# See https://bugs.launchpad.net/storm/+bug/322206 for more details.
24-REQUIRED_PSYCOPG2_VERSION = LooseVersion('2.0.7')
25+# PostgreSQL support in Storm requires psycopg2 2.3.0 or greater, in order
26+# to support the two-phase commit protocol.
27+REQUIRED_PSYCOPG2_VERSION = LooseVersion('2.3.0')
28 PSYCOPG2_VERSION = None
29 try:
30 import psycopg2

Subscribers

People subscribed via source and target branches

to status/vote changes: