Permalink
Browse files

Dropped support for Python 2.4

This way we don't have to worry about missing ordered dicts, can use
try-except-finally, with construct etc.

Actually I would drop py 2.5 as well, in order to use b"" strings, but for the
moment I can live with the b() function.
  • Loading branch information...
1 parent f828a59 commit 58cc381d0c4c4ae25b12c06ec64a5d5702947796 @dvarrazzo committed Jul 10, 2012
Showing with 17 additions and 21 deletions.
  1. +1 −0 CHANGES
  2. +1 −1 docs/install.rst
  3. +1 −3 pgxnclient/commands/install.py
  4. +8 −16 pgxnclient/utils/__init__.py
  5. +6 −1 setup.py
View
1 CHANGES
@@ -6,6 +6,7 @@ PGXN Client changes log
pgxnclient 1.1
==============
+- Dropped support for Python 2.4.
- ``sudo`` is not invoked automatically: the ``--sudo`` option must be
specified if the user has not permission to write into PostgreSQL's libdir
(ticket #13). The ``--sudo`` option can also be invoked without argument.
View
2 docs/install.rst
@@ -4,7 +4,7 @@ Installation
Prerequisites
-------------
-The program is implemented in Python. Versions from Python 2.4 onwards are
+The program is implemented in Python. Versions from Python 2.5 onwards are
supported, including Python 3.0 and successive.
PostgreSQL client-side development tools are required to build and install
View
4 pgxnclient/commands/install.py
@@ -411,9 +411,7 @@ def _get_extensions(self):
if not self.opts.extensions:
# All the extensions, in the order specified
- if len(dist['provides']) > 1 and sys.version_info < (2, 5):
- logger.warn(_("can't guarantee extensions load order "
- "with Python < 2.5"))
+ # (assume we got an orddict from json)
for name, data in dist['provides'].items():
rv.append((name, data.get('file')))
else:
View
24 pgxnclient/utils/__init__.py
@@ -19,12 +19,13 @@
from pgxnclient.utils.ordereddict import OrderedDict
-# Import the proper JSON library
-# dependencies note: simplejson is certified for Python 2.5, and supports
-# Python 2.4 up to version 2.0.9. After that the package is in the stdlib
+# Import the proper JSON library.
#
-# We use json only from 2.7 as it supports ordered dicts. For Python 2.6
-# simplejson >= 2.1 should be used.
+# Dependencies note: simplejson is certified for Python 2.5. Support for
+# Python 2.4 was available up to version 2.0.9, but this version doesn't
+# support ordered dicts. In Py 2.6 the package is in stdlib, but without
+# orddict support, so we use simplejson 2.1 again. From Python 2.7 the stdlilb
+# json module has orddict support so we don't need the external dependency.
if sys.version_info >= (2, 7):
import json
else:
@@ -37,20 +38,11 @@ def load_json(f):
return load_jsons(data)
def load_jsons(data):
- # order required to keep "provides" extensions in order.
- # Python 2.4 is only compatible with a simplejson version that doesn't
- # support ordered dict.
- if sys.version_info >= (2, 5):
- return json.loads(data, object_pairs_hook=OrderedDict)
- else:
- return json.loads(data)
+ return json.loads(data, object_pairs_hook=OrderedDict)
# Import the sha1 object without warnings
-if sys.version_info >= (2, 5):
- from hashlib import sha1
-else:
- from sha import new as sha1
+from hashlib import sha1
# For compatibility from Python 2.4 to 3.x
View
7 setup.py
@@ -31,7 +31,7 @@
tests_require = []
if sys.version_info < (2, 5):
- requires.append('simplejson<=2.0.9')
+ raise ValueError("PGXN client requires at least Python 2.5")
elif sys.version_info < (2, 7):
requires.append('simplejson>=2.1')
@@ -48,7 +48,12 @@
License :: OSI Approved :: BSD License
Operating System :: POSIX
Programming Language :: Python :: 2
+Programming Language :: Python :: 2.5
+Programming Language :: Python :: 2.6
+Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
+Programming Language :: Python :: 3.1
+Programming Language :: Python :: 3.2
Topic :: Database
"""

0 comments on commit 58cc381

Please sign in to comment.