Merge "Move manage.py to ara.server.__main__ and add an entry point"

This commit is contained in:
Zuul 2018-12-13 18:46:19 +00:00 committed by Gerrit Code Review
commit b93cf0d33d
3 changed files with 16 additions and 7 deletions

7
manage.py → ara/server/__main__.py Executable file → Normal file
View File

@ -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()

View File

@ -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

12
tox.ini
View File

@ -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