Skip to content

Commit

Permalink
Move cleanup to main setup.py, where it belongs.
Browse files Browse the repository at this point in the history
Distutils now generates .egg-info stuff even without setuptools, so we
should do the cleanup in the main script.
  • Loading branch information
fperez committed Jan 13, 2010
1 parent e687d79 commit e8303d5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion IPython/core/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
development = True # change this to False to do a release
version_base = '0.11'
branch = 'ipython'
revision = '1312'
revision = '1313'

if development:
if branch == 'ipython':
Expand Down
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# Stdlib imports
import os
import shutil
import sys

from glob import glob
Expand All @@ -43,6 +44,21 @@
isfile = os.path.isfile
pjoin = os.path.join

#-----------------------------------------------------------------------------
# Function definitions
#-----------------------------------------------------------------------------

def cleanup():
"""Clean up the junk left around by the build process"""
if "develop" not in sys.argv:
try:
shutil.rmtree('ipython.egg-info')
except:
try:
os.unlink('ipython.egg-info')
except:
pass

#-------------------------------------------------------------------------------
# Handle OS specific things
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -144,7 +160,6 @@
)

[ target_update(*t) for t in to_update ]


#---------------------------------------------------------------------------
# Find all the packages, package data, scripts and data_files
Expand Down Expand Up @@ -203,7 +218,6 @@
# just to make life easy for users.
check_for_dependencies()


#---------------------------------------------------------------------------
# Do the actual setup now
#---------------------------------------------------------------------------
Expand All @@ -214,5 +228,7 @@
setup_args['data_files'] = data_files
setup_args.update(setuptools_extra_args)


if __name__ == '__main__':
setup(**setup_args)
cleanup()
16 changes: 1 addition & 15 deletions setupegg.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
#!/usr/bin/env python
"""Wrapper to run setup.py using setuptools."""

import os
import shutil
import sys

# now, import setuptools and call the actual setup
# Import setuptools and call the actual setup
import setuptools
execfile('setup.py')

# clean up the junk left around by setuptools
if "develop" not in sys.argv:
try:
shutil.rmtree('ipython.egg-info')
except:
try:
os.unlink('ipython.egg-info')
except:
pass

0 comments on commit e8303d5

Please sign in to comment.