-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
97 lines (79 loc) · 1.73 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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# !make
# -*- coding: utf-8 -*-
# Copyright (C) 2024
# Benjamin Thomas Schwertfeger https://github.com/btschwertfeger
# Leonhard Thomas Schwertfeger https://github.com/LeonhardSchwertfeger
#
# Minimal Makefile for Sphinx documentation
##
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = doc
BUILDDIR = build
VENV := venv
PYTHON := $(VENV)/bin/python
TESTS := tests
PYTEST_OPTS := -vv
.PHONY: help
help:
@grep "^##" Makefile | sed -e "s/##//"
## build Builds the package
##
.PHONY: build
build:
$(PYTHON) -m pip wheel -w dist --no-deps .
## dev Installs the full package in edit mode
##
.PHONY: dev
dev:
@git lfs install
$(PYTHON) -m pip install -e ".[dev,test]"
## test Run the unit tests
##
.PHONY: test
test:
$(PYTHON) -m pytest $(PYTEST_OPTS) $(TESTS)
.PHONY: tests
tests: test
## retest Run only the tests that failed last time
##
.PHONY: retest
retest:
$(PYTHON) -m pytest $(PYTEST_OPTS) --lf $(TESTS)
## wip Run tests marked as wip
##
.PHONY: wip
wip:
$(PYTHON) -m pytest $(PYTEST_OPTS) -m "wip" $(TESTS)
## pre-commit Pre-Commit
##
.PHONY: pre-commit
pre-commit:
@pre-commit run -a
## ruff Run ruff without fix
##
.PHONY: ruff
ruff:
ruff check --preview .
## ruff-fix Run ruff with fix
##
.PHONY: ruff-fix
ruff-fix:
ruff check --fix --preview .
## clean Clean the workspace
##
.PHONY: clean
clean:
rm -rf .cache \
build/ dist/ genai_pod.egg-info \
.ipynb_checkpoints
rm -f .coverage cmethods/_version.py
find tests -name "__pycache__" | xargs rm -rf
find genai_pod -name "__pycache__" | xargs rm -rf
# Build the documentation
##
html:
$(SPHINXBUILD) -b html $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS)
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
clean-docs:
rm -rf $(BUILDDIR)