/
Makefile
89 lines (56 loc) · 1.99 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
DOCKER_COMPOSE_RUN = USER_ID=$$(id -u) docker compose --file docker/docker-compose.yml run --rm --build glue-utils
.PHONY: all
all: ## Show help (default)
@echo "=== Glue Utils ==="
@echo
@echo "Available commands:"
@grep --extended-regexp '^[ /.a-zA-Z0-9_-]+:.*?## .*$$' Makefile | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: install
install: clean ## Create virtualenv and install dependencies
@poetry install --sync
.PHONY: outdated
outdated: ## Check for outdated dependencies
@poetry show --latest --outdated
docker/requirements.txt: poetry.lock
@poetry export --with=dev --output docker/requirements.txt
.PHONY: format
format: ## Format project source code
@poetry run ruff check . --fix
@poetry run ruff format .
.PHONY: lint
lint: ## Check source code for common errors
@poetry run ruff format . --check
@poetry run ruff check .
.PHONY: typecheck
typecheck: ## Check type annotations
@MYPYPATH=src poetry run mypy .
.PHONY: importcheck
importcheck: ## Check import rules
@poetry run lint-imports
.PHONY: test
test: docker/requirements.txt ## Run automated tests
@$(DOCKER_COMPOSE_RUN) -c pytest
.PHONY: shell
shell: docker/requirements.txt ## Enter a shell in the container
@$(DOCKER_COMPOSE_RUN) -c bash
.PHONY: checks
checks: format typecheck importcheck test
.PHONY: clean
clean: ## Delete generated artifacts
@rm -rf __pycache__ .coverage .mypy_cache .pytest_cache .ruff_cache dist htmlcov
.PHONY: publish
publish: ## Publish package to PyPI
@poetry publish --build
.PHONY: bumpver-rc
bumpver-rc: ## Bump release candidate
@poetry run bumpver update --no-fetch --tag=rc --tag-num
.PHONY: bumpver-patch
bumpver-patch: ## Bump patch version
@poetry run bumpver update --no-fetch --patch --tag=final
.PHONY: bumpver-minor
bumpver-minor: ## Bump minor version
@poetry run bumpver update --no-fetch --minor --tag=final
.PHONY: bumpver-major
bumpver-major: ## Bump major version
@poetry run bumpver update --no-fetch --major --tag=final