Skip to content

Commit

Permalink
Use the module name for tarball installation, if specified, with a test.
Browse files Browse the repository at this point in the history
Fixes #48
  • Loading branch information
michaeljoseph committed Nov 15, 2013
1 parent 3970e4b commit 7c59ed0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
--noinput To be used in conjuction with one of the version
increment options above, this option stops
`changes` from confirming the new version number.
--module-name=<module> If your module and package aren't the same
--debug Debug output.
The commands do the following:
Expand Down
3 changes: 2 additions & 1 deletion changes/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ def install():
result = shell.handle_dry_run(sh.python, ('setup.py', 'clean', 'sdist'))
if result:
tmp_dir = make_virtualenv()
module_name = config.arguments.get('--module-name') or app_name
try:
virtualenv.install_sdist(
config.arguments['<app_name>'],
'dist/%s-%s.tar.gz' % (app_name, new_version),
'dist/%s-%s.tar.gz' % (module_name, new_version),
'%s/bin/python' % tmp_dir
)
log.info('Successfully installed %s sdist', app_name)
Expand Down
5 changes: 5 additions & 0 deletions tests/test_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ def test_install(self):
config.arguments['--dry-run'] = True
packaging.install()

def test_install_with_module_name(self):
config.arguments['--dry-run'] = True
config.arguments['--module-name'] = 'thing'
packaging.install()

def test_make_virtualenv(self):
packaging.make_virtualenv()

Expand Down

0 comments on commit 7c59ed0

Please sign in to comment.