diff --git a/senpy/__init__.py b/senpy/__init__.py index 5a89b74..3bede81 100644 --- a/senpy/__init__.py +++ b/senpy/__init__.py @@ -17,3 +17,5 @@ """ Sentiment analysis server in Python """ + +__version__ = "0.5.4" diff --git a/senpy/__main__.py b/senpy/__main__.py index e266d00..8636be6 100644 --- a/senpy/__main__.py +++ b/senpy/__main__.py @@ -28,19 +28,20 @@ import gevent import logging import os import argparse +import senpy patch_all(thread=False) def main(): parser = argparse.ArgumentParser(description='Run a Senpy server') parser.add_argument('--level', - "-l", - metavar="logging_level", + '-l', + metavar='logging_level', type=str, default="INFO", help='Logging level') parser.add_argument('--debug', - "-d", + '-d', action='store_true', default=False, help='Run the application in debug mode') @@ -60,7 +61,7 @@ def main(): parser.add_argument('--plugins-folder', '-f', type=str, - default="plugins", + default='plugins', help='Where to look for plugins.') args = parser.parse_args() logging.basicConfig() @@ -72,12 +73,13 @@ def main(): sp.activate_all() http_server = WSGIServer((args.host, args.port), app) try: - print("Server running on port %s:%d. Ctrl+C to quit" % (args.host, + print('Senpy version {}'.format(senpy.__version__)) + print('Server running on port %s:%d. Ctrl+C to quit' % (args.host, args.port)) http_server.serve_forever() except KeyboardInterrupt: http_server.stop() - print("Bye!") + print('Bye!') if __name__ == '__main__': main() diff --git a/setup.py b/setup.py index 65653f4..2cc4b1c 100644 --- a/setup.py +++ b/setup.py @@ -15,12 +15,12 @@ except AttributeError: install_reqs = [str(ir.req) for ir in install_reqs] test_reqs = [str(ir.req) for ir in test_reqs] -VERSION = "0.5.4" +exec(open('senpy/__init__.py').read()) setup( name='senpy', packages=['senpy'], # this must be the same as the name above - version=VERSION, + version=__version__, description=''' A sentiment analysis server implementation. Designed to be \ extendable, so new algorithms and sources can be used. @@ -28,8 +28,7 @@ extendable, so new algorithms and sources can be used. author='J. Fernando Sanchez', author_email='balkian@gmail.com', url='https://github.com/gsi-upm/senpy', # use the URL to the github repo - download_url='https://github.com/gsi-upm/senpy/archive/{}.tar.gz' - .format(VERSION), + download_url='https://github.com/gsi-upm/senpy/archive/{}.tar.gz' .format(__version__), keywords=['eurosentiment', 'sentiment', 'emotions', 'nif'], classifiers=[], install_requires=install_reqs,