|
1 | | -build: |
2 | | - python -m build |
| 1 | +# ============================================================================= |
| 2 | +# Surfaces Makefile |
| 3 | +# ============================================================================= |
3 | 4 |
|
4 | | -install: build |
5 | | - pip install dist/*.whl |
| 5 | +.PHONY: build install uninstall test lint format check clean help |
6 | 6 |
|
7 | | -uninstall: |
8 | | - pip uninstall -y surfaces |
9 | | - rm -fr build dist *.egg-info |
| 7 | +# ============================================================================= |
| 8 | +# Installation |
| 9 | +# ============================================================================= |
| 10 | + |
| 11 | +install-editable: |
| 12 | + pip install -e . |
10 | 13 |
|
11 | 14 | install-dev: |
12 | 15 | pip install -e ".[dev]" |
13 | 16 |
|
14 | 17 | install-test: |
15 | 18 | pip install -e ".[test]" |
16 | 19 |
|
| 20 | +install-test-minimal: |
| 21 | + pip install -e ".[test-minimal]" |
| 22 | + |
17 | 23 | install-build: |
18 | 24 | pip install build |
19 | 25 |
|
20 | | -install-editable: |
| 26 | +reinstall-editable: |
| 27 | + pip uninstall -y surfaces || true |
21 | 28 | pip install -e . |
22 | 29 |
|
| 30 | +# ============================================================================= |
| 31 | +# Building |
| 32 | +# ============================================================================= |
| 33 | + |
| 34 | +build: |
| 35 | + python -m build |
| 36 | + |
| 37 | +install: build |
| 38 | + pip install dist/*.whl |
| 39 | + |
| 40 | +uninstall: |
| 41 | + pip uninstall -y surfaces || true |
| 42 | + rm -fr build dist *.egg-info |
| 43 | + |
23 | 44 | reinstall: uninstall install |
24 | 45 |
|
25 | | -reinstall-editable: uninstall install-editable |
| 46 | +# ============================================================================= |
| 47 | +# Testing |
| 48 | +# ============================================================================= |
| 49 | + |
| 50 | +py-test: |
| 51 | + python -m pytest -x -p no:warnings tests/ |
26 | 52 |
|
27 | 53 | test-examples: |
28 | | - cd tests; \ |
29 | | - python _test_examples.py |
| 54 | + cd tests && python _test_examples.py |
30 | 55 |
|
31 | | -py-test: |
32 | | - python -m pytest -x -p no:warnings tests/; \ |
| 56 | +test: py-test test-examples |
| 57 | + |
| 58 | +# Test with minimal dependencies (no sklearn, no viz) |
| 59 | +test-minimal: |
| 60 | + python -m pytest -x -p no:warnings tests/test_1d_functions.py tests/test_2d_functions.py tests/test_nd_functions.py |
| 61 | + |
| 62 | +# Test with coverage |
| 63 | +test-cov: |
| 64 | + python -m pytest --cov=surfaces --cov-report=term-missing --cov-report=xml -p no:warnings tests/ |
| 65 | + |
| 66 | +# ============================================================================= |
| 67 | +# Code Quality |
| 68 | +# ============================================================================= |
| 69 | + |
| 70 | +lint: |
| 71 | + ruff check . |
| 72 | + |
| 73 | +lint-fix: |
| 74 | + ruff check --fix . |
| 75 | + |
| 76 | +format: |
| 77 | + ruff format . |
| 78 | + |
| 79 | +format-check: |
| 80 | + ruff format --check . |
| 81 | + |
| 82 | +check: lint format-check |
33 | 83 |
|
34 | | -test: py-test test-examples |
| 84 | +fix: lint-fix format |
| 85 | + |
| 86 | +# ============================================================================= |
| 87 | +# Pre-commit |
| 88 | +# ============================================================================= |
| 89 | + |
| 90 | +pre-commit-install: |
| 91 | + pre-commit install |
| 92 | + |
| 93 | +pre-commit-all: |
| 94 | + pre-commit run --all-files |
| 95 | + |
| 96 | +pre-commit-update: |
| 97 | + pre-commit autoupdate |
| 98 | + |
| 99 | +# ============================================================================= |
| 100 | +# Data Collection |
| 101 | +# ============================================================================= |
35 | 102 |
|
36 | 103 | database: |
37 | 104 | python -m collect_search_data.py |
| 105 | + |
| 106 | +# ============================================================================= |
| 107 | +# Cleanup |
| 108 | +# ============================================================================= |
| 109 | + |
| 110 | +clean: |
| 111 | + rm -fr build dist *.egg-info |
| 112 | + rm -fr .pytest_cache .ruff_cache .coverage coverage.xml |
| 113 | + find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true |
| 114 | + find . -type f -name "*.pyc" -delete |
| 115 | + |
| 116 | +# ============================================================================= |
| 117 | +# Help |
| 118 | +# ============================================================================= |
| 119 | + |
| 120 | +help: |
| 121 | + @echo "Surfaces Development Commands" |
| 122 | + @echo "==============================" |
| 123 | + @echo "" |
| 124 | + @echo "Installation:" |
| 125 | + @echo " install-editable Install package in editable mode" |
| 126 | + @echo " install-dev Install with dev dependencies" |
| 127 | + @echo " install-test Install with test dependencies (full)" |
| 128 | + @echo " install-test-minimal Install with minimal test dependencies" |
| 129 | + @echo "" |
| 130 | + @echo "Testing:" |
| 131 | + @echo " test Run all tests" |
| 132 | + @echo " py-test Run pytest only" |
| 133 | + @echo " test-minimal Run tests for core functions (no optional deps)" |
| 134 | + @echo " test-cov Run tests with coverage" |
| 135 | + @echo "" |
| 136 | + @echo "Code Quality:" |
| 137 | + @echo " lint Check code with ruff" |
| 138 | + @echo " lint-fix Fix linting issues" |
| 139 | + @echo " format Format code with ruff" |
| 140 | + @echo " format-check Check code formatting" |
| 141 | + @echo " check Run all checks (lint + format)" |
| 142 | + @echo " fix Fix all issues (lint + format)" |
| 143 | + @echo "" |
| 144 | + @echo "Pre-commit:" |
| 145 | + @echo " pre-commit-install Install pre-commit hooks" |
| 146 | + @echo " pre-commit-all Run pre-commit on all files" |
| 147 | + @echo " pre-commit-update Update pre-commit hooks" |
| 148 | + @echo "" |
| 149 | + @echo "Other:" |
| 150 | + @echo " build Build package" |
| 151 | + @echo " clean Remove build artifacts" |
0 commit comments