Skip to content

Commit 5a76671

Browse files
committed
expose verbose build option in setup.cfg
svn path=/trunk/matplotlib/; revision=4241
1 parent 0d0400f commit 5a76671

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

setup.cfg.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ tag_svn_revision = 1
77
[status]
88
# To suppress display of the dependencies and their versions
99
# at the top of the build log, uncomment the following line:
10-
#
1110
#suppress = True
11+
#
12+
# Uncomment to insert lots of diagnostic prints in extension code
13+
#verbose = True
1214

1315
[provide_packages]
1416
# By default, matplotlib checks for a few dependencies and

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
setup.cfg.template for more information.
88
"""
99

10-
11-
VERBOSE = False # insert lots of diagnostic prints in extension code
12-
1310
# This dict will be updated as we try to select the best option during
1411
# the build process. However, values in setup.cfg will be used, if
1512
# defined.
@@ -186,7 +183,7 @@
186183
build_image(ext_modules, packages)
187184

188185
for mod in ext_modules:
189-
if VERBOSE:
186+
if options['verbose']:
190187
mod.extra_compile_args.append('-DVERBOSE')
191188

192189
print_raw("")

setupext.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999

100100
# matplotlib build options, which can be altered using setup.cfg
101101
options = {'display_status': True,
102+
'verbose': False,
102103
'provide_pytz': 'auto',
103104
'provide_dateutil': 'auto',
104105
'provide_configobj': 'auto',
@@ -117,9 +118,13 @@
117118
if os.path.exists("setup.cfg"):
118119
config = ConfigParser.SafeConfigParser()
119120
config.read("setup.cfg")
121+
120122
try: options['display_status'] = not config.getboolean("status", "suppress")
121123
except: pass
122124

125+
try: options['verbose'] = not config.getboolean("status", "verbose")
126+
except: pass
127+
123128
try: options['provide_pytz'] = config.getboolean("provide_packages", "pytz")
124129
except: options['provide_pytz'] = 'auto'
125130

0 commit comments

Comments
 (0)