-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (66 loc) · 1.91 KB
/
Copy pathMakefile
File metadata and controls
81 lines (66 loc) · 1.91 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
69
70
71
72
73
74
75
76
77
78
79
80
81
.PHONY: help
help:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
.PHONY: clean
clean: ## remove python cache files
find . -name '__pycache__' | xargs rm -rf
find . -name '*.pyc' -delete
rm -rf build
rm -rf dist
rm -rf *.egg-info
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf .coverage
.PHONY: docs
docs: ## build documentation
cp docs/index.md readme.md
@uv run mkdocs build
.PHONY: docs-publish
docs-publish: ## publish the book to github pages
uv run mkdocs gh-deploy
.PHONY: docs-serve
docs-serve: ## serve documentation
@uv run mkdocs serve --livereload -w fluid -w docs -w examples
.PHONY: example
example: ## run task scheduler example
@APP_NAME=examples uv run python -m examples.main serve
.PHONY: install
install: ## install all packages via uv
@./.dev/install
.PHONY: lint
lint: ## run linters
uv run ./.dev/lint fix
.PHONY: lint-test
lint-test: ## run test linters
uv run ./.dev/lint
.PHONY: outdated
outdated: ## Show outdated packages
uv tree --outdated
.PHONY: publish
publish: ## release to pypi
@uv build && uv publish --token $(PYPI_TOKEN)
.PHONY: readme
readme: ## generate readme.md
cp docs/index.md readme.md
.PHONY: release
release: ## tag current version (from pyproject.toml) and push
$(eval VERSION := $(shell grep '^version' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/'))
@read -p "Tagging with v$(VERSION), are you sure? [Y/n] " ans; \
ans=$${ans:-Y}; \
if [ "$$ans" = "Y" ] || [ "$$ans" = "y" ]; then \
git tag -a v$(VERSION) -m "v$(VERSION)" && git push origin v$(VERSION); \
else \
echo "Aborted."; \
fi
.PHONY: taplo-fmt
taplo-fmt: ## format toml files with taplo
taplo fmt
.PHONY: test
test: ## test with coverage
@uv run \
pytest -x --log-cli-level error \
-m "not flaky" \
--cov --cov-report xml --cov-report html
.PHONY: upgrade
upgrade: ## upgrade all packages via uv
uv lock --upgrade