#Python

147 posts

Python Packaging #5 Dependency Locking: Lock Files and Reproducibility
5 min read

Python Packaging #5 Dependency Locking: Lock Files and Reproducibility

Starting from why declaration and lock are separate, we read the contents of uv.lock directly: the resolution result that pins every transitive dependency, the supply-chain risks hash verification blocks, reproducing the lock exactly in CI with --frozen, a strategy that turns upgrades into routine work, and pylock.toml (PEP 751), the standard that opens movement between tools.

Python Packaging #4 uv: The Standard Workflow of 2026
5 min read

Python Packaging #4 uv: The Standard Workflow of 2026

The daily uv workflow that folds virtual environments, dependency installation, locking, and Python version management into one tool: how init, add, sync, and run replace the manual work of earlier posts, uv installing Python interpreters themselves, isolated global tools via uvx and uv tool, and migrating existing requirements.txt projects.

Build a Desktop App with PySide6 #7: Packaging and Distribution — Building Executables with PyInstaller
7 min read

Build a Desktop App with PySide6 #7: Packaging and Distribution — Building Executables with PyInstaller

Bundle the app with PyInstaller so it runs on computers without Python installed. The onedir vs onefile trade-off, including data files, platform-specific caveats, and pyside6-deploy — the final part of the series.

Python Packaging #3 pyproject.toml: The Standard for Project Configuration
4 min read

Python Packaging #3 pyproject.toml: The Standard for Project Configuration

How the era of setup.py and scattered config files converged into the single pyproject.toml: metadata and dependency declarations in the project table, separating optional features and dev tooling with extras and dependency-groups, the role of build-system, and the practical layout that gathers ruff and pytest settings under the tool table.

Build a Desktop App with PySide6 #6: Threads and Timers — Keeping the UI Responsive
6 min read

Build a Desktop App with PySide6 #6: Threads and Timers — Keeping the UI Responsive

See exactly why wiring a long task to a button freezes the whole window, then fix it with the QThread + Worker pattern — the canonical code that keeps the UI responsive. Also covers QTimer for periodic work.

Python Packaging #2 pip and requirements.txt: The Limits of the Traditional Workflow
4 min read

Python Packaging #2 pip and requirements.txt: The Limits of the Traditional Workflow

How pip works and the requirements.txt workflow — and where the approach falls apart. Reading version specifiers, pip freeze's inability to distinguish direct from transitive dependencies, the reproducibility hole where unpinned installs differ by the day, and constraints files, building the case for why the next generation of tools exists.

Build a Desktop App with PySide6 #5: Model/View — Connecting Data to Lists and Tables
7 min read

Build a Desktop App with PySide6 #5: Model/View — Connecting Data to Lists and Tables

We hit the limits of stuffing data directly into widgets and move to Qt model/view. Subclassing QAbstractTableModel, change notification, a QSortFilterProxyModel search filter, and selection handling — all practiced on a todo table.

Python Packaging #1 Virtual Environments: Why Environments Break, and venv
5 min read

Python Packaging #1 Virtual Environments: Why Environments Break, and venv

Starting from the structural cause of broken Python environments: the path import searches and the conflicts born from having a single site-packages, why the system Python must be left alone and what the PEP 668 error means, isolating each project with venv, and the fact that activate is nothing more than PATH manipulation.

When Your Python Server Is Slow — Finding the Bottleneck in 5 Minutes with py-spy
5 min read

When Your Python Server Is Slow — Finding the Bottleneck in 5 Minutes with py-spy

Using py-spy, the sampling profiler that attaches to a running Python process with no code changes or restarts: dump to identify a hung process, top for live bottleneck watching, record and flame graphs, --idle for off-CPU waits, reading the GIL numbers, and running it in containers.

Build a Desktop App with PySide6 #4: Qt Designer and UI Files — Draw the Screen, Then Load It
7 min read

Build a Desktop App with PySide6 #4: Qt Designer and UI Files — Draw the Screen, Then Load It

Draw your screen with Qt Designer, which ships with PySide6, and load the .ui file in two ways: pyside6-uic and QUiLoader. We practice the code-and-screen separation workflow on the todo app form.

Build a Desktop App with PySide6 #3: Signals and Slots — the Core of Event Handling
5 min read

Build a Desktop App with PySide6 #3: Signals and Slots — the Core of Event Handling

A tour of signals and slots, the center of event handling in Qt. From clicked.connect through signals that carry arguments to custom signals declared with Signal, and wiring real behavior into the todo app.

Build a Desktop App with PySide6 #2: Widgets and Layouts — Assembling the Screen
5 min read

Build a Desktop App with PySide6 #2: Widgets and Layouts — Assembling the Screen

A catalog of the widgets you will use most, and how to assemble a real screen by nesting QVBoxLayout and QHBoxLayout. We build the screen skeleton of the todo app we will extend throughout the series.