Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (53 loc) · 1.36 KB
/
Copy pathMakefile
File metadata and controls
68 lines (53 loc) · 1.36 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
# =========================================
# WikECD Makefile – Simplify Dev Operations
# =========================================
PYTHON := python3
PACKAGE := WikECD
DIST_DIR := dist
# --- Installation and Environment ---
install:
$(PYTHON) -m pip install -U pip build twine pytest
$(PYTHON) -m pip install -e .
dev:
$(PYTHON) -m pip install -r requirements.txt
# --- Testing ---
test:
pytest -v --maxfail=1 --disable-warnings
# --- Build & Clean ---
build:
rm -rf $(DIST_DIR) build *.egg-info
$(PYTHON) -m build
clean:
rm -rf $(DIST_DIR) build *.egg-info .pytest_cache __pycache__ **/__pycache__
# --- Publishing ---
publish-test:
twine upload -r testpypi $(DIST_DIR)/*
publish:
twine upload -r pypi $(DIST_DIR)/*
# --- Linting & Formatting ---
lint:
flake8 $(PACKAGE) --ignore=E203,W503
format:
black $(PACKAGE)
# --- Docs (optional future section) ---
docs:
@echo "TODO: generate docs using Sphinx or MkDocs"
# --- Convenience Commands ---
run:
wikecd --help
info:
@echo "Python: $$(which $(PYTHON))"
@echo "Pip: $$(which pip)"
@echo "Virtualenv: $$(which activate)"
@echo "Package: $(PACKAGE)"
# --- Git Tagging & Versioning ---
tag:
@if [ -z "$(v)" ]; then \
echo "Usage: make tag v=0.1.2"; \
exit 1; \
fi
git add .
git commit -m "🔖 Release v$(v)"
git tag -a "v$(v)" -m "Version $(v)"
git push --tags
@echo "Tagged and pushed version $(v)"