Lines 82-101
Link Here
|
82 |
List of (module name, minimum __version__ string, [attribute names]).""" |
82 |
List of (module name, minimum __version__ string, [attribute names]).""" |
83 |
|
83 |
|
84 |
def get_extras(): |
84 |
def get_extras(): |
85 |
extras = [] |
85 |
# old method does not work for upgrading/downgrading docutils. |
86 |
for module_name, version, attributes in extra_modules: |
86 |
# so we use a simple rule, 'optparse' and 'textwrap' are not installed |
87 |
try: |
87 |
# for >=python-2.3 |
88 |
module = __import__(module_name) |
88 |
|
89 |
if version and module.__version__ < version: |
89 |
pyver = sys.version_info |
90 |
raise ValueError |
90 |
if pyver[0] == 2 and pyver[1] > 2: |
91 |
for attribute in attributes or []: |
91 |
return ["roman"] |
92 |
getattr(module, attribute) |
92 |
else: |
93 |
print ('"%s" module already present; ignoring extras/%s.py.' |
93 |
return ["optparse","textwrap","roman"] |
94 |
% (module_name, module_name)) |
|
|
95 |
except (ImportError, AttributeError, ValueError): |
96 |
extras.append(module_name) |
97 |
return extras |
98 |
|
99 |
|
94 |
|
100 |
class dual_build_py(build_py): |
95 |
class dual_build_py(build_py): |
101 |
|
96 |
|