Skip to content

Commit

Permalink
REL: improve bootstrap handling + add release script.
Browse files Browse the repository at this point in the history
  • Loading branch information
cournape committed Mar 8, 2010
1 parent 9cc23f6 commit cc87385
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 18 deletions.
47 changes: 29 additions & 18 deletions pavement.py
Expand Up @@ -46,7 +46,33 @@
include_package_data=True)

options(sphinx=Bunch(builddir="build", sourcedir="src"),
virtualenv=Bunch(script_name="install/bootstrap.py"))
bootstrap=Bunch(bootstrap_dir="bootstrap"),
virtualenv=Bunch(packages_to_install=["sphinx", "numpydoc"],
no_site_packages=False))

#----------------
# Bootstrap stuff
#----------------
@task
def bootstrap(options):
"""create virtualenv in ./bootstrap"""
try:
import virtualenv
except ImportError, e:
raise RuntimeError("virtualenv is needed for bootstrap")

bdir = options.bootstrap_dir
if not os.path.exists(bdir):
os.makedirs(bdir)
bscript = "boostrap.py"

options.virtualenv.script_name = os.path.join(options.bootstrap_dir,
bscript)
options.virtualenv.no_site_packages = True
options.bootstrap.no_site_packages = True
print options.virtualenv.script_name
call_task('paver.virtual.bootstrap')
sh('cd %s; %s %s' % (bdir, sys.executable, bscript))

def macosx_version():
st = subprocess.Popen(["sw_vers"], stdout=subprocess.PIPE)
Expand All @@ -64,22 +90,7 @@ def mpkg_name():
return "scikits.audiolab-%s-py%s-macosx%s.%s.mpkg" % (common.build_fverstring(),
pyver, maj, min)

VPYEXEC = "install/bin/python"

@task
def bootstrap():
"""create virtualenv in ./install"""
install = paver.path.path('install')
if not install.exists():
install.mkdir()
call_task('paver.virtual.bootstrap')
sh('cd install; %s bootstrap.py' % sys.executable)

@task
@needs('bootstrap')
def test_install():
"""Install the package into the venv."""
sh('%s setup.py install' % VPYEXEC)
VPYEXEC = "bootstrap/bin/python"

@task
def clean():
Expand All @@ -93,7 +104,7 @@ def clean():

@task
def clean_bootstrap():
paver.path.path('install').rmtree()
paver.path.path('bootstrap').rmtree()

@task
@needs("setuptools.bdist_mpkg", "doc")
Expand Down
13 changes: 13 additions & 0 deletions release.sh
@@ -0,0 +1,13 @@
#! /bin/sh
# script to build tarballs, mac os x and windows installers on mac os x
paver bootstrap
source bootstrap/bin/activate
python setup.py install
paver html
paver pdf
paver sdist
#paver dmg -p 2.5
#paver dmg -p 2.6
#paver bdist_superpack -p 2.5
#paver bdist_superpack -p 2.6
#paver write_release_and_log

0 comments on commit cc87385

Please sign in to comment.