Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (90 loc) · 2.86 KB
/
Copy pathMakefile
File metadata and controls
113 lines (90 loc) · 2.86 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
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
109
110
111
112
113
.PHONY: help install install-sai install-saigen install-both build build-sai build-saigen clean test test-sai test-saigen lint format publish-test publish-prod
help:
@echo "SAI Monorepo - Available Commands"
@echo ""
@echo "Installation:"
@echo " make install-sai Install SAI in editable mode"
@echo " make install-saigen Install SAIGEN in editable mode"
@echo " make install-both Install both packages in editable mode"
@echo ""
@echo "Building:"
@echo " make build Build both packages"
@echo " make build-sai Build SAI package only"
@echo " make build-saigen Build SAIGEN package only"
@echo ""
@echo "Testing:"
@echo " make test Run all tests"
@echo " make test-sai Run SAI tests only"
@echo " make test-saigen Run SAIGEN tests only"
@echo " make coverage Run tests with coverage report"
@echo ""
@echo "Code Quality:"
@echo " make lint Run linters (flake8, mypy)"
@echo " make format Format code (black, isort)"
@echo " make format-check Check code formatting"
@echo ""
@echo "Publishing:"
@echo " make publish-test Publish to TestPyPI"
@echo " make publish-prod Publish to PyPI (production)"
@echo ""
@echo "Cleanup:"
@echo " make clean Remove build artifacts"
@echo " make clean-all Remove all generated files"
# Installation targets
install-sai:
pip install -e ./sai[dev]
install-saigen:
pip install -e ./saigen[dev]
install-both: install-sai install-saigen
install: install-both
# Build targets
build-sai:
cd sai && python -m build
build-saigen:
cd saigen && python -m build
build: clean
./scripts/build-packages.sh
# Test targets
test:
pytest
test-sai:
pytest tests/sai/
test-saigen:
pytest tests/saigen/
coverage:
pytest --cov=sai --cov=saigen --cov-report=html --cov-report=term
# Code quality targets
lint:
flake8 sai saigen tests
mypy sai saigen
format:
black sai saigen tests
isort sai saigen tests
format-check:
black --check sai saigen tests
isort --check-only sai saigen tests
# Publishing targets
publish-test:
./scripts/publish-packages.sh test both
publish-test-sai:
./scripts/publish-packages.sh test sai
publish-test-saigen:
./scripts/publish-packages.sh test saigen
publish-prod:
./scripts/publish-packages.sh prod both
publish-prod-sai:
./scripts/publish-packages.sh prod sai
publish-prod-saigen:
./scripts/publish-packages.sh prod saigen
# Cleanup targets
clean:
rm -rf build/ dist/ *.egg-info
rm -rf sai/build/ sai/dist/ sai/*.egg-info
rm -rf saigen/build/ saigen/dist/ saigen/*.egg-info
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
clean-all: clean
rm -rf .pytest_cache .mypy_cache .coverage htmlcov/
rm -rf .tox/
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true