Changeset 553


Ignore:
Timestamp:
Nov 20, 2015, 6:16:03 AM (4 years ago)
Author:
cito
Message:

Require at least Python 2.6 for the trunk (5.x)

Support for even older Python versions is maintained in the 4.x branch.
The goal for 5.x is to be a single-source code for both Python 2 and 3,
and this is only possible by dropping support for Python 2.5 and older.
For instance, the new except .. as syntax works only since Python 2.6.
Otherwise we would need to use 2to3 and things would be very ugly.
Note that Python 2.6 is now 7 years old. We may want to drop Python 2.6
as well at some point if it turns out to be a burden.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/install.rst

    r516 r553  
    1212
    1313The current version of PyGreSQL has been tested with Python 2.7 and
    14 PostGreSQL 9.2. Older version should work as well, but you will need
    15 at least Python 2.5 and PostgreSQL 8.3.
     14PostGreSQL 9.4. Older version should work as well, but you will need
     15at least Python 2.6 and PostgreSQL 9.0.
    1616
    1717PyGreSQL will be installed as three modules, a dynamic module called
  • trunk/docs/install.txt

    r516 r553  
    1717
    1818The current version of PyGreSQL has been tested with Python 2.7 and
    19 PostGreSQL 9.2. Older version should work as well, but you will need
    20 at least Python 2.5 and PostgreSQL 8.3.
     19PostGreSQL 9.4. Older version should work as well, but you will need
     20at least Python 2.6 and PostgreSQL 9.0.
    2121
    2222PyGreSQL will be installed as three modules, a dynamic module called
  • trunk/docs/introduction.rst

    r516 r553  
    3939version 2.0 and serves as the "BDFL" of PyGreSQL.
    4040
    41 The current version PyGreSQL 4.2 needs PostgreSQL 8.3 and Python 2.5 or above.
     41The current version PyGreSQL 5.0 needs PostgreSQL 9.0 and Python 2.6 or above.
  • trunk/docs/readme.txt

    r516 r553  
    7878version 2.0 and serves as the "BDFL" of PyGreSQL.
    7979
    80 The current version PyGreSQL 4.2 needs PostgreSQL 8.3 and Python 2.5 or above.
     80The current version PyGreSQL 5.0 needs PostgreSQL 9.0 and Python 2.6 or above.
    8181
    8282
  • trunk/module/TEST_PyGreSQL_classic.py

    r532 r553  
    11#! /usr/bin/python
    22
    3 from __future__ import with_statement, print_function
     3from __future__ import print_function
    44
    55import sys
  • trunk/module/TEST_PyGreSQL_classic_connection.py

    r550 r553  
    1313
    1414try:
    15     import unittest2 as unittest  # for Python < 2.6
     15    import unittest2 as unittest  # for Python < 2.7
    1616except ImportError:
    1717    import unittest
     18
    1819import sys
    1920import threading
     
    2324
    2425from decimal import Decimal
    25 try:
    26     from collections import namedtuple
    27 except ImportError:  # Python < 2.6
    28     namedtuple = None
     26
     27from collections import namedtuple
    2928
    3029from StringIO import StringIO
  • trunk/module/TEST_PyGreSQL_classic_dbwrapper.py

    r550 r553  
    1212"""
    1313
    14 from __future__ import with_statement
    15 
    1614try:
    17     import unittest2 as unittest  # for Python < 2.6
     15    import unittest2 as unittest  # for Python < 2.7
    1816except ImportError:
    1917    import unittest
  • trunk/module/TEST_PyGreSQL_classic_functions.py

    r551 r553  
    1414
    1515try:
    16     import unittest2 as unittest  # for Python < 2.6
     16    import unittest2 as unittest  # for Python < 2.7
    1717except ImportError:
    1818    import unittest
  • trunk/module/TEST_PyGreSQL_classic_largeobj.py

    r550 r553  
    1313
    1414try:
    15     import unittest2 as unittest  # for Python < 2.6
     15    import unittest2 as unittest  # for Python < 2.7
    1616except ImportError:
    1717    import unittest
     18
    1819import tempfile
    1920
  • trunk/module/TEST_PyGreSQL_dbapi20.py

    r525 r553  
    11#! /usr/bin/python
    22# $Id$
    3 
    4 from __future__ import with_statement
    53
    64import unittest
     
    110108
    111109    def test_float(self):
    112         try:
    113             nan = float('nan')
    114         except ValueError:  # Python < 2.6
    115             nan = 3.0e999 - 1.5e999999
    116         try:
    117             inf = float('inf')
    118         except ValueError:  # Python < 2.6
    119             inf = 3.0e999 * 1.5e999999
    120         try:
    121             from math import isnan, isinf
    122         except ImportError:  # Python < 2.6
    123             isnan = lambda x: x != x
    124             isinf = lambda x: not isnan(x) and isnan(x * 0)
    125         try:
    126             from math import isnan, isinf
    127         except ImportError:  # Python < 2.6
    128             isnan = lambda x: x != x
    129             isinf = lambda x: not isnan(x) and isnan(x * 0)
     110        nan, inf = float('nan'), float('inf')
     111        from math import isnan, isinf
    130112        self.assert_(isnan(nan) and not isinf(nan))
    131113        self.assert_(isinf(inf) and not isnan(inf))
  • trunk/module/pg.py

    r521 r553  
    3737import select
    3838import warnings
    39 try:
    40     frozenset
    41 except NameError:  # Python < 2.4
    42     from sets import ImmutableSet as frozenset
    43 try:
    44     from decimal import Decimal
    45     set_decimal(Decimal)
    46 except ImportError:  # Python < 2.4
    47     Decimal = float
    48 try:
    49     from collections import namedtuple
    50 except ImportError:  # Python < 2.6
    51     namedtuple = None
     39
     40from decimal import Decimal
     41from collections import namedtuple
     42
     43set_decimal(Decimal)
    5244
    5345
  • trunk/module/pgdb.py

    r523 r553  
    6565
    6666from _pg import *
    67 try:
    68     frozenset
    69 except NameError:  # Python < 2.4
    70     from sets import ImmutableSet as frozenset
     67
    7168from datetime import date, time, datetime, timedelta
    7269from time import localtime
    73 try:  # use Decimal if available
    74     from decimal import Decimal
    75     set_decimal(Decimal)
    76 except ImportError:  # otherwise (Python < 2.4)
    77     Decimal = float  # use float instead of Decimal
    78 try:
    79     from math import isnan, isinf
    80 except ImportError:  # Python < 2.6
    81     isnan = lambda x: x != x
    82     isinf = lambda x: not isnan(x) and isnan(x * 0)
    83 try:
    84     inf = float('inf')
    85     nan = float('nan')
    86 except ValueError:  # Python < 2.6
    87     inf = 1.0e999
    88     nan = inf * 0
     70from decimal import Decimal
     71from math import isnan, isinf
     72
     73set_decimal(Decimal)
    8974
    9075
  • trunk/module/setup.py

    r550 r553  
    22# $Id$
    33
    4 """Setup script for PyGreSQL version 4.1
     4"""Setup script for PyGreSQL version 5.0
    55
    66PyGreSQL is an open-source Python module that interfaces to a
     
    2222  (the Windows installer has it as part of the database server feature)
    2323
    24 The supported versions are Python 2.5-3.4 and PostgreSQL 8.3-9.3.
     24The supported versions are Python 2.6-3.5 and PostgreSQL 9.0-9.5.
    2525
    2626Use as follows:
     
    3636"""
    3737
    38 version = '4.1.1'
     38version = '5.0a0'
    3939
    4040
    4141import sys
    4242
    43 if not (2, 5) <= sys.version_info[:2] <= (3, 4):
     43if not (2, 6) <= sys.version_info[:2] <= (3, 5):
    4444    raise Exception("Sorry, PyGreSQL %s"
    4545        " does not support this Python version" % version)
Note: See TracChangeset for help on using the changeset viewer.