-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (46 loc) · 1.11 KB
/
Makefile
File metadata and controls
55 lines (46 loc) · 1.11 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
checkfiles = src/ tests/
help:
@echo "FindPython development makefile"
@echo
@echo "Usage: make <target>"
@echo "Targets:"
@echo " up Updates dev/test dependencies"
@echo " deps Ensure dev/test dependencies are installed"
@echo " check Checks that build is sane"
@echo " test Runs all tests"
@echo " style Auto-formats the code"
@echo " lint Auto-formats the code and check type hints"
up:
pdm update --verbose
deps:
ifeq ($(wildcard .venv),)
pdm install --verbose
else
pdm install
endif
_check:
pdm run ruff format --check $(checkfiles)
pdm run ruff check $(checkfiles)
pdm run mypy $(checkfiles)
check: deps _build _check
_style:
pdm run ruff format $(checkfiles)
pdm run ruff check --fix $(checkfiles)
style: deps _style
_lint:
pdm run ruff format $(checkfiles)
pdm run ruff check --fix $(checkfiles)
pdm run mypy $(checkfiles)
lint: deps _build _lint
_test:
pdm run pytest -s tests
test: deps _test
_build:
rm -fR dist/
pdm build
build: deps _build
# Usage::
# make venv version=3.12
venv:
pdm venv create $(version)
pdm run pip install --upgrade pip