Complete guide for contributing to HomeTube.
- Python 3.10+
- Git
- FFmpeg (for video processing)
- Package manager: UV (recommended), conda, or pip
Choose your preferred environment:
# Clone repository
git clone https://github.com/EgalitarianMonkey/hometube.git
cd hometube
# Configure environment
cp .env.sample .env
# Install UV if needed: curl -LsSf https://astral.sh/uv/install.sh | sh
# Sync dependencies
uv sync
# Verify setup
make test# Clone repository
git clone https://github.com/EgalitarianMonkey/hometube.git
cd hometube
# Create environment with all dependencies
conda env create -f environment.yml
conda activate hometube
# Verify setup
make test# Clone repository
git clone https://github.com/EgalitarianMonkey/hometube.git
cd hometube
# Configure environment
cp .env.sample .env
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements/requirements-dev.txt
# Verify setup
make test# Standard launch
python run.py
# Debug mode with detailed logging
DEBUG=1 python run.py
# Custom port
PORT=8502 streamlit run app/main.py
# With UV
uv run streamlit run app/main.pyAccess the application at: http://localhost:8501
# Run all tests
make test
# Fast tests only
make test-ci
# With coverage report
make test-coverage
# Specific test categories
make test-unit # Unit tests only
make test-integration # Integration tests
# Run specific test file
python -m pytest tests/test_core_functions.py -v
# Run specific test function
python -m pytest tests/test_core_functions.py::test_sanitize_filename -vmake uv-test
make uv-test-ciTests use pytest markers:
@pytest.mark.unit- Fast, isolated unit tests@pytest.mark.integration- Component interaction tests@pytest.mark.performance- Speed benchmarks@pytest.mark.network- Real API calls (skipped by default)
# Format code
make format
# Run linting
make lint
# All quality checks before commit
make pre-commit- PEP 8 compliance
- Type hints for all new functions
- Docstrings for public APIs
- Tests for new functionality
git clone https://github.com/EgalitarianMonkey/hometube.git
cd hometubegit checkout -b feature/awesome-featureEdit your code and add tests.
make test
make lintgit add .
git commit -m "feat: add awesome new feature
- Implements feature X
- Improves performance by Y%
- Fixes issue #123"git push origin feature/awesome-featureOpen a Pull Request on GitHub.
git checkout main
git pull origin main
git branch -d feature/awesome-feature# Core dependency
uv add streamlit>=1.50.0
# Development dependency
uv add --dev pytest>=8.0.0
# Sync all files
make sync-deps# Update all dependencies
make update-deps
# Verify everything works
make testUpdate version in three places:
# Using make (recommended)
make version-update 2.0.0Or manually update:
app/__init__.py:__version__ = "2.0.0"pyproject.toml:version = "2.0.0"- Regenerate lock:
uv lock
# Keep temporary files for debugging
export REMOVE_TMP_FILES_AFTER_DOWNLOAD=false
# Enable debug logging
export DEBUG=1
# Custom development paths
export VIDEOS_FOLDER=./dev-downloads
export TMP_DOWNLOAD_FOLDER=./dev-tmp
# Test different languages
export UI_LANGUAGE=frDEBUG=1 REMOVE_TMP_FILES_AFTER_DOWNLOAD=false python run.pyhometube/
├── app/ # Main application
│ ├── main.py # Streamlit entry point
│ ├── core.py # Core download logic
│ ├── config.py # Configuration management
│ ├── json_utils.py # JSON file operations
│ ├── constants.py # Shared constants
│ └── translations/ # i18n support
├── tests/ # Test suite
├── docs/ # Documentation
├── requirements/ # Dependency files
├── .github/ # CI/CD workflows
├── Dockerfile # Container definition
├── pyproject.toml # Project configuration
└── Makefile # Development commands
GitHub Actions workflows:
| Workflow | Trigger | Purpose |
|---|---|---|
tests.yml |
Push, PR | Run tests on Python 3.10-3.12 |
docker-build.yml |
Push to main, tags | Build multi-arch Docker images |
release.yml |
Version tags (v*) | Create GitHub releases |
refresh-ytdlp.yml |
Daily, manual | Update yt-dlp version |
# Run full CI pipeline locally
make ci
# Test Docker build
docker build -t hometube:test .Before submitting:
- Tests pass (
make test) - Code is formatted (
make format) - Linting passes (
make lint) - Documentation updated if needed
- Conventional commit messages used
| Environment | Setup Time | Test Speed | Best For |
|---|---|---|---|
| UV | ~10s | Fastest | Regular development |
| Conda | ~60s | Medium | Complex dependencies |
| pip/venv | ~30s | Medium | Universal compatibility |
- Testing Guide - Detailed testing documentation
- Architecture docs - Technical implementation details
- Streamlit docs - UI framework documentation
- yt-dlp docs - Download engine documentation
- Check existing documentation
- Search GitHub Issues
- Create new issue with detailed information
- Join GitHub Discussions
Thank you for contributing to HomeTube! 🎬