-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (55 loc) · 1.64 KB
/
Copy pathMakefile
File metadata and controls
68 lines (55 loc) · 1.64 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
57
58
59
60
61
62
63
64
65
66
67
68
# Env
export PYTHONDONTWRITEBYTECODE=1
TEST_PATH=./tests
UV_PYTHON_FLAG=$(if $(PY),--python $(PY),)
# Func
.PHONY: help install init test coverage build check publish docs clean clean-pyc clean-build
help:
@echo "\033[32minstall\033[0m"
@echo " Install dependencies with uv."
@echo "\033[32minit\033[0m"
@echo " Init environment for pydu."
@echo "\033[32mtest\033[0m"
@echo " Run pytest."
@echo "\033[32mcoverage\033[0m"
@echo " Run pytest and report coverage."
@echo "\033[32mbuild\033[0m"
@echo " Build distributions."
@echo "\033[32mcheck\033[0m"
@echo " Check built distributions."
@echo "\033[32mpublish\033[0m"
@echo " Publish pydu to PyPI."
@echo "\033[32mdocs\033[0m"
@echo " Make docs for pydu."
@echo "\033[32mclean\033[0m"
@echo " Remove python and build artifacts."
@echo "\033[32mclean-pyc\033[0m"
@echo " Remove python artifacts."
@echo "\033[32mclean-build\033[0m"
@echo " Remove build artifacts."
install:
uv sync $(UV_PYTHON_FLAG) --group dev
init:
$(MAKE) install
npm i docsify-cli -g
test: clean-pyc
uv run $(UV_PYTHON_FLAG) pytest --color=yes $(TEST_PATH)
coverage:
uv run $(UV_PYTHON_FLAG) coverage run --source=pydu -m pytest tests
uv run $(UV_PYTHON_FLAG) coverage report
build: clean-build
uv build $(UV_PYTHON_FLAG)
check:
uv run $(UV_PYTHON_FLAG) --group publish twine check dist/*
publish:
uv publish
docs:
docsify serve docs
clean: clean-pyc clean-build
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
clean-build:
rm -rf build dist *.egg-info .eggs