13
|
1 from fabric.api import local
|
|
2 from fabric.operations import prompt
|
|
3 import os
|
|
4
|
|
5
|
|
6 def package():
|
|
7 '''
|
|
8 Pacakge for upload to toolshed
|
|
9 packaging 'test' version (default) uses local directory
|
|
10 otherwise, specify a mercurial tag to package
|
|
11 '''
|
|
12 package_dir = 'package'
|
|
13 base_filename = os.path.join(package_dir, 'htseq-count')
|
|
14 version = prompt("Enter version number for package [test]:")
|
|
15 revision_option = ''
|
|
16 if version != '':
|
|
17 revision_option = '-r "%s"' % version
|
|
18 else:
|
|
19 version = 'test'
|
|
20 version_filename = '%s_%s.tar.gz' % (base_filename, version)
|
|
21 local('mkdir -p %s' % package_dir)
|
|
22 local('rm -f %s' % version_filename)
|
|
23 if version == 'test':
|
|
24 local('tar czvf %s --exclude "fabfile.*" --exclude "%s" --exclude ".hg*" *' % (version_filename, package_dir))
|
|
25 else:
|
|
26 local('hg archive -t tgz %s -X "fabfile.*" -X "package" -X ".hg*" -p . "%s"' % (revision_option, version_filename))
|