1515import shutil
1616import importlib
1717
18- VERSION = '3.2.4 '
18+ VERSION = '3.2.5 '
1919
2020if sys .version_info < (3 ,):
2121 input = raw_input
@@ -75,7 +75,9 @@ def bump_versions():
7575
7676def bump_version (filename ):
7777 with open (filename , 'rb' ) as f :
78- lines = [line .replace (VERSION , NEXT_VERSION ) for line in f ]
78+ b_version = VERSION .encode ('ascii' )
79+ b_next_version = NEXT_VERSION .encode ('ascii' )
80+ lines = [line .replace (b_version , b_next_version ) for line in f ]
7981 with open (filename , 'wb' ) as f :
8082 f .writelines (lines )
8183
@@ -86,35 +88,29 @@ def tag_release():
8688 """
8789 subprocess .check_call (['hg' , 'tag' , NEXT_VERSION ])
8890
89- dist_commands = [
90- [sys .executable , 'setup.py' , 'sdist' , '--format=zip' ],
91- [sys .executable , 'setup.py' , 'sdist' , '--format=gztar' ],
92- [sys .executable , 'setup.py' , 'bdist_wininst' ],
93- [sys .executable , 'setup.py' , 'bdist_wheel' ],
94- ]
91+ dist_commands = ['sdist' , 'bdist_wininst' , 'bdist_wheel' ]
9592
9693
9794def build ():
9895 if os .path .isfile ('MANIFEST' ):
9996 os .remove ('MANIFEST' )
10097 if os .path .isdir ('dist' ):
10198 shutil .rmtree ('dist' )
102- list ( map ( subprocess .check_call , dist_commands ) )
99+ subprocess .check_call ([ sys . executable , 'setup.py' ] + dist_commands )
103100
104101
105102def push ():
106103 "The build went well, so let's push the SCM changesets"
107- subprocess .check_call (['hg' , 'push' ])
104+ subprocess .check_call (['hg' , 'push' , '-r' , '.' ])
108105
109106
110107def publish ():
111108 """
112109 Publish the dists on PyPI
113110 """
114111 try :
115- upload_dist_commands = [cmd + ['register' , 'upload' ]
116- for cmd in dist_commands ]
117- list (map (subprocess .check_call , upload_dist_commands ))
112+ upload_dist_command = [sys .executable , 'setup.py' ] + dist_commands + ['register' , 'upload' ]
113+ subprocess .check_call (upload_dist_command )
118114 except :
119115 print ("Unable to upload the dist files. Ask in IRC for help access 57"
120116 "or assistance." )
0 commit comments