mirror of https://github.com/dbcli/pgcli
Make it Py3 compatible.
This commit is contained in:
parent
2f4df27df2
commit
c74a9141fe
17
release.py
17
release.py
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
from __future__ import print_function
|
||||||
import re
|
import re
|
||||||
import ast
|
import ast
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -17,28 +18,28 @@ def version(version_file):
|
||||||
|
|
||||||
def commit_for_release(version_file, ver):
|
def commit_for_release(version_file, ver):
|
||||||
cmd = ['git', 'reset']
|
cmd = ['git', 'reset']
|
||||||
print ' '.join(cmd)
|
print(' '.join(cmd))
|
||||||
subprocess.check_output(cmd)
|
subprocess.check_output(cmd)
|
||||||
cmd = ['git', 'add', version_file]
|
cmd = ['git', 'add', version_file]
|
||||||
print ' '.join(cmd)
|
print(' '.join(cmd))
|
||||||
subprocess.check_output(cmd)
|
subprocess.check_output(cmd)
|
||||||
cmd = ['git', 'commit', '--message', 'Releasing version %s' % ver]
|
cmd = ['git', 'commit', '--message', 'Releasing version %s' % ver]
|
||||||
print ' '.join(cmd)
|
print(' '.join(cmd))
|
||||||
subprocess.check_output(cmd)
|
subprocess.check_output(cmd)
|
||||||
|
|
||||||
def create_git_tag(tag_name):
|
def create_git_tag(tag_name):
|
||||||
cmd = ['git', 'tag', tag_name]
|
cmd = ['git', 'tag', tag_name]
|
||||||
print ' '.join(cmd)
|
print(' '.join(cmd))
|
||||||
subprocess.check_output(cmd)
|
subprocess.check_output(cmd)
|
||||||
|
|
||||||
def register_with_pypi():
|
def register_with_pypi():
|
||||||
cmd = ['python', 'setup.py', 'register']
|
cmd = ['python', 'setup.py', 'register']
|
||||||
print ' '.join(cmd)
|
print(' '.join(cmd))
|
||||||
subprocess.check_output(cmd)
|
subprocess.check_output(cmd)
|
||||||
|
|
||||||
def create_source_tarball():
|
def create_source_tarball():
|
||||||
cmd = ['python', 'setup.py', 'sdist']
|
cmd = ['python', 'setup.py', 'sdist']
|
||||||
print ' '.join(cmd)
|
print(' '.join(cmd))
|
||||||
subprocess.check_output(cmd)
|
subprocess.check_output(cmd)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -46,8 +47,8 @@ if __name__ == '__main__':
|
||||||
subprocess.check_output = lambda x: x
|
subprocess.check_output = lambda x: x
|
||||||
|
|
||||||
ver = version('pgcli/__init__.py')
|
ver = version('pgcli/__init__.py')
|
||||||
print ('Releasing Version:', ver)
|
print('Releasing Version:', ver)
|
||||||
choice = raw_input('Are you sure? (Y/N)')
|
choice = raw_input('Are you sure? (y/N)')
|
||||||
if choice.lower() != 'y':
|
if choice.lower() != 'y':
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
commit_for_release('pgcli/__init__.py', ver)
|
commit_for_release('pgcli/__init__.py', ver)
|
||||||
|
|
Loading…
Reference in New Issue