A professional Python project template that always uses portable Python - never relies on system installations.
- ๐ฏ Always Portable - Consistent Python environment everywhere
- ๐ฆ Self-Contained - No dependency on system Python
- ๐ Reproducible - Same exact Python version every time
- ๐ Distributable - Package includes everything needed
# 1. Clone or use this template git clone https://github.com/yourusername/your-project cd your-project # 2. Run setup (downloads Python 3.13.9 first time, ~2 minutes) ./setup.sh # 3. Activate and run source .venv/bin/activate python src/main.pyThat's it! No system Python needed.
your-project/ โโโ .github/ โ โโโ workflows/ โ โโโ ci.yml # CI/CD pipeline โโโ .python/ # Portable Python 3.13.9 (~80MB, gitignored) โโโ .venv/ # Virtual environment (gitignored) โโโ src/ โ โโโ __init__.py โ โโโ main.py โโโ tests/ โ โโโ __init__.py โ โโโ test_main.py โโโ .gitignore โโโ CONTRIBUTING.md # Contribution guidelines โโโ pyproject.toml # Project configuration โโโ README.md โโโ QUICK_REFERENCE.md โโโ setup.sh # Setup script โโโ uv.lock โโโ verify-python-version.sh # Version checker # Setup (first time downloads Python, subsequent runs reuse it) ./setup.sh # If something breaks, clean rebuild ./setup.sh --force-clean # Add a dependency # 1. Edit pyproject.toml # 2. Then: uv lock uv sync - Downloads pre-built Python 3.13.9 from python-build-standalone
- Installs to
.python/directory - Creates virtual environment in
.venv/ - Installs dependencies with UV
- Finds existing
.python/installation - Reuses it (no download needed!)
- Creates fresh
.venv/ - Installs dependencies
- Deletes
.python/,.venv/,uv.lock - Downloads Python 3.13.9 again
- Fresh installation
| System Python | Portable Python |
|---|---|
| โ Different versions on different machines | โ Exact same version everywhere |
| โ Might not be installed | โ Always available |
| โ User might update it | โ Controlled version |
| โ Dependency conflicts | โ Self-contained |
| โ "Works on my machine" | โ Works everywhere |
.python/: ~80 MB (one-time).venv/: ~50 MB (varies by dependencies)- Total: ~150 MB uncompressed
- Package: ~50 MB compressed
Small price for complete portability!
# Day 1: Setup ./setup.sh source .venv/bin/activate # Daily development python src/main.py pytest # Add dependencies # Edit pyproject.toml, then: uv lock && uv sync # If weird issues ./setup.sh --force-clean# 1. Ensure clean build ./setup.sh --force-clean # 2. Test your app source .venv/bin/activate python src/main.pyEdit setup.sh:
PYTHON_VERSION="3.14.*" # Or any versionAvailable versions: https://github.com/indygreg/python-build-standalone/releases
# Virtual environment issues rm -rf .venv/ && ./setup.sh # Complete fresh start ./setup.sh --force-clean # Check what you have .python/bin/python3 --version source .venv/bin/activate && python --version- Setup Guide - Detailed guide
- Quick Reference - Command cheat sheet
- UV Documentation
Portable Python is OS and architecture specific:
- โ macOS x86_64 โ macOS x86_64
- โ macOS arm64 (M1/M2/M3) โ macOS arm64
- โ Linux x86_64 โ Linux x86_64
- โ Linux aarch64 โ Linux aarch64
- โ macOS โ Linux (use Docker)
- โ x86_64 โ arm64 (use Docker)
- โ Windows (use WSL or Docker)
This project follows Conventional Commits for clear and structured commit history.
Format:
<type>(<scope>): <description> [optional body] [optional footer] Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoring (no feature change or bug fix)perf: Performance improvementstest: Adding or updating testschore: Maintenance tasks (dependencies, config)ci: CI/CD changes
Examples:
feat(setup): add Python 3.14 support fix(package): correct tar.gz extraction path docs(readme): update installation instructions chore(deps): upgrade uv to latest version refactor(setup): improve error handlingScope (optional): Component affected (setup, package, docs, etc.)
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Make your changes with conventional commits
- Run tests and linting (
pytest && black --check .) - Update documentation if needed
- Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request with:
- Clear description of changes
- Link to related issues
- Screenshots/examples if applicable
- Python Code: Follow PEP 8, use Black formatter
- Bash Scripts: Use ShellCheck for validation
- Documentation: Clear, concise, with examples
- Tests: Add tests for new features
# Format code black src/ tests/ # Run linting flake8 src/ tests/ # Run tests pytest tests/ # Verify script works ./setup.sh --force-clean# Use the included commit message template git config commit.template .gitmessage # Now when you commit, you'll see helpful hints git commitSee CONTRIBUTING.md for detailed guidelines.
MIT License - See LICENSE file
- python-build-standalone - Pre-built Python distributions
- UV - Fast Python package installer
- Built with modern Python best practices
- ๐ Documentation
- ๐ Issues
- ๐ฌ Discussions
โญ If you find this template helpful, please star it!
Ready to use? Click "Use this template" above or clone and start building!