Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (43 loc) · 1.57 KB
/
Copy pathMakefile
File metadata and controls
56 lines (43 loc) · 1.57 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
45
46
47
48
49
50
51
52
53
54
55
56
PACKAGE := python_anvil
.PHONY: all
all: install
.PHONY: install
install: ## Install the package and its dev dependencies into .venv
poetry install --all-extras
.PHONY: format
format: install ## Format the code and fix what the linter can
poetry run ruff format .
poetry run ruff check --fix .
.PHONY: lint
lint: install ## Check formatting, lint, and type-check
poetry run ruff format --check .
poetry run ruff check .
poetry run mypy
.PHONY: test
test: install ## Run the unit tests with coverage
poetry run pytest --cov --cov-report=term-missing:skip-covered
.PHONY: ci
ci: lint test ## Everything CI runs
.PHONY: test-client
test-client: install ## Run every method against a real environment (staging by default)
poetry run python test-client.py
.PHONY: update-schema
update-schema: install ## Refresh schema/ from the published @anvilco/types and the API's OpenAPI spec
poetry run python dev/fetch_schema.py
.PHONY: generate
generate: install ## Regenerate python_anvil/types from schema/
poetry run python dev/generate_types.py
.PHONY: check-generated
check-generated: generate ## Fail if python_anvil/types is out of date with schema/
git diff --exit-code -- python_anvil/types
.PHONY: build
build: install ## Build the sdist and wheel into dist/
rm -rf dist
poetry build
.PHONY: clean
clean: ## Delete generated and temporary files
rm -rf dist .cache .coverage htmlcov
find $(PACKAGE) tests -name '__pycache__' -exec rm -rf {} +
.PHONY: help
help:
@ grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-10s %s\n", $$1, $$2}'