Summary and Schedule

This workshop introduces the concepts of styling, linting, and formatting Python code for readability and collaboration. This content is for Python developers who want to write professional looking code that can be easily maintained and contributed to by others.

Learning Objectives


After attending this workshop, participants will be able to:

  • Write code that adheres to the Python style guide.
  • Check Python code for errors before running the code.
  • Format Python code for readability and maintenance.
  • Use the ruff tool to check (lint) and format Python code.
  • Use lint and formatter features in your editor or IDE for productive development.
Prerequisite

Prerequisites for this workshop include a basic understanding of how to use the terminal in macOS, Linux, or Windows. Familiarity with the uv tool for installing Python packages and command line tools. And of course a basic understanding of the Python programming language.

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.

Installing uv


The first requirement for this workshop is uv which is an extremely fast Python package and project manager tool. It is a direct replacement for tools like pip, pip-tools, pipx, poetry, pdm, and more. Installation instructions are given in the uv documentation but the main macOS, Linux, and Windows installation commands are presented below.

Install uv on macOS and Linux with:

BASH

$ curl -LsSf https://astral.sh/uv/install.sh | sh

Install uv on Windows with:

BASH

$ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

You may need to restart your terminal to ensure that uv was installed. Check the installation by displaying the version number using the --version option as shown below. If the command displays the uv version number then the installation was successful.

BASH

$ uv --version

OUTPUT

uv 0.8.4 (e176e1714 2025-07-30)

Installing Ruff


Another requirement for this workshop is the Ruff tool for code linting and formatting. There are many ways to install Ruff depending on how you plan to use the tool. Ruff can be executed directly with the following uv command

BASH

$ uvx ruff check

Or use uv to install Ruff as a command line tool with

BASH

$ uv tool install ruff

Editors such as Sublime Text, Zed, Neovim, Visual Studio Code, and others support Ruff through extensions or plugins.