-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (66 loc) · 1.76 KB
/
Makefile
File metadata and controls
81 lines (66 loc) · 1.76 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
SHELL := /bin/bash
VENV_DIR = venv
ifeq ($(OS),Windows_NT)
VENV_PYTHON = $(VENV_DIR)\Scripts\python.exe
VENV_PIP = $(VENV_DIR)\Scripts\pip.exe
DEL = rmdir /S /Q
else
VENV_PYTHON = $(VENV_DIR)/bin/python
VENV_PIP = $(VENV_DIR)/bin/pip
DEL = rm -rf
endif
setup:
@if [ ! -d "$(VENV_DIR)" ]; then \
echo "Creating new virtual environment..."; \
python -m venv $(VENV_DIR); \
else \
echo "Using existing virtual environment..."; \
fi
$(VENV_PYTHON) -m pip install --upgrade pip setuptools wheel
$(VENV_PYTHON) -m pip install -e ".[dev,bokeh,websockets]"
shell:
ifeq ($(OS),Windows_NT)
@cmd /k "venv\Scripts\activate"
else
@bash --rcfile <(echo "source venv/bin/activate")
endif
develop:
pip install -e ".[dev,bokeh,websockets]"
build:
$(VENV_PYTHON) -m build
test:
pytest -v -s --log-cli-level=INFO
clean:
$(DEL) build dist *.egg-info
ifeq ($(OS),Windows_NT)
@for /d %%D in (.) do if exist "%%D\__pycache__" $(DEL) "%%D\__pycache__"
@del /S /Q *.pyc 2>nul || true
else
@find . -type d -name "__pycache__" -exec $(DEL) {} +
@find . -name "*.pyc" -delete
endif
docs:
@echo "Installing documentation dependencies..."
$(VENV_PIP) install -r requirements-docs.txt
@echo "Building documentation..."
mkdocs build
docs-serve:
@echo "Installing documentation dependencies..."
$(VENV_PIP) install -r requirements-docs.txt
@echo "Starting documentation server..."
mkdocs serve
docs-deploy:
@echo "Installing documentation dependencies..."
$(VENV_PIP) install -r requirements-docs.txt
@echo "Deploying documentation..."
mkdocs gh-deploy
docs-api:
@echo "Generating API documentation..."
$(VENV_PYTHON) generate_api_docs.py
@echo "API documentation generated successfully!"
lint:
flake8 src tests
mypy src
format:
black src tests examples
isort src tests examples