diff --git a/manage.py b/ara/server/__main__.py old mode 100755 new mode 100644 similarity index 93% rename from manage.py rename to ara/server/__main__.py index 823a558..9c44113 --- a/manage.py +++ b/ara/server/__main__.py @@ -2,7 +2,8 @@ import os import sys -if __name__ == "__main__": + +def main(): from ara import server os.environ.setdefault("ARA_CFG", os.path.dirname(server.__file__) + "/configs/dev.cfg") @@ -11,3 +12,7 @@ if __name__ == "__main__": from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) + + +if __name__ == "__main__": + main() diff --git a/setup.cfg b/setup.cfg index 7eb8aaf..6b20cfa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,6 +29,10 @@ setup-hooks = packages = ara +[entry_points] +console_scripts = + ara-manage = ara.server.__main__:main + [build_sphinx] source-dir = doc/source build-dir = doc/build diff --git a/tox.ini b/tox.ini index 5dd473d..28d8c61 100644 --- a/tox.ini +++ b/tox.ini @@ -21,15 +21,15 @@ commands = sphinx-build -W -b html doc/source doc/build/html commands = {toxinidir}/tests/linters.sh [testenv:py3] -commands = python manage.py test ara +commands = ara-manage test ara setenv = ARA_CFG={toxinidir}/ara/server/configs/test.cfg [testenv:runserver] commands = - python manage.py migrate - python manage.py collectstatic --clear --no-input - python manage.py runserver + ara-manage migrate + ara-manage collectstatic --clear --no-input + ara-manage runserver # Temporary venv to help bootstrap integration [testenv:ansible-integration] @@ -49,6 +49,6 @@ whitelist_externals = [testenv:cover] commands = coverage erase - coverage run {toxinidir}/manage.py test ara/server - coverage run -a {toxinidir}/manage.py test ara/api + coverage run {toxinidir}/ara/server/__main__.py test ara/server + coverage run -a {toxinidir}/ara/server/__main__.py test ara/api coverage html