diff --git a/setup.py b/setup.py index 54b32bab84f6..e6931abc1d1d 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ sys.exit(error) import os +import shutil from zipfile import ZipFile from setuptools import setup, find_packages, Extension @@ -115,6 +116,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"