From 8d27eeb735f25c12118ca3e0e6d05d872a5f42a5 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 5 Aug 2019 15:49:30 -0400 Subject: [PATCH] Merge pull request #14915 from AWhetter/fix_14585 BLD: Don't redownload jquery when installing from an sdist --- setup.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/setup.py b/setup.py index 41037e95dbd1..b6d8b78f61aa 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ from io import BytesIO import os from string import Template +import shutil from zipfile import ZipFile from setuptools import setup @@ -147,6 +148,16 @@ def run(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"