1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
##
# Makefile para Baobaxia API
#
# @file
# @version 0.1
# Virtualenv settings
VENV := venv-bbx
VENV_PATH = $(VENV)/bin
VENV_ACTIVATE = . $(VENV_PATH)/activate
# Python settings
PYTHON = $(VENV_PATH)/python3
PIP = $(VENV_PATH)/pip
ENV := dev
SRC_DIR = baobaxia
# Targets
.PHONY: install setup run clean
# Target padrão
default: help
poetry-sinc: pyproject.toml poetry.lock
poetry install
$(VENV)/.created:
@echo "configurando ambiente virtual"
python3 -m venv $(VENV)
$(PIP) install -r requirements/$(ENV).txt
touch $(VENV)/.created
# Target: instala pacotes debian
# TODO não testado
debdeps:
@echo "certifique-se que seu sistema é baseado em debian para continuar"
sudo apt update
sudo apt install -y git-annex-standalone virtualenv python3-pip
# Target: instala pacotes archlinux
# TODO não testado
archdeps:
@echo "certifique-se que seu sistema é baseado em archlinux para continuar"
pacman -S python-virtualenv git-annex
# TODO Target: Executa os testes
test:
@echo "TODO: executar os testes"
# TODO Target: Executa a instalação
install:
poetry run python -c "from baobaxia.install import install_interactive;install_interactive()"
# Target: Executa a aplicação
run:
poetry run uvicorn $(SRC_DIR).main:app --host 0.0.0.0 --port 8000 --reload
# Target: Limpa o ambiente
clean:
rm -rf $(VENV)
find . -type f -name '*.pyc' -delete
# Target: Help - lista os targets disponíveis
help: $(VENV)/.created
@echo "Targets Disponíveis:"
@echo " debdeps - TODO Instala dependencias no Debian"
@echo " archdeps - TODO Instala dependencias no Archlinux"
@echo " install - Instala o ambiente para o Baobáxia"
@echo " run - Executa a aplicação"
@echo " clean - Limpa o ambiente"
@echo " help - Exibe este help"