# Clone the repository
git clone https://github.com/MrHDOLEK/python-boilerplate.git
# Navigate to project directory
cd python-boilerplate/
# Checkout working branch
git checkout <branch>
# Setup Python environment
uv python install
uv venv
source .venv/bin/activate
# Install dependencies
uv sync
# Install pre-commit hooks
pre-commit installFast Python package manager, written in Rust. Configuration in pyproject.toml and dependencies locked in uv.lock.
# Install a package
uv pip install <package>
# Run a command in the environment
uv run pytest testsFramework for managing git hooks. Configuration in .pre-commit-config.yaml.
# Run against all files
pre-commit run --all-filesFast Python linter and formatter. Rules defined in pyproject.toml.
# Format code
uv run ruff format .
# Check code
uv run ruff check .Using pytest for tests:
# Run tests
uv run pytest tests
# Run tests with coverage
uv run pytest tests --cov=src# Login to GitHub Container Registry
echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin
# Build production image
docker buildx build -f .docker/python/Dockerfile -t my-python-application:latest .
# Run the application
docker run -it --rm my-python-application:latestLearn more at these links: