1818ROBOTIDE_PACKAGE = ROOT_DIR / 'src' / 'robotide'
1919MANIFEST = ROOT_DIR / 'MANIFEST.in'
2020
21- VERSION = open (ROOT_DIR / 'VERSION.txt' ).read ().strip ()
22- FINAL_RELEASE = bool (re .match ('^(\d*\.){1,2}\d*$' , VERSION ))
23-
2421TEST_PROJECT_DIR = 'theproject'
2522TEST_LIBS_GENERATED = 10
23+ # Set VERSION global variable
24+ execfile ('src/robotide/version.py' )
25+ FINAL_RELEASE = bool (re .match ('^(\d*\.){1,2}\d*$' , VERSION ))
2626
2727
2828def find_packages (where ):
@@ -172,12 +172,16 @@ def register():
172172@task
173173@consume_args
174174def set_version (args ):
175- with open ('VERSION.txt' , 'w' ) as version_file :
176- version_file .write (args [0 ])
175+ version = args [0 ]
176+ with (path (ROBOTIDE_PACKAGE )/ 'version.py' ).open ('w' ) as version_file :
177+ version_file .write ("""# Automatically generated by `pavement.py`.
178+ VERSION = '%s'
179+ """ % version )
180+ _log ('Set version to %s' % version )
177181
178182
179183@task
180- @needs ('clean' , '_prepare_build' , ' release_notes_plugin' , 'generate_setup' ,
184+ @needs ('clean' , 'release_notes_plugin' , 'generate_setup' ,
181185 'minilib' , 'setuptools.command.sdist' )
182186def sdist ():
183187 """Creates source distribution with bundled dependencies"""
@@ -198,11 +202,6 @@ def _windows():
198202 sys .exit ('Windows installers may only be created in Windows' )
199203
200204
201- @task
202- def _prepare_build ():
203- _update_version ()
204-
205-
206205@task
207206def release_notes_plugin ():
208207 changes = _download_and_format_issues ()
@@ -215,6 +214,7 @@ def clean():
215214
216215
217216def _clean (keep_dist = False ):
217+ _remove_bytecode_files ()
218218 if not keep_dist and DIST_DIR .exists ():
219219 DIST_DIR .rmtree ()
220220 if BUILD_DIR .exists ():
@@ -240,14 +240,6 @@ def _run_nose(args):
240240 argv = ['' , '--m=^test_' ] + args )
241241
242242
243- def _update_version ():
244- _log ('Using version %s from VERSION.txt' % VERSION )
245- with (path (ROBOTIDE_PACKAGE )/ 'version.py' ).open ('w' ) as version_file :
246- version_file .write ("""# Automatically generated by `pavement.py`.
247- VERSION = '%s'
248- """ % VERSION )
249-
250-
251243def _set_development_path ():
252244 sys .path .insert (0 , SOURCE_DIR )
253245
0 commit comments