GitHunt
RJ

rjoydip/python-starter

A project template with UV package manager and CI integration.

Python Starter

uv
image
Checked with pyright
CI

A project template with UV package manager and CI integration.

๐Ÿš€ Features

  • UV package manager for dependency management
  • Docker support
  • Ruff for code formatting and linting
  • Pytest for testing
  • Logging configuration

๐Ÿ“‹ Prerequisites

  • Python 3.13+
  • Docker Desktop
  • UV package manager

๐Ÿ›  Installation

  1. Clone the repository:

Install project dependencies:

uv sync

Development

Local Development

  • Run UV application locally:
uv run uvstarter main:app --port 8000 --reload
  • Run code formatting and linting:
uv run ruff format .
# or
uv run ruff check --fix
  • Run typechecking:
uv run pyright
  • Run tests:
uv run pytest

Docker Development

Build and run the application in Docker:

docker build -t app .
docker run -p 8000:8000 app

โš™๏ธ Configuration

  • Project dependencies and settings are managed in pyproject.toml
  • Ruff is configured for code formatting and linting
  • Pytest is set up for testing
  • Logging configuration is available for different environments

๐ŸŒ API Endpoints

  • GET /: Returns a "Hello from UV!" message

๐Ÿงช Testing

Tests are located in the tests/ directory. Run the test suite using:

uv run pytest

๐Ÿ” Project Structure

uv-ci-template/
|โ”€โ”€ main.py # UV application
โ”œโ”€โ”€ tests/
โ”‚ โ””โ”€โ”€ tests.py # Test suite
โ”œโ”€โ”€ Dockerfile # Docker configuration
โ”œโ”€โ”€ pyproject.toml # Project configuration
โ”œโ”€โ”€ uv.lock # Libs and dependencies
โ””โ”€โ”€ README.md

๐Ÿ‘ฅ Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request