-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (37 loc) · 1.12 KB
/
Copy pathMakefile
File metadata and controls
44 lines (37 loc) · 1.12 KB
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
PIPENV = PIPENV_IGNORE_VIRTUALENVS=1 pipenv
PIPENV_SAFE_RUN = PIPENV_DONT_LOAD_ENV=1 $(PIPENV) run
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help
@grep -E '^\S+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'
.PHONY: setup
setup: .venv/lib ## Install virtualenv dependencies
@echo "✅ Setup it's done"
.PHONY: tests
tests: ## Locally run tests
$(PIPENV) clean
$(PIPENV_SAFE_RUN) pytest --verbose
.PHONY: lint
lint: ## Lint the project files
@echo "🌑 Formatting with black"
@$(PIPENV) run black ./src
@echo "🕵 Check for errors with flake8"
@$(PIPENV) run flake8 ./
@echo "😋 Running isort"
@$(PIPENV) run isort --atomic .
.PHONY: clean
clean: ## Removed venv files
rm -rf .venv
$(PIPENV) --rm || true
$(PIPENV) --rm || true # two virtualenvs may exists, the local at .venv and the one at ~/.virtualenvs/
.ONESHELL:
.venv/lib: Pipfile.lock
pip install -U pipenv==v2022.9.24
$(PIPENV) clean
mkdir -p .venv
$(PIPENV) install --dev --no-site-packages
test -d .venv/lib && touch .venv/lib
.ONESHELL:
Pipfile.lock: Pipfile
$(PIPENV) lock