Skip to content

Commit

Permalink
Improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljoseph committed Jul 14, 2014
1 parent f576c02 commit 7f514a0
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions changes/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@
def install():
module_name, dry_run, new_version = config.common_arguments()
commands = ['setup.py', 'clean', 'sdist', 'bdist_wheel']

shell.handle_dry_run(sh.python, tuple(commands))

with util.mktmpdir() as tmp_dir:
venv.create_venv(tmp_dir=tmp_dir)
for distribution in path('dist').files():
try:
venv.install(distribution, tmp_dir)
log.info('Successfully installed %s sdist', module_name)
if verification.run_test_command():
log.info('Successfully ran test command: %s',
config.arguments['--test-command'])
except Exception, e:
raise Exception('Error installing distribution %s' % distribution, e)
try:
if (shell.handle_dry_run(sh.python, tuple(commands))):
with util.mktmpdir() as tmp_dir:
venv.create_venv(tmp_dir=tmp_dir)
for distribution in path('dist').files():
venv.install(distribution, tmp_dir)
log.info('Successfully installed %s sdist', module_name)
if verification.run_test_command():
log.info('Successfully ran test command: %s',
config.arguments['--test-command'])
except Exception, e:
raise Exception('Error installing distribution %s' % distribution, e)


def upload():
Expand Down

0 comments on commit 7f514a0

Please sign in to comment.