<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi,</p>
<p>Matplotlib has a custom setupext.py script designed to stop the
build when a dependency is not installed. However, it seems to
have a bug which makes it crash with this error:</p>
<pre><tt>Traceback (most recent call last):</tt><tt>
</tt><tt> File "setup.py", line 172, in <module></tt><tt>
</tt><tt> result = package.check()</tt><tt>
</tt><tt> File "/tmp/SBo/matplotlib-2.2.3/setupext.py", line 1480, in check</tt><tt>
</tt><tt> print_status(package.name, req_fail_msg)</tt><tt>
</tt><tt>NameError: global name 'package' is not defined</tt>
</pre>
<p>Is this the expected behavior? The following patch will avoid the
error and still stop the build if there is a missing dependency,
with an actual helpful list of dependencies that have not been
installed:</p>
<pre>--- setupext.py 2020-03-16 10:02:52.376214282 -0400
+++ setupext.py.new 2020-03-16 10:03:34.462812966 -0400
@@ -1477,7 +1477,7 @@
req_fail_msg += (os.linesep.join(not_available) +
os.linesep*(2*sp_mult)) * min(1, len(not_available))
req_fail_msg += (os.linesep*2).join(wrong_version)
<font color="Red">- print_status(package.name, req_fail_msg)</font>
<font color="Green">+ print_status(pack_name, req_fail_msg)</font>
raise CheckFailed("missing or faulty third-party python packages")
return "all third-party python packages are present"
</pre>
<p>Regards,</p>
<p>Dan<br>
</p>
</body>
</html>