-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (81 loc) · 3.14 KB
/
Makefile
File metadata and controls
99 lines (81 loc) · 3.14 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
.PHONY: help install test test-integration run-server run-example clean lint format
# Default target
help:
@echo "Available commands:"
@echo " install - Install package and dependencies"
@echo " install-dev - Install package in development mode"
@echo " test - Run basic tests"
@echo " test-integration - Run integration tests (requires http-trickle)"
@echo " test-all - Run all tests"
@echo " run-server - Run the example HTTP server"
@echo " run-example - Run the simple streaming example"
@echo " run-workflow - Run the automated test workflow"
@echo " lint - Run linting checks"
@echo " format - Format code with black"
@echo " clean - Clean up build artifacts"
@echo " setup-http-trickle - Setup http-trickle for testing"
# Installation
install:
pip install -r requirements.txt
pip install -e .
install-dev:
pip install -r requirements.txt
pip install -e .[dev]
# Testing
test:
pytest tests/test_basic_streaming.py -v
test-integration:
pytest tests/test_integration.py -v -m integration
test-all:
pytest tests/ -v
# Running examples
run-server:
python examples/http_server_example.py
run-example:
python examples/async_processor_example.py
run-workflow:
python scripts/test_workflow.py
# Development tools
lint:
flake8 pytrickle/ tests/ --max-line-length=120
mypy pytrickle/ --ignore-missing-imports
format:
black pytrickle/ tests/ scripts/ --line-length=120
# Cleanup
clean:
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
rm -rf build/ dist/ .pytest_cache/ .mypy_cache/
# Setup http-trickle for testing
setup-http-trickle:
@echo "Setting up http-trickle for testing..."
@if [ ! -d "$(HOME)/repos/http-trickle" ]; then \
echo "Cloning http-trickle..."; \
mkdir -p $(HOME)/repos; \
git clone https://github.com/livepeer/http-trickle.git $(HOME)/repos/http-trickle; \
fi
@echo "Building http-trickle..."
@cd $(HOME)/repos/http-trickle && (make all || make trickle-server || echo "http-trickle build completed")
@echo "http-trickle setup complete!"
# Start trickle server (for manual testing)
start-trickle-server:
@echo "Starting trickle server on localhost:3389..."
@cd $(HOME)/repos/http-trickle && make trickle-server addr=0.0.0.0:3389
# Publish test video (requires video file)
publish-test-video:
@echo "Publishing test video..."
@cd $(HOME)/repos/http-trickle && make publisher-ffmpeg in=bbb_sunflower_1080p_30fps_normal.mp4 stream=sample url=http://127.0.0.1:3389
# Play processed output
play-output:
@echo "Playing processed output stream..."
@cd $(HOME)/repos/http-trickle && go run cmd/read2pipe/*.go --url http://127.0.0.1:3389/ --stream sample-output | ffplay -probesize 64 -
# Full demo workflow
demo: setup-http-trickle
@echo "Starting full demo workflow..."
@echo "This will start all servers and run a complete test"
python scripts/test_workflow.py
# Development setup
dev-setup: install-dev setup-http-trickle
@echo "Development environment setup complete!"
@echo "You can now run 'make demo' to test the full workflow"