[ckan-changes] commit/ckanclient: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Thu Oct 27 18:25:03 UTC 2011
2 new commits in ckanclient:
https://bitbucket.org/okfn/ckanclient/changeset/a45a9c66fc2a/
changeset: a45a9c66fc2a
user: Alexander Dutton
date: 2011-10-27 14:09:33
summary: Running setup.py pulls in ckanclient, which tries to import json or simplejson. On Py2.5 systems without simplejson this means that setup.py bails with an ImportError, making it uninstallable. I've fixed this by adding simplejson to install_requires iff json isn't available, and making ckanclient not complain immediately if neither json nor simplejson is available.
affected #: 2 files
diff -r ca5295c9c8cf8024dbb0b10f2c7f52e04dc9768f -r a45a9c66fc2a6bd19e08caa3baf1cf6a23f7bd32 ckanclient/__init__.py
--- a/ckanclient/__init__.py
+++ b/ckanclient/__init__.py
@@ -161,7 +161,13 @@
try: # since python 2.6
import json
except ImportError:
- import simplejson as json
+ try:
+ import simplejson as json
+ except ImportError:
+ class _json(object):
+ def __getattr__(self, name):
+ import simplejson as json
+ json = _json()
import logging
logger = logging.getLogger('ckanclient')
diff -r ca5295c9c8cf8024dbb0b10f2c7f52e04dc9768f -r a45a9c66fc2a6bd19e08caa3baf1cf6a23f7bd32 setup.py
--- a/setup.py
+++ b/setup.py
@@ -5,10 +5,18 @@
use_setuptools()
from setuptools import setup, find_packages
-from ckanclient import __version__, __description__, __long_description__, __license__
+from ckanclient.meta import __version__, __description__, __long_description__, __license__
import os
+install_requires = []
+try:
+ __import__('json')
+except ImportError:
+ # The json module isn't available in the standard library until 2.6;
+ # use simplejson instead,
+ install_requires.append('simplejson')
+
setup(
name='ckanclient',
version=__version__,
@@ -19,10 +27,7 @@
description=__description__,
keywords='data packaging component tool client',
long_description =__long_description__,
- install_requires=[
- # only required if python <= 2.5 (as json library in python >= 2.6)
- # 'simplejson',
- ],
+ install_requires=install_requires,
packages=find_packages(exclude=['ez_setup']),
include_package_data=True,
always_unzip=True,
https://bitbucket.org/okfn/ckanclient/changeset/9904ce6fe5bb/
changeset: 9904ce6fe5bb
user: Alexander Dutton
date: 2011-10-27 14:39:07
summary: Removed ".meta" in import.
affected #: 1 file
diff -r a45a9c66fc2a6bd19e08caa3baf1cf6a23f7bd32 -r 9904ce6fe5bbe77da3619ae0af422bac139ebe89 setup.py
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@
use_setuptools()
from setuptools import setup, find_packages
-from ckanclient.meta import __version__, __description__, __long_description__, __license__
+from ckanclient import __version__, __description__, __long_description__, __license__
import os
Repository URL: https://bitbucket.org/okfn/ckanclient/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list