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

Skip to content

Commit 32231f2

Browse files
authored
Merge pull request #14653 from anntzer/setupprint
BLD: Remove some unnecessary prints from setup.py.
2 parents b2159ef + 6e73fbf commit 32231f2

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

setup.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
from distutils.dist import Distribution
4343

4444
import setupext
45-
from setupext import (print_line, print_raw, print_message, print_status,
46-
download_or_cache)
45+
from setupext import print_raw, print_status, download_or_cache
4746

4847
# Get the version from versioneer
4948
import versioneer
@@ -176,11 +175,10 @@ def run(self):
176175
or 'clean' in sys.argv):
177176
# Go through all of the packages and figure out which ones we are
178177
# going to build/install.
179-
print_line()
178+
print_raw()
180179
print_raw("Edit setup.cfg to change the build options; "
181180
"suppress output with --quiet.")
182181

183-
required_failed = []
184182
good_packages = []
185183
for package in mpl_packages:
186184
if isinstance(package, str):
@@ -199,18 +197,11 @@ def run(self):
199197
else:
200198
print_status(package.name, 'no')
201199
if not package.optional:
202-
required_failed.append(package)
200+
sys.exit("Failed to build %s" % package.name)
203201
else:
204202
good_packages.append(package)
205203
print_raw('')
206204

207-
# Abort if any of the required packages can not be built.
208-
if required_failed:
209-
print_line()
210-
print_message("The following required packages can not be built: "
211-
"%s" % ", ".join(x.name for x in required_failed))
212-
sys.exit(1)
213-
214205
# Now collect all of the information we need to build all of the
215206
# packages.
216207
for package in good_packages:

setupext.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ def print_raw(*args, **kwargs): pass # Suppress our own output.
179179
print_raw = print
180180

181181

182-
def print_line(char='='):
183-
print_raw(char * 80)
184-
185-
186182
def print_status(package, status):
187183
initial_indent = "%12s: " % package
188184
indent = ' ' * 18
@@ -191,13 +187,6 @@ def print_status(package, status):
191187
subsequent_indent=indent))
192188

193189

194-
def print_message(message):
195-
indent = ' ' * 18 + "* "
196-
print_raw(textwrap.fill(str(message), width=80,
197-
initial_indent=indent,
198-
subsequent_indent=indent))
199-
200-
201190
def get_buffer_hash(fd):
202191
BLOCKSIZE = 1 << 16
203192
hasher = hashlib.sha256()

0 commit comments

Comments
 (0)