Skip to content

Commit

Permalink
Merge pull request #700 from pv/vendor-repo
Browse files Browse the repository at this point in the history
Put vendorized files to a separate submodule repository

Downloading the asset files in setup.py can fail, and it is better to
force the download go via "git clone --recursive".

It is not useful to store minified JS/CSS files in the main repository,
so put them to a separate place. Clear separation may also make things
easier for linux distros that don't like minified files.
  • Loading branch information
pv authored Aug 17, 2018
2 parents 3c1aa39 + 4d06011 commit ac30935
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 808 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ __pycache__
# Other generated files
MANIFEST
asv/_version.py
asv/www/vendor

# Sphinx
_build
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "asv/www/vendor"]
path = asv/www/vendor
url = https://github.com/airspeed-velocity/asv-vendor
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ cache:
- '%LOCALAPPDATA%\pip\Cache'

install:
# Init and clone submodules
- git submodule update --init --recursive

# Clear tmpdir (sometimes left behind by appveyor?)
- rmdir /s /q %APPVEYOR_BUILD_FOLDER%\\tmp & exit /b 0

Expand Down
14 changes: 12 additions & 2 deletions asv/commands/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,24 @@ def run(cls, conf, range_spec=None, pull=True):
repo = get_repo(conf)
benchmarks = Benchmarks.load(conf)

def copy_ignore(src, names):
# Copy only *.js and *.css in vendor dir
ignore = [fn for fn in names
if (os.path.basename(src).lower() == 'vendor' and
not fn.lower().endswith('.js') and
not fn.lower().endswith('.css'))]
return ignore

template_dir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), '..', 'www')
shutil.copytree(template_dir, conf.html_dir)
shutil.copytree(template_dir, conf.html_dir, ignore=copy_ignore)

# Ensure html_dir is writable even if template_dir is on a read-only FS
os.chmod(conf.html_dir, 0o755)
for (pre, ds, fs) in os.walk(conf.html_dir):
for x in fs + ds:
for x in fs:
os.chmod(os.path.join(pre, x), 0o644)
for x in ds:
os.chmod(os.path.join(pre, x), 0o755)

log.step()
Expand Down
140 changes: 0 additions & 140 deletions asv/www/flot/jquery.flot.axislabels.js

This file was deleted.

192 changes: 0 additions & 192 deletions asv/www/flot/jquery.flot.orderBars.js

This file was deleted.

Loading

0 comments on commit ac30935

Please sign in to comment.