1414"""Release script to publish release module to pipy."""
1515
1616import glob
17- import io
1817import os
1918import shutil
2019import subprocess
2120import sys
2221from typing import List
2322
24- VERSION_FILE_PATH = os .path .join (os .path .dirname ('__file__' ), 'appium' , 'version.py' )
2523CHANGELOG_PATH = os .path .join (os .path .dirname ('__file__' ), 'CHANGELOG.rst' )
2624
2725APPIUM_DIR_PATH = os .path .join (os .path .dirname ('__file__' ), 'appium' )
3230MESSAGE_YELLOW = '\033 [1;33m{}\033 [0m'
3331
3432
35- def get_current_version ():
36- current = io .open (os .path .join (os .path .dirname ('__file__' ), 'appium' , 'version.py' ), encoding = 'utf-8' ).read ().rstrip ()
37- print ('The current version is {}, type a new one' .format (MESSAGE_YELLOW .format (current )))
38- return current
33+ def print_current_version ():
34+ os .system ('uv version' )
3935
4036
4137def get_new_version ():
@@ -48,9 +44,7 @@ def get_new_version():
4844
4945
5046def update_version_file (version ):
51- new_version = VERSION_FORMAT .format (version )
52- with open (VERSION_FILE_PATH , 'w' ) as f :
53- f .write (new_version )
47+ call_bash_script (f'uv version { version } ' )
5448
5549
5650def call_bash_script (cmd ):
@@ -61,7 +55,7 @@ def call_bash_script(cmd):
6155
6256
6357def commit_version_code (new_version_num ):
64- call_bash_script ('git commit {} -m "Bump {}"' .format (VERSION_FILE_PATH , new_version_num ))
58+ call_bash_script ('git commit pyproject.toml uv.lock -m "Bump {}"' .format (new_version_num ))
6559
6660
6761def tag_and_generate_changelog (new_version_num ):
@@ -141,7 +135,7 @@ def assert_files_count_in_package() -> None:
141135
142136
143137def main ():
144- get_current_version ()
138+ print_current_version ()
145139 new_version = get_new_version ()
146140
147141 update_version_file (new_version )
0 commit comments