-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
142 lines (114 loc) · 4.09 KB
/
Makefile
File metadata and controls
142 lines (114 loc) · 4.09 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
.PHONY: clean build test check upload-test upload install-dev lint typecheck quality help
# Default target
help:
@echo "Available targets:"
@echo " clean - Clean build artifacts"
@echo " install-dev - Install development dependencies"
@echo " test - Run tests with coverage"
@echo " test-fast - Run tests without coverage"
@echo " lint - Run code formatting and linting"
@echo " typecheck - Run type checking"
@echo " quality - Run all quality checks"
@echo " build - Build package"
@echo " check - Check built package"
@echo " validate - Run comprehensive package validation"
@echo " upload-test - Upload to Test PyPI"
@echo " upload - Upload to PyPI"
@echo " release-test - Full release to Test PyPI"
@echo " release - Full release to PyPI"
@echo " release-dry - Dry run release (no upload)"
@echo " release-enhanced - Enhanced release with verbose output"
@echo " release-version - Release with version bump (use VERSION=x.y.z)"
@echo " release-quick - Quick release for development (Test PyPI only)"
@echo " install-test - Install from Test PyPI"
@echo " version - Show current version"
@echo " docs - Build documentation"
# Clean build artifacts (cross-platform)
clean:
python -c "import shutil, pathlib; [shutil.rmtree(p) for p in pathlib.Path('.').glob('build') if p.is_dir()]"
python -c "import shutil, pathlib; [shutil.rmtree(p) for p in pathlib.Path('.').glob('dist') if p.is_dir()]"
python -c "import shutil, pathlib; [shutil.rmtree(p) for p in pathlib.Path('.').glob('*.egg-info') if p.is_dir()]"
python -c "import shutil, pathlib; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__') if p.is_dir()]"
python -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.pyc')]"
# Install development dependencies
install-dev:
pip install -e ".[dev]"
# Run tests with coverage
test:
python -m pytest tests/ -v --cov=neurolite --cov-report=html --cov-report=term-missing
# Run tests without coverage (faster)
test-fast:
python -m pytest tests/ -v
# Run parallel tests
test-parallel:
python -m pytest tests/ -v -n auto --cov=neurolite
# Run specific test
test-one:
python -m pytest tests/$(TEST) -v
# Build package
build: clean
python -m build
# Check package
check: build
python -m twine check dist/*
# Run comprehensive package validation
validate: build
python scripts/validate_package.py
# Upload to Test PyPI
upload-test: check
python -m twine upload --repository testpypi dist/*
# Upload to PyPI
upload: check
python -m twine upload dist/*
# Full release to Test PyPI
release-test:
python scripts/release.py --test-only
# Full release
release:
python scripts/release.py
# Dry run release
release-dry:
python scripts/release.py --dry-run
# Enhanced release with comprehensive validation
release-enhanced:
python scripts/release.py --verbose
# Release with version bump
release-version:
@echo "Usage: make release-version VERSION=x.y.z"
@if [ -z "$(VERSION)" ]; then echo "ERROR: VERSION not specified"; exit 1; fi
python scripts/release.py --version $(VERSION) --verbose
# Quick release (skip some checks for development)
release-quick:
python scripts/release.py --skip-quality --skip-git-checks --test-only
# Install from Test PyPI
install-test:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ neurolite
# Show current version
version:
python -c "import neurolite; print(neurolite.__version__)"
# Format and lint code
lint:
python -m black neurolite/ tests/
python -m ruff check neurolite/ tests/ --fix
python -m flake8 neurolite/ tests/
# Type check
typecheck:
python -m mypy neurolite/
# All quality checks
quality: lint typecheck test
# Build documentation
docs:
cd docs && python -m sphinx -b html . _build/html
# Serve documentation locally
docs-serve:
cd docs/_build/html && python -m http.server 8000
# Security check
security:
python -m pip-audit
# Dependency check
deps-check:
python -m pip check
# Update dependencies
deps-update:
pip install --upgrade pip setuptools wheel
pip install --upgrade -e ".[dev]"