-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (36 loc) · 1.17 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
SOURCEPATH := $(PWD)/cloud
VIRTUALENV := $(PWD)/.venv
export PATH := $(VIRTUALENV)/bin:$(PATH)
# Fix Make < 3.81 (macOS and old Linux distros)
ifeq ($(filter undefine,$(value .FEATURES)),)
SHELL = env PATH="$(PATH)" /bin/bash
endif
.PHONY: .venv
build:
python3 -m build
twine check dist/*
.venv:
python3 -m venv $(VIRTUALENV)
pip install --upgrade pip
install-code-ext:
if which code >/dev/null 2>&1; then code --install-extension ms-python.python --force; fi
if which code >/dev/null 2>&1; then code --install-extension charliermarsh.ruff --force; fi
install-hook:
echo "make lint" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
install-dev: .venv install-hook install-code-ext
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
lint:
ruff check
ruff format --check
format:
ruff check --select I --fix
ruff format
test:
coverage run --source=$(SOURCEPATH) --omit=dependencies -m unittest
coverage: test .coverage
coverage report -m --fail-under=100
clean:
rm -rf .mypy_cache .pytest_cache .ruff_cache .coverage* coverage.* *.egg-info dist
find $(SOURCEPATH) -name __pycache__ | xargs rm -rf
find tests -name __pycache__ | xargs rm -rf