-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
108 lines (91 loc) · 1.97 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
98
99
100
101
102
103
104
105
106
107
108
#!make
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# GitHub: https://github.com/btschwertfeger
#
VENV := venv
PYTHON := python
TESTS := tests
PYTEST_OPTS := -vv
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
.PHONY: help
help:
@grep "^##" Makefile | sed -e "s/##//"
## build Builds python-cmethods
##
.PHONY: build
build:
$(PYTHON) -m build .
## dev Installs the package in edit mode
##
.PHONY: dev
dev:
@git lfs install
$(PYTHON) -m pip install -e ".[dev,test,jupyter,examples]"
## install Install the package
##
.PHONY: install
install:
$(PYTHON) -m pip install .
## test Run the unit tests
##
.PHONY: test
test:
$(PYTHON) -m pytest $(PYTEST_OPTS) $(TESTS)
.PHONY: tests
tests: test
## wip Run tests marked as wip
##
.PHONY: wip
wip:
$(PYTHON) -m pytest $(PYTEST_OPTS) -m "wip" $(TESTS)
## doc Build the documentation
##
.PHONY: doc
doc:
cd doc && make html
## doctest Run the documentation tests
##
.PHONY: doctest
doctest:
cd doc && make doctest
## 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 .
ruff format .
## changelog Create the changelog
##
.PHONY: changelog
changelog:
docker run -it --rm \
-v $(ROOT_DIR):/usr/local/src/your-app/ \
githubchangeloggenerator/github-changelog-generator \
-u btschwertfeger \
-p python-cmethods \
-t $(GHTOKEN) \
--breaking-labels Breaking \
--enhancement-labels Feature
## clean Clean the workspace
##
.PHONY: clean
clean:
rm -rf .mypy_cache .pytest_cache .cache \
build/ dist/ python_cmethods.egg-info \
docs/_build \
examples/.ipynb_checkpoints .ipynb_checkpoints \
doc/_build
rm -f .coverage cmethods/_version.py
find tests -name "__pycache__" | xargs rm -rf
find cmethods -name "__pycache__" | xargs rm -rf
find examples -name "__pycache__" | xargs rm -rf