Merge pull request #1436 from minrk/less-py-js-py-js-less

add npm run build:css
Kyle Kelley 10 years ago
commit 4ec76aa7b7

@ -31,7 +31,6 @@ before_install:
- git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels
install:
- npm run build
- pip install -f travis-wheels/wheelhouse file://$PWD#egg=notebook[test]
script:

@ -12,8 +12,10 @@
"lint": "eslint --quiet notebook/",
"bower": "bower install --allow-root --config.interactive=false",
"build:watch": "concurrent \"npm run build:css:watch\" \"npm run build:js:watch\"",
"build": "npm run build:css && npm run build:js",
"build:css": "python setup.py css",
"build": "npm run build:js && npm run build:css",
"build:css": "concurrent 'npm run build:css:ipython' 'npm run build:css:style'",
"build:css:ipython": "lessc --include-path=notebook/static notebook/static/style/ipython.less notebook/static/style/ipython.min.css",
"build:css:style": "lessc --include-path=notebook/static notebook/static/style/style.less notebook/static/style/style.min.css",
"build:css:watch": "echo Not implemented yet...",
"build:js": "webpack",
"build:js:watch": "npm run build:js -- --watch"

@ -403,29 +403,17 @@ class CompileCSS(Command):
def finalize_options(self):
pass
sources = []
targets = []
for name in ('ipython', 'style'):
sources.append(pjoin(static, 'style', '%s.less' % name))
targets.append(pjoin(static, 'style', '%s.min.css' % name))
def run(self):
self.run_command('jsdeps')
env = os.environ.copy()
env['PATH'] = npm_path
for src, dst in zip(self.sources, self.targets):
try:
run(['lessc',
'--source-map',
'--include-path=%s' % pipes.quote(static),
src,
dst,
], cwd=repo_root, env=env)
except OSError as e:
print("Failed to build css: %s" % e, file=sys.stderr)
print("You can install js dependencies with `npm install`", file=sys.stderr)
raise
try:
run(['npm', 'run', 'build:css'])
except OSError as e:
print("Failed to run npm run build:css : %s" % e, file=sys.stderr)
print("You can install js dependencies with `npm install`", file=sys.stderr)
raise
# update package data in case this created new files
update_package_data(self.distribution)
@ -542,8 +530,8 @@ def css_js_prerelease(command, strict=False):
return
try:
self.distribution.run_command('css')
self.distribution.run_command('js')
self.distribution.run_command('css')
except Exception as e:
# refresh missing
missing = [ t for t in targets if not os.path.exists(t) ]

Loading…
Cancel
Save