8000 BLD: Add an explicit message if certifi is unavailable · matplotlib/matplotlib@340eee2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 340eee2

Browse files
committed
BLD: Add an explicit message if certifi is unavailable
If you only do a build step (i.e., `python setup.py build`), it does not go through all the build dependency machinery, and then mysteriously says it 'cannot download' a URL, but really it's a missing dependency.
1 parent 64fc13a commit 340eee2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

setupext.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ def get_and_extract_tarball(urls, sha, dirname):
118118
"""
119119
toplevel = Path("build", dirname)
120120
if not toplevel.exists(): # Download it or load it from cache.
121+
try:
122+
import certifi # noqa
123+
except ImportError as e:
124+
raise ImportError(
125+
f"`certifi` is unavailable ({e}) so unable to download any of "
126+
f"the following: {urls}.") from None
127+
121128
Path("build").mkdir(exist_ok=True)
122129
for url in urls:
123130
try:

0 commit comments

Comments
 (0)
0