I am importing simplejson / json conditionally into my module as follows:
try:
import simplejson as json
except ImportError:
import json
In my setup.py, however, I do not want to require simplejson if the user has json from the standard libraries. I could do this:
requires = ['kitchen']
try:
import simplejson
except ImportError:
requires.append('simplejson')
setup(..., requires=requires)
Is this good practice for setup.py files? Should I use something else? Should I just just require a simple user?
source
share