35 lines
752 B
Makefile
35 lines
752 B
Makefile
-include .env
|
|
export
|
|
|
|
VENV := .venv
|
|
UVICORN := $(VENV)/bin/uvicorn
|
|
TEST_DEPS := $(VENV)/.test-deps
|
|
|
|
.PHONY: clean run run-local tailwind test venv
|
|
|
|
venv: $(UVICORN)
|
|
|
|
$(UVICORN): requirements.txt
|
|
python3 -m venv $(VENV)
|
|
$(VENV)/bin/pip install --upgrade pip
|
|
$(VENV)/bin/pip install -r requirements.txt
|
|
|
|
clean:
|
|
rm -rf __pycache__ app/__pycache__
|
|
|
|
run: venv
|
|
$(UVICORN) app.main:app --host 0.0.0.0 --port 4000 --reload
|
|
|
|
run-local: venv
|
|
BTCDATA_URL=$(BTCDATA_LOCAL_URL) $(UVICORN) app.main:app --host 0.0.0.0 --port 4000 --reload
|
|
|
|
tailwind:
|
|
npm run css:watch
|
|
|
|
$(TEST_DEPS): requirements-dev.txt requirements.txt | venv
|
|
$(VENV)/bin/pip install -r requirements-dev.txt
|
|
touch $(TEST_DEPS)
|
|
|
|
test: venv $(TEST_DEPS)
|
|
$(VENV)/bin/python -m pytest tests/
|