Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a775a8

Browse files
committed
More shortening of setup.py prints.
We don't really need to support "sections" in the packages list. This PR makes the output go from ``` BUILDING MATPLOTLIB matplotlib: yes [3.1.0+1287.g04d9d28b8] python: yes [3.7.3 (default, Jun 24 2019, 04:54:02) [GCC 9.1.0]] platform: yes [linux] OPTIONAL SUBPACKAGES sample_data: yes [installing] tests: no [skipping due to configuration] OPTIONAL BACKEND EXTENSIONS agg: yes [installing] tkagg: yes [installing; run-time loading from Python Tcl/Tk] macosx: no [Mac OS-X only] ``` to ``` BUILDING MATPLOTLIB matplotlib: yes [3.1.0+1287.g04d9d28b8.dirty] python: yes [3.7.3 (default, Jun 24 2019, 04:54:02) [GCC 9.1.0]] platform: yes [linux] sample_data: yes [installing] tests: no [skipping due to configuration] agg: yes [installing] tkagg: yes [installing; run-time loading from Python Tcl/Tk] macosx: no [Mac OS-X only] ``` (and note that the "agg" and "tkagg" entries are being removed by a separate PR, as they're not configurable anyways...)
1 parent 04d9d28 commit 5a775a8

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

setup.py

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@
4949
__version__ = versioneer.get_version()
5050

5151

52-
# These are the packages in the order we want to display them. This
53-
# list may contain strings to create section headers for the display.
52+
# These are the packages in the order we want to display them.
5453
mpl_packages = [
55-
'Building Matplotlib',
5654
setupext.Matplotlib(),
5755
setupext.Python(),
5856
setupext.Platform(),
@@ -67,10 +65,8 @@
6765
setupext.Contour(),
6866
setupext.QhullWrap(),
6967
setupext.Tri(),
70-
'Optional subpackages',
7168
setupext.SampleData(),
7269
setupext.Tests(),
73-
'Optional backend extensions',
7470
setupext.BackendAgg(),
7571
setupext.BackendTkAgg(),
7672
setupext.BackendMacOSX(),
@@ -178,29 +174,23 @@ def run(self):
178174
print_raw()
179175
print_raw("Edit setup.cfg to change the build options; "
180176
"suppress output with --quiet.")
177+
print_raw()
178+
print_raw("BUILDING MATPLOTLIB")
181179

182180
good_packages = []
183181
for package in mpl_packages:
184-
if isinstance(package, str):
185-
print_raw('')
186-
print_raw(package.upper())
182+
try:
183+
result = package.check()
184+
if result is not None:
185+
print_status(package.name, 'yes [%s]' % result)
186+
except setupext.CheckFailed as e:
187+
print_status(package.name, 'no [%s]' % str(e))
188+
if not package.optional:
189+
sys.exit("Failed to build %s" % package.name)
187190
else:
188-
try:
189-
result = package.check()
190-
if result is not None:
191-
message = 'yes [%s]' % result
192-
print_status(package.name, message)
193-
except setupext.CheckFailed as e:
194-
msg = str(e).strip()
195-
if len(msg):
196-
print_status(package.name, 'no [%s]' % msg)
197-
else:
198-
print_status(package.name, 'no')
199-
if not package.optional:
200-
sys.exit("Failed to build %s" % package.name)
201-
else:
202-
good_packages.append(package)
203-
print_raw('')
191+
good_packages.append(package)
192+
193+
print_raw()
204194

205195
# Now collect all of the information we need to build all of the
206196
# packages.

0 commit comments

Comments
 (0)