refactor: DRY version#75
Conversation
| app.logger.debug('Detected who command {!r}'.format(message.text)) | ||
| about_text = ( | ||
| 'TululBot v1.11.2\n\n' | ||
| 'TululBot {!r}\n\n' |
|
|
||
| expected_text = ( | ||
| 'TululBot v1.11.2\n\n' | ||
| 'TululBot {!r}\n\n' |
| VERSION = '1.11.3' | ||
|
|
||
|
|
||
| def version_formatted(): |
There was a problem hiding this comment.
Since you can import VERSION directly, this function is not really needed isn't it? At this point, the function only preprends v to the version number. Also, this variable might be best put under tululbot/__init__.py file so that it can be imported like from tululbot import VERSION.
There was a problem hiding this comment.
I didn't know we can import a constant. Thanks
|
Hey team i tried to change to what @kmkurn suggest, but the build was failed https://travis-ci.org/tulul/tululbot/builds/256555060. Can somebody help me and point out where is the mistake? Previous build worked (when use standalone VERSION file). |
|
@wazaundtechnik Sorry I think that's probably because of circular import or sth. I'm not sure either because I don't check myself. What if you put |
Do not hard code version into commands. Put it into separate file and let another module calls that command to retrieve version information.