forked from karlamagueta/parkencantado
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (33 loc) · 1.19 KB
/
Makefile
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
.ONESHELL:
ENV_PREFIX=$(shell python -c "if __import__('pathlib').Path('.venv/bin/pip').exists(): print('.venv/bin/')")
.PHONY: help
help: ## Show the help.
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@grep -F "##" Makefile | grep -F -v grep -F
.PHONY: show
show: ## Show the current environment.
@echo "Current environment:"
@echo "Running using $(ENV_PREFIX)"
@$(ENV_PREFIX)python -V
@$(ENV_PREFIX)python -m site
.PHONY: virtualenv
virtualenv: ## Create a virtual environment.
@echo "creating virtualenv ..."
@rm -rf .venv
@python3 -m venv .venv
@./.venv/bin/pip install -U pip
@./.venv/bin/pip install -r requirements.txt
@echo
@echo "!!! Please run 'source .venv/bin/activate' to enable the environment !!!"
.PHONY: install
install: ## Install the project in dev mode.
@echo "Don't forget to run 'make virtualenv' if you got errors."
$(ENV_PREFIX)pip install -r requirements.txt
.PHONY: run
run: ## Run the website
$(ENV_PREFIX)uvicorn app.main:app --reload --reload-include *.html --reload-include *.css --reload-include *.js --reload-include *.toml
.PHONY: test
test: ## Run the tests
@.venv/bin/pytest -vv