Skip to content

Commit

Permalink
Merge pull request #7404 from minrk/release-css
Browse files Browse the repository at this point in the history
remove strict requirement for less,invoke when building wheel/sdist
  • Loading branch information
minrk committed Jan 10, 2015
2 parents 351430c + 01a6d23 commit 50799e6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ def run(self):

setup_args['cmdclass'] = {
'build_py': css_js_prerelease(
check_package_data_first(git_prebuild('IPython')),
strict=False),
check_package_data_first(git_prebuild('IPython'))),
'sdist' : css_js_prerelease(git_prebuild('IPython', sdist)),
'upload_wininst' : UploadWindowsInstallers,
'submodule' : UpdateSubmodules,
Expand Down
9 changes: 3 additions & 6 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ def run(self):
f.write(line)


def css_js_prerelease(command, strict=True):
def css_js_prerelease(command):
"""decorator for building js/minified css prior to a release"""
class DecoratedCommand(command):
def run(self):
Expand All @@ -756,10 +756,7 @@ def run(self):
try:
self.distribution.run_command('css')
except Exception as e:
if strict:
raise
else:
log.warn("rebuilding css and sourcemaps failed (not a problem)")
log.warn(str(e))
log.warn("rebuilding css and sourcemaps failed (not a problem)")
log.warn(str(e))
command.run(self)
return DecoratedCommand
8 changes: 7 additions & 1 deletion tools/release
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ if not os.path.exists(ipbackupdir):
cd(ipdir)

# Load release info
execfile(pjoin('IPython','core','release.py'))
execfile(pjoin('IPython','core','release.py'), globals())
# ensure js version is in sync
sh('./setup.py jsversion')
# build minified css and sourcemaps
sh('./setup.py css -x -f')

# Build site addresses for file uploads
release_site = '%s/release/%s' % (archive, version)
Expand All @@ -48,6 +50,10 @@ sh('mv ipython-*.tgz %s' % ipbackupdir)
# Build release files
sh('./build_release %s' % ipdir)

if 'upload' not in sys.argv:
print("`./release upload` to register and release")
sys.exit(0)

# Register with the Python Package Index (PyPI)
print( 'Registering with PyPI...')
cd(ipdir)
Expand Down
7 changes: 7 additions & 0 deletions tools/toollib.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@ def compile_tree():
msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
msg += 'See messages above for the actual file that produced it.\n'
raise SystemExit(msg)

try:
execfile
except NameError:
def execfile(fname, globs, locs=None):
locs = locs or globs
exec(compile(open(fname).read(), fname, "exec"), globs, locs)

0 comments on commit 50799e6

Please sign in to comment.