##// END OF EJS Templates
don’t store minified css in development...
MinRK -
Show More
@@ -13,7 +13,7 b" components_dir = os.path.join(static_dir, 'components')"
13 min_less_version = '1.7.0'
13 min_less_version = '1.7.0'
14 max_less_version = '1.8.0' # exclusive
14 max_less_version = '1.8.0' # exclusive
15
15
16 def css(minify=True, verbose=False):
16 def css(minify=False, verbose=False):
17 """generate the css from less files"""
17 """generate the css from less files"""
18 for name in ('style', 'ipython'):
18 for name in ('style', 'ipython'):
19 source = pjoin('style', "%s.less" % name)
19 source = pjoin('style', "%s.less" % name)
@@ -72,6 +72,7 b' from setupbase import ('
72 get_bdist_wheel,
72 get_bdist_wheel,
73 CompileCSS,
73 CompileCSS,
74 JavascriptVersion,
74 JavascriptVersion,
75 css_js_prerelease,
75 install_symlinked,
76 install_symlinked,
76 install_lib_symlink,
77 install_lib_symlink,
77 install_scripts_for_symlink,
78 install_scripts_for_symlink,
@@ -228,7 +229,7 b' class UploadWindowsInstallers(upload):'
228
229
229 setup_args['cmdclass'] = {
230 setup_args['cmdclass'] = {
230 'build_py': check_package_data_first(git_prebuild('IPython')),
231 'build_py': check_package_data_first(git_prebuild('IPython')),
231 'sdist' : git_prebuild('IPython', sdist),
232 'sdist' : css_js_prerelease(git_prebuild('IPython', sdist)),
232 'upload_wininst' : UploadWindowsInstallers,
233 'upload_wininst' : UploadWindowsInstallers,
233 'submodule' : UpdateSubmodules,
234 'submodule' : UpdateSubmodules,
234 'css' : CompileCSS,
235 'css' : CompileCSS,
@@ -302,7 +303,7 b" if 'setuptools' in sys.modules:"
302 # setup.py develop should check for submodules
303 # setup.py develop should check for submodules
303 from setuptools.command.develop import develop
304 from setuptools.command.develop import develop
304 setup_args['cmdclass']['develop'] = require_submodules(develop)
305 setup_args['cmdclass']['develop'] = require_submodules(develop)
305 setup_args['cmdclass']['bdist_wheel'] = get_bdist_wheel()
306 setup_args['cmdclass']['bdist_wheel'] = css_js_prerelease(get_bdist_wheel())
306
307
307 setuptools_extra_args['zip_safe'] = False
308 setuptools_extra_args['zip_safe'] = False
308 setuptools_extra_args['entry_points'] = {'console_scripts':find_entry_points()}
309 setuptools_extra_args['entry_points'] = {'console_scripts':find_entry_points()}
@@ -25,7 +25,7 b' from distutils.command.install_scripts import install_scripts'
25 from distutils.cmd import Command
25 from distutils.cmd import Command
26 from fnmatch import fnmatch
26 from fnmatch import fnmatch
27 from glob import glob
27 from glob import glob
28 from subprocess import call
28 from subprocess import check_call
29
29
30 from setupext import install_data_ext
30 from setupext import install_data_ext
31
31
@@ -666,16 +666,22 b' class CompileCSS(Command):'
666 Requires various dev dependencies, such as fabric and lessc.
666 Requires various dev dependencies, such as fabric and lessc.
667 """
667 """
668 description = "Recompile Notebook CSS"
668 description = "Recompile Notebook CSS"
669 user_options = []
669 user_options = [
670 ('minify', 'x', "minify CSS"),
671 ]
670
672
671 def initialize_options(self):
673 def initialize_options(self):
672 pass
674 self.minify = False
673
675
674 def finalize_options(self):
676 def finalize_options(self):
675 pass
677 self.minify = bool(self.minify)
676
678
677 def run(self):
679 def run(self):
678 call("fab css", shell=True, cwd=pjoin(repo_root, "IPython", "html"))
680 check_call("fab css:minify=%s" % self.minify,
681 shell=True,
682 cwd=pjoin(repo_root, "IPython", "html"),
683 )
684
679
685
680 class JavascriptVersion(Command):
686 class JavascriptVersion(Command):
681 """write the javascript version to notebook javascript"""
687 """write the javascript version to notebook javascript"""
@@ -697,4 +703,15 b' class JavascriptVersion(Command):'
697 if line.startswith("IPython.version"):
703 if line.startswith("IPython.version"):
698 line = 'IPython.version = "{0}";\n'.format(version)
704 line = 'IPython.version = "{0}";\n'.format(version)
699 f.write(line)
705 f.write(line)
700
706
707
708 def css_js_prerelease(command):
709 """decorator for building js/minified css prior to a release"""
710 class DecoratedCommand(command):
711 def run(self):
712 self.distribution.run_command('jsversion')
713 css = self.distribution.get_command_obj('css')
714 css.minify = True
715 self.distribution.run_command('css')
716 command.run(self)
717 return DecoratedCommand
General Comments 0
You need to be logged in to leave comments. Login now