Skip to content

dunnkers/python-uv-devcontainer

Repository files navigation

python-uv-devcontainer

Python project setup using a Devcontainer and uv.

Features

Setup

  1. Use this template

    Use this template and create new repository

    Create a new repository based on this template.

  2. Clone repo

    Clone repository

    Open the repo in VSCode.

  3. Reopen in Container

    Click the button in the popup upon opening the repo:

    Dev Containers: Reopen in Container

    Alternatively, enter Ctrl+Shift+P and select Dev Containers: Reopen in Container.

  4. Wait for setup to finish

    Upon opening the Devcontainer, setup will start. Wait for the setup to finish before continuing.

    Wait for postCreateCommand to finish
  5. Select Python interpreter

    Enter Ctrl+Shift+P and select Python: Select Interpreter.

    VSCode: Python Select Interpreter

    Select the venv (./.venv/bin/python).

  6. Enjoy 🫶

    You now have a fully configured Python development environment!

    alt text

    with uv:

    and pytest:

    UI Terminal
    alt text alt text

    ... and ruff:

    all readily available 🎉

Extras

  • CI/CD with GitHub Actions

    A workflow is already set up for you.

    alt text

    This workflow runs tests using pytest and formatting + linting using ruff. Dependencies are set up with uv.

  • Dockerfile

    A Dockerfile is provided for easy deployment. This Dockerfile uses the same base image as the Devcontainer, so you can be sure it will work in production.

About

Provided to you with ♡ by Jeroen Overschie.