-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-poetry
38 lines (30 loc) · 1.23 KB
/
Makefile-poetry
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
# poetry: https://python-poetry.org/docs/
POETRY := poetry
REQUIREMENTS := requirements.txt
REQUIREMENTS_DEV := requirements-dev.txt
.PHONY: clean-env
clean-env: remove-env install ## Manage Poetry environment
.PHONY: install
install: ## Install all dependencies
$(POETRY) install
.PHONY: remove-env
remove-env: ## Remove Poetry environment
$(POETRY) env remove --all
rm -f poetry.lock
.PHONY: requirements-all
requirements: requirements-main requirements-dev ## Generate requirements files
.PHONY: requirements-dev
requirements-dev: ## Generate requirements-dev.txt file for development dependencies.
$(POETRY) export -f requirements.txt --output $(REQUIREMENTS_DEV) --without-hashes --with dev,docs,test
.PHONY: requirements-main
requirements-main: ## Generate requirements.txt file for main dependencies.
$(POETRY) export -f requirements.txt --output $(REQUIREMENTS) --without-hashes
.PHONY: help
help: ## Display this help
@echo ""
@echo "Usage: make [target]"
@echo ""
@awk 'BEGIN {FS = ":.*?## "; printf "\033[1m%-20s %-50s\033[0m\n", "Target", "Description"; \
printf "%-20s %-50s\n", "------", "-----------";} \
/^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %-50s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ""