This guide will help you set up a development environment for the github-backup-app project using modern Python tooling.
- Python 3.14+ (tested with Python 3.14.6)
- Git
- uv (fast Python package manager)
git clone https://github.com/schlomo/github-backup-app.git
cd github-backup-app# On macOS with Homebrew (recommended)
brew install uv
# Or using the official installer
curl -LsSf https://astral.sh/uv/install.sh | shOption A: Using the setup script (recommended):
./dev-setup.shOption B: Manual setup:
# Install all dependencies (runtime + dev)
uv sync --dev
# Activate the virtual environment
source .venv/bin/activate
# Verify installation
python -c "import github_backup; print('Import successful')"Option C: Using uv directly:
uv sync --devFirst, activate the virtual environment:
source .venv/bin/activateThen test the installation:
# Test the CLI
github-backup --help
# Test linting
flake8 github_backup/
# Test code formatting
black --check github_backup/
# Test import
python -c "import github_backup; print('Import successful')"- flake8: Linting and style checking
- black: Code formatting
- autopep8: Automatic PEP 8 formatting
Currently, this project has no unit tests. To run linting:
# Activate the virtual environment first
source .venv/bin/activate
# Then run linting
flake8 github_backup/To format code with black:
# Activate the virtual environment first
source .venv/bin/activate
# Then format code
black github_backup/To check formatting without making changes:
black --check github_backup/github-backup-app/
├── github_backup/ # Main package
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Backup tool CLI entry point
│ ├── github_backup.py # Main application logic
│ └── create_github_app.py # Script to automate creation of a GitHub App
├── .github/
│ └── workflows/ # GitHub Actions CI/CD
│ └── ci-cd.yml # Test, build, Docker and PyPI release
├── Dockerfile # Container image definition
├── pyproject.toml # Modern Python packaging configuration
├── uv.lock # Dependency lock file
├── dev-setup.sh # Development setup script
├── .flake8 # Flake8 configuration
└── README.md # Project documentation
First, activate the virtual environment:
source .venv/bin/activateThen use the application:
# Show help
github-backup --help
# Backup a user's public repositories (requires GitHub App authentication)
github-backup username --app-id YOUR_APP_ID --private-key YOUR_PRIVATE_KEY --output-directory ./backup# Activate the virtual environment first
source .venv/bin/activate
# Run directly from source as a module
python -m github_backup --help
# Use the installed command
github-backup --help- Fork the repository
- Create a feature branch
- Set up development environment:
./dev-setup.sh - Activate the virtual environment:
source .venv/bin/activate - Make your changes
- Run linting:
flake8 github_backup/ - Format code:
black github_backup/ - Test your changes:
python -c "import github_backup; print('Import successful')" - Submit a pull request
The CI/CD pipeline will automatically run tests, linting, and formatting checks on your pull request.
# 1. Bump __version__ in github_backup/__init__.py
# 2. Commit, merge to main (updates :latest Docker image)
# 3. Tag for PyPI + semver Docker tags:
git tag v0.2.0
git push origin v0.2.0Ensure PYPI_API_TOKEN is configured under repository Secrets before tagging, or the PyPI job will fail (Docker will still publish).