-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (54 loc) · 1.64 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
.PHONY: install dev test lint format clean build docs docker-build docker-dev docker-test docker-lint run-example help
install:
poetry install
test:
poetry run pytest
test-unit:
poetry run pytest tests/unit
test-integration:
poetry run pytest tests/integration
test-perf:
poetry run pytest tests/performance -v --capture=no
lint:
poetry run ruff check nanofed/ scripts/ tests/
poetry run mypy nanofed
format:
poetry run ruff format nanofed/ scripts/ tests/
poetry run ruff check --fix nanofed/ scripts/ tests/
clean:
# Clean Python cache
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".ruff_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
find . -type d -name ".coverage" -exec rm -rf {} +
find . -type f -name ".coverage" -delete
# Clean build artifacts
rm -rf dist/
rm -rf build/
rm -rf *.egg-info
# Clean example artifacts
find examples -type d -name "runs" -exec rm -rf {} +
find . -type f -name "*.pt" -delete
find . -type f -name "*.log" -delete
# Package building and publishing
build: clean
poetry build
publish: build
poetry publish
docs:
poetry run sphinx-build -b html docs/source docs/build/html
docs-serve: docs
@echo "Serving documentation at http://localhost:8000"
@cd docs/build/html && python -m http.server 8000
setup-pre-commit:
poetry run pre-commit install
poetry run pre-commit run --all-files
release-prepare:
@if [ -z "$(version)" ]; then \
echo "Usage: make release-prepare version=X.Y.Z"; \
exit 1; \
fi
poetry run python scripts/prepare_release.py $(version)
release:
./scripts/release.sh