API of Som Energia UI-QMako tool.
UI-QMako allows for a user friendly editing of Mako Templates.
Python 3.8.8
- Git.
- Python 3, pip and poetry.
- Clone project from repo
git clone git@github.com:Som-Energia/uiqmako-api.git
- Setup poetry environment Python
cd uiqmako-api
poetry install
- Create local configuration
cp .env.example .env
# Review and edit .env
- Create database
# If you didn't do that before for your user, here 'myuser'
sudo su postgres
createuser myuser
echo "ALTER USER myuser CREATEDB" > psql
exit
# and then
createdb uiqmako_db
- Run development server
poetry run uvicorn uiqmako_api.api.api:app --debug
The API will run on: http://localhost:8000
Open http://localhost:8000/docs or http://localhost:8000/redoc to see the API docs.
- Run tests and coverage
createdb test_uiqmako
cp tests/.env.test.example tests/.env.test
# Review and edit test/.env.test
poetry run pytest -v --cov=uiqmako_api
Some infrastructure tests that access private servers are disabled by default until
you enable them using env var UIQMAKO_TEST_ERP
.
UIQMAKO_TEST_ERP=1 poetry run pytest -v --cov=uiqmako_api