Skip to content

Commit a5a5065

Browse files
committed
Refine Makefile
1 parent 027fbc7 commit a5a5065

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

Makefile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# NetGraph Development Makefile
22
# This Makefile provides convenient shortcuts for common development tasks
33

4-
.PHONY: help venv clean-venv dev install check check-ci lint format test qt clean docs docs-serve docs-diagrams build check-dist publish-test publish validate perf info check-python hooks
4+
.PHONY: help venv clean-venv dev install check check-ci lint format test qt build clean check-dist publish-test publish info hooks check-python docs docs-serve docs-diagrams validate perf
55

66
# Default target - show help
77
.DEFAULT_GOAL := help
88

99
# Toolchain (prefer project venv if present)
1010
VENV_BIN := $(PWD)/venv/bin
11-
# Use dynamic (recursive) assignment so a newly created venv is picked up
12-
# Prefer the python3 on PATH (e.g., set by setup-python)
1311
PY_FIND := $(shell command -v python3 2>/dev/null || command -v python 2>/dev/null)
1412
PYTHON ?= $(if $(wildcard $(VENV_BIN)/python),$(VENV_BIN)/python,$(PY_FIND))
15-
PIP = $(PYTHON) -m pip
16-
PYTEST = $(PYTHON) -m pytest
17-
RUFF = $(PYTHON) -m ruff
18-
PRECOMMIT = $(PYTHON) -m pre_commit
13+
PIP := $(PYTHON) -m pip
14+
PYTEST := $(PYTHON) -m pytest
15+
RUFF := $(PYTHON) -m ruff
16+
PRECOMMIT := $(PYTHON) -m pre_commit
1917

2018
help:
2119
@echo "🔧 NetGraph Development Commands"
@@ -181,17 +179,15 @@ build:
181179

182180
clean:
183181
@echo "🧹 Cleaning build artifacts and cache files..."
184-
@rm -rf build/
185-
@rm -rf dist/
186-
@rm -rf *.egg-info/
187-
@find . -type f -name "*.pyc" -delete
188-
@find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
189-
@find . -type f -name "*.pyo" -delete
190-
@find . -type f -name "*~" -delete
191-
@find . -type f -name "*.orig" -delete
182+
@rm -rf build/ dist/ *.egg-info/
183+
@rm -rf .pytest_cache .ruff_cache .mypy_cache htmlcov .coverage coverage.xml coverage-*.xml .benchmarks .pytest-benchmark || true
184+
@find . -path "./venv" -prune -o -type f -name "*.pyc" -delete 2>/dev/null || true
185+
@find . -path "./venv" -prune -o -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
186+
@find . -path "./venv" -prune -o -type f -name "*.pyo" -delete 2>/dev/null || true
187+
@find . -path "./venv" -prune -o -type f -name "*~" -delete 2>/dev/null || true
188+
@find . -path "./venv" -prune -o -type f -name "*.orig" -delete 2>/dev/null || true
192189
@echo "✅ Cleanup complete!"
193190

194-
195191
# Publishing
196192
check-dist:
197193
@echo "🔍 Checking distribution packages..."

0 commit comments

Comments
 (0)