Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bd8a8f0

Browse files
committed
Don't redownload jquery when installing from an sdist
Closes #14585
1 parent 667a100 commit bd8a8f0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
sys.exit(error)
2222

2323
import os
24+
import shutil
2425
from zipfile import ZipFile
2526

2627
from setuptools import setup, find_packages, Extension
@@ -115,6 +116,13 @@ def build_extensions(self):
115116

116117

117118
def _download_jquery_to(dest):
119+
# If we are installing from an sdist, use the already downloaded jquery-ui
120+
sdist_src = os.path.join(
121+
"lib/matplotlib/backends/web_backend", "jquery-ui-1.12.1")
122+
if os.path.exists(sdist_src):
123+
shutil.copytree(sdist_src, os.path.join(dest, "jquery-ui-1.12.1"))
124+
return
125+
118126
# Note: When bumping the jquery-ui version, also update the versions in
119127
# single_figure.html and all_figures.html.
120128
url = "https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip"

0 commit comments

Comments
 (0)