chore: update project structure and add testing framework
This commit is contained in:
51
Makefile
51
Makefile
@@ -1,42 +1,42 @@
|
||||
.PHONY: migrate init revision upgrade downgrade run seed-admin seed-client seed-agents seed-mcp-servers seed-tools seed-contacts seed-all docker-build docker-up docker-down docker-logs
|
||||
.PHONY: migrate init revision upgrade downgrade run seed-admin seed-client seed-agents seed-mcp-servers seed-tools seed-contacts seed-all docker-build docker-up docker-down docker-logs lint format install install-dev venv
|
||||
|
||||
# Comandos do Alembic
|
||||
# Alembic commands
|
||||
init:
|
||||
alembic init alembics
|
||||
|
||||
# make alembic-revision message="descrição da migração"
|
||||
# make alembic-revision message="migration description"
|
||||
alembic-revision:
|
||||
alembic revision --autogenerate -m "$(message)"
|
||||
|
||||
# Comando para atualizar o banco de dados
|
||||
# Command to update database to latest version
|
||||
alembic-upgrade:
|
||||
alembic upgrade head
|
||||
|
||||
# Comando para voltar uma versão
|
||||
# Command to downgrade one version
|
||||
alembic-downgrade:
|
||||
alembic downgrade -1
|
||||
|
||||
# Comando para rodar o servidor
|
||||
# Command to run the server
|
||||
run:
|
||||
uvicorn src.main:app --reload --host 0.0.0.0 --port 8000 --reload-dir src
|
||||
|
||||
# Comando para limpar o cache em todas as pastas do projeto pastas pycache
|
||||
# Command to run the server in production mode
|
||||
run-prod:
|
||||
uvicorn src.main:app --host 0.0.0.0 --port 8000 --workers 4
|
||||
|
||||
# Command to clean cache in all project folders
|
||||
clear-cache:
|
||||
rm -rf ~/.cache/uv/environments-v2/* && find . -type d -name "__pycache__" -exec rm -r {} +
|
||||
|
||||
# Comando para criar uma nova migração
|
||||
# Command to create a new migration and apply it
|
||||
alembic-migrate:
|
||||
alembic revision --autogenerate -m "$(message)" && alembic upgrade head
|
||||
|
||||
# Comando para resetar o banco de dados
|
||||
# Command to reset the database
|
||||
alembic-reset:
|
||||
alembic downgrade base && alembic upgrade head
|
||||
|
||||
# Comando para forçar upgrade com CASCADE
|
||||
alembic-upgrade-cascade:
|
||||
psql -U postgres -d a2a_saas -c "DROP TABLE IF EXISTS events CASCADE; DROP TABLE IF EXISTS sessions CASCADE; DROP TABLE IF EXISTS user_states CASCADE; DROP TABLE IF EXISTS app_states CASCADE;" && alembic upgrade head
|
||||
|
||||
# Comandos para executar seeders
|
||||
|
||||
# Commands to run seeders
|
||||
seed-admin:
|
||||
python -m scripts.seeders.admin_seeder
|
||||
|
||||
@@ -58,7 +58,7 @@ seed-contacts:
|
||||
seed-all:
|
||||
python -m scripts.run_seeders
|
||||
|
||||
# Comandos Docker
|
||||
# Docker commands
|
||||
docker-build:
|
||||
docker-compose build
|
||||
|
||||
@@ -72,4 +72,21 @@ docker-logs:
|
||||
docker-compose logs -f
|
||||
|
||||
docker-seed:
|
||||
docker-compose exec api python -m scripts.run_seeders
|
||||
docker-compose exec api python -m scripts.run_seeders
|
||||
|
||||
# Testing, linting and formatting commands
|
||||
lint:
|
||||
flake8 src/ tests/
|
||||
|
||||
format:
|
||||
black src/ tests/
|
||||
|
||||
# Virtual environment and installation commands
|
||||
venv:
|
||||
python -m venv venv
|
||||
|
||||
install:
|
||||
pip install -e .
|
||||
|
||||
install-dev:
|
||||
pip install -e ".[dev]"
|
||||
Reference in New Issue
Block a user