-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (30 loc) · 1.06 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
project_name := whylogs_container_types
src := $(shell find $(project_name)/ -name "*.py" -type f)
.PHONY: dist build publish lint test lint-fix format format-fix fix help clean
dist: build
install: ## Install dependencies
poetry install
clean: ## Clean up build artifacts
rm -rf dist
build: $(src)
poetry build
publish: build
poetry publish
test: ## Run unit tests
poetry run pytest
lint: ## Check for type issues with pyright
@{ echo "Running pyright\n"; poetry run pyright; PYRIGHT_EXIT_CODE=$$?; } ; \
{ echo "\nRunning ruff check\n"; poetry run ruff check; RUFF_EXIT_CODE=$$?; } ; \
exit $$(($$PYRIGHT_EXIT_CODE + $$RUFF_EXIT_CODE))
lint-fix:
poetry run ruff check --fix
format: ## Check for formatting issues
poetry run ruff format --check
format-fix: ## Fix formatting issues
poetry run ruff format
fix: lint-fix format-fix ## Fix all linting and formatting issues
help: ## Show this help message.
@echo 'usage: make [target] ...'
@echo
@echo 'targets:'
@egrep '^(.+)\:(.*) ##\ (.+)' ${MAKEFILE_LIST} | sed -s 's/:\(.*\)##/: ##/' | column -t -c 2 -s ':#'