diff --git a/setup.py b/setup.py index d5ff91c43def..adabf1753797 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ import os from string import Template import urllib.request +import shutil from zipfile import ZipFile from setuptools import setup, Extension @@ -124,6 +125,16 @@ def build_extensions(self): def _download_jquery_to(dest): + if os.path.exists(os.path.join(dest, "jquery-ui-1.12.1")): + return + + # If we are installing from an sdist, use the already downloaded jquery-ui + sdist_src = os.path.join( + "lib/matplotlib/backends/web_backend", "jquery-ui-1.12.1") + if os.path.exists(sdist_src): + shutil.copytree(sdist_src, os.path.join(dest, "jquery-ui-1.12.1")) + return + # Note: When bumping the jquery-ui version, also update the versions in # single_figure.html and all_figures.html. url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"