-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (87 loc) · 2.62 KB
/
Copy pathMakefile
File metadata and controls
100 lines (87 loc) · 2.62 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
# Makefile for Notion to Word Converter with UV
.PHONY: help setup dev test test-full convert lint format clean run
# Default target
help:
@echo "Notion to Word Converter - UV Commands"
@echo "======================================"
@echo ""
@echo "Setup & Installation:"
@echo " make setup - Install UV and sync dependencies"
@echo " make dev - Install development dependencies"
@echo ""
@echo "Testing:"
@echo " make test - Run automated tests"
@echo " make test-full - Run comprehensive test suite"
@echo " make test-real - Run real conversion test"
@echo ""
@echo "Usage:"
@echo " make run - Run interactive converter"
@echo " make convert URL=<url> - Convert a specific page"
@echo ""
@echo "Development:"
@echo " make lint - Run code linters"
@echo " make format - Auto-format code"
@echo " make clean - Clean cache files"
@echo ""
@echo "Examples:"
@echo " make convert URL=\"https://notion.so/page-id\""
@echo " make test"
# Install UV if not present, then sync
setup:
@command -v uv >/dev/null 2>&1 || { \
echo "Installing UV..."; \
curl -LsSf https://astral.sh/uv/install.sh | sh; \
}
@echo "Syncing dependencies with UV..."
@uv sync
@echo "✓ Setup complete!"
# Install dev dependencies
dev:
@echo "Installing development dependencies..."
@uv sync --all-extras
@echo "✓ Development environment ready!"
# Run automated tests
test:
@echo "Running automated tests..."
@uv run python tests/run_tests.py
# Run full test suite
test-full:
@echo "Running comprehensive test suite..."
@uv run python tests/test_suite.py
# Run real conversion test
test-real:
@echo "Running real conversion test..."
@uv run python tests/test_conversion.py
# Run interactive mode
run:
@uv run notion-to-word
# Convert a specific URL
convert:
@if [ -z "$(URL)" ]; then \
echo "Error: Please provide a URL"; \
echo "Usage: make convert URL=\"https://notion.so/your-page\""; \
exit 1; \
fi
@uv run notion-to-word "$(URL)" --open
# Run linters
lint:
@echo "Running linters..."
@uv run ruff check . || true
@uv run black --check . || true
# Format code
format:
@echo "Formatting code..."
@uv run black .
@uv run ruff check --fix .
@echo "✓ Code formatted!"
# Clean cache files
clean:
@echo "Cleaning cache files..."
@find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
@find . -type f -name "*.pyc" -delete 2>/dev/null || true
@rm -rf .pytest_cache .coverage .ruff_cache 2>/dev/null || true
@rm -rf uv.lock 2>/dev/null || true
@echo "✓ Cleanup complete!"
# Quick install and test
quick-start: setup test
@echo "✓ Quick start complete! Try: make run"