Skip to content

Commit 365e65c

Browse files
committed
Support python3 for bump script
1 parent 0657f57 commit 365e65c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

scripts/bump.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python3
2+
from __future__ import unicode_literals
23
import argparse
34
import io
45
import os
@@ -30,12 +31,19 @@ def _replace_file_content(cls,
3031
f.write(new_content)
3132

3233
def patch(self):
33-
self._replace_file_content(self._config_path, r'("version": )("[^"]+")(,)', '\\1"' + self._version + '"\\3')
34+
self._replace_file_content(self._config_path,
35+
r'("version": )("[^"]+")(,)',
36+
'\\1"' + self._version + '"\\3')
37+
3438

3539
def parse_args():
3640
arg_parser = argparse.ArgumentParser()
3741

38-
arg_parser.add_argument('--version', '-V', type=str, required=True, help='Bump packages version')
42+
arg_parser.add_argument('--version',
43+
'-V',
44+
type=str,
45+
required=True,
46+
help='Bump packages version')
3947

4048
args = arg_parser.parse_args()
4149
return args
@@ -52,5 +60,6 @@ def main():
5260
package_root = os.path.join(ROOT_DIR, 'packages', package)
5361
PackageConfigPatcher(package_root, version).patch()
5462

63+
5564
if __name__ == '__main__':
5665
main()

0 commit comments

Comments
 (0)