Skip to content

Python Tooling Explained

Background and context articles that explain the why behind Python tools, packaging standards, and ecosystem decisions.

Explanation pages give the context behind Python’s tooling: what concepts mean, why standards exist, how tools compare, and what trade-offs they make. They are for reading, not doing.

To set up a tool, start with a Tutorial. To solve a specific problem, see the How-To guides.

The groups below organize concepts, tool comparisons, PEPs and standards, coming-from-another-language guides, and opinionated philosophy pieces.

Complete Guides

Long-form walkthroughs of uv, Ruff, ty, Claude Code, and Codex

Core Concepts

Definitions of virtual environments, lock files, build backends, and packaging vocabulary

Ruff Rule Codes Explained: What E, W, F, I, UP, S, B, and C90 Mean

Map Ruff prefixes like E, F, UP, and B to their source linters so you can decode errors and pick rule categories fast.

Sampling vs deterministic profilers: which should I use?

Sampling uses timer snapshots; deterministic hooks every call. Each suits different performance questions.

Understanding dependency groups in uv

Dependency groups in uv organize project and dev dependencies. Learn how dependency groups, optional dependencies, and extras differ and when to use each.

Understanding the Conda/Anaconda Ecosystem

How conda, Miniconda, Anaconda, and conda-forge fit together as a language-agnostic package management ecosystem for scientific computing.

uv init: project types, flags, and examples

uv init creates a new Python project with a pyproject.toml and project scaffold. Covers --app, --lib, --no-package, --bare, and --python flags.

What are Optional Dependencies and Dependency Groups?

Optional dependencies provide installable feature extras for end users, while dependency groups organize dev and test requirements.

What are Python entry points?

Learn how Python packages add terminal commands and tell apps like pytest where to find their plugins.

What are Python namespace packages?

Namespace packages let multiple distributions share one import package, which helps package families and plugin systems but adds coordination cost.

What Are uv Overrides and Constraints?

Control uv dependency resolution with overrides, constraints, and sources. Bypass version limits, enforce policies, or redirect package sources.

What changes when you run Python with -m?

Understand python -m versus running a file path, including package context, relative imports, sys.path, and package __main__.py files.

What do Python wheel compatibility tags mean?

Decode Python, ABI, and platform tags in wheel filenames, including abi3, manylinux, and musllinux, to understand which installs can work.

What is a .python-version file?

.python-version requests a Python interpreter for uv or pyenv. Learn how tool selection differs from shell commands and requires-python compatibility.

What is a build backend?

Libraries that turn source code into wheels and sdists. PEP 517 split building into frontends and backends with a standard hook API.

What is a build frontend?

A build frontend runs build backends to produce wheels and sdists, isolating build-time dependencies from your project by default.

What is a Dependency Cooldown?

A dependency cooldown ignores package versions published in the last few days, so malicious releases get caught before they reach your environment.

What is a lockfile?

A lockfile records resolved dependency versions and hashes for repeatable installations. Supported platforms may select different locked packages or builds.

What is a Python application?

A Python application is software users run to perform a task. Learn how application dependencies and delivery differ from a reusable library's.

What is a Python Interpreter?

What is a Python interpreter? Learn how it reads and executes Python code, manages versions, and fits into modern Python development workflows.

What is a Python language server?

A long-running process providing editors with autocomplete, hover docs, go-to-definition, and diagnostics. How they relate to type checkers.

What is a Python module?

Understand Python source, extension, and built-in modules, how packages relate to modules, and how Python finds and caches imports.

What is a Python package?

Python uses package for both importable code and installable distributions. Understand the difference, wheel and sdist formats, and when compilation is needed.

What Is a Python Supply Chain Attack?

Python supply chain attacks reach through packages, maintainer accounts, builds, or PyPI. Map attack categories to defenses.

What is a Virtual Environment?

A virtual environment is an isolated Python runtime that lets each project maintain its own dependencies and Python version.

What Is an Editable Install?

An editable install links a package's source code to the Python environment so code changes take effect without reinstalling.

What is CPython's JIT Compiler?

CPython's JIT: translates hot bytecode to native code via copy-and-patch at runtime. Targets 5-10% speedups without code changes.

What is PyPA (Python Packaging Authority)?

PyPA (Python Packaging Authority) is the working group that maintains core Python packaging tools like pip, setuptools, wheel, twine, and virtualenv.

What is PyPI (Python Package Index)?

PyPI is the official Python Package Index where developers publish and discover installable packages, installable via pip, uv, and other tools.

What is Python?

Python is a high-level, general-purpose programming language with a rich ecosystem of tools, organizations, and governance.

What is requires-python?

requires-python in pyproject.toml declares which Python versions your project supports. How uv and pip use it, how it differs from .python-version, and common mistakes.

What is the GIL?

The GIL allows one thread to execute bytecode at a time, preventing parallelism but simplifying internals.

What is the uv build backend (uv_build)?

uv's own build backend for pure Python packages. What it configures, what it refuses, and when to keep Hatchling.

What's the difference between a distribution package and an import package?

Distribution packages are what installers install; import packages are modules that contain submodules. Their names can differ: Pillow provides PIL.

When to Use `uv run` vs `uvx`

Use uv run to execute project code with your dependencies; use uvx to run standalone tools in isolation without your project's dependencies.

Tool Comparisons

How uv, Poetry, pip, pixi, and other tools differ in features and workflow

Do you still need tox or nox if you use uv?

uv runs tests across Python versions, but tox and nox add dependency matrices, parallel execution, and session orchestration for complex test workflows.

Does Ruff support type checking?

No. Ruff is a linter and formatter; it does not perform type inference. Use ty, mypy, Pyright, or Pyrefly alongside Ruff for type checking.

How do pyenv and uv compare for Python interpreter management?

pyenv focuses on Python version switching via shell shims, while uv integrates version management into a unified development toolkit.

How do Python type checkers compare?

Compare Python type checkers: mypy, pyright, ty, Pyrefly, Basedpyright, and Zuban. Defaults, inference, configuration, CI behavior, and recommendations.

How do Ruff and Pylint compare?

Use Ruff for fast linting and fixes. Keep Pylint for deeper inference, duplicate-code checks, or custom plugins.

How do uv and conda compare?

uv and conda solve different problems: uv installs PyPI wheels fast, conda manages cross-language binaries like CUDA and GDAL.

How do uv and Poetry compare?

uv and Poetry both manage Python projects and dependencies through pyproject.toml, but they differ in scope, speed, and standards alignment.

How do uv tool and pipx compare?

uv tool and pipx install Python CLI tools in isolated environments. uv is faster with better caching; pipx has more features. Compare for your use case.

pytest vs unittest: Which Should You Use?

pytest cuts unittest's boilerplate with plain assert and reusable fixtures, so tests are faster to write and easier to read.

Ruff vs Black: Which Python Formatter Should You Use?

Compare ruff format and Black on output differences, speed, and maintenance to decide whether to switch Python formatters.

Ruff vs flake8: Which Python Linter Should You Use?

Compare Ruff and flake8 on rule coverage, configuration, and speed to decide whether to switch Python linters.

src layout vs flat layout: which to use and why

Src layout reduces accidental checkout imports; test built wheels separately to verify package contents.

ty vs Pyrefly: which Python type checker should you pick?

Compare Pyrefly and ty on default diagnostics, inference, Pydantic, Django, editor integration, and migration tools.

uv vs pixi vs conda for Scientific Python

Choosing between uv, pixi, and conda for scientific computing and GPU workloads depends on whether your dependencies live on PyPI, conda-forge, or both.

What's the difference between pip and uv?

pip vs uv: compare Python package installation, dependency management, virtual environments, lockfiles, speed, and when to use each tool.

When should I choose pixi over uv?

Pixi vs uv: Choose pixi for conda packages and native libraries (R, C++). uv for pure Python projects.

Which Python documentation tool should I use?

Compare Great Docs, Sphinx, Zensical, and MkDocs for Python package documentation, API reference, Markdown authoring, and migration.

Which Python package manager should I use?

Use uv for new Python projects, keep working setups, and choose pixi when native libraries need to share an environment with Python dependencies.

Which Python profiler should I use?

Choose between Python's built-in sampler, py-spy, Austin, Scalene, and Pyinstrument for CPU, memory, async, and native-code investigations.

Standards & PEPs

PEP 8, 517, 621, 723, 735, and the standards that shape modern Python tooling

Understanding Python Dependency Specifiers

Learn to read Python dependency specifiers in pyproject.toml and requirements.txt, including version ranges, optional features, and platform conditions.

Versioning Python packages: SemVer, CalVer, and PEP 440

PEP 440 is the version grammar for Python packages. SemVer and CalVer are naming policies. Learn how they interact and pick a versioning scheme.

What Are Wheel Variants?

Wheel variants (PEP 817/825): ship hardware-specific builds under one wheel name. Let installers detect CPU, GPU, and pick the best.

What is a PEP?

Python Enhancement Proposals (PEPs) are formal documents that propose new features, collect community input, and record design decisions.

What is core metadata?

Standardized metadata describing a Python distribution: name, version, dependencies, classifiers. Stored in METADATA (wheel) or PKG-INFO (sdist).

What is PEP 484?

PEP 484: Python's optional type hints standard. Add type annotations for IDE autocomplete and type checker verification.

What is PEP 503?

PEP 503 defines the Simple Repository API that package indexes like PyPI implement for compatibility with pip and uv.

What is PEP 508?

PEP 508 defines the syntax for specifying Python package dependencies, with support for version constraints, extras, and environment markers.

What is PEP 517/518 compatibility?

PEP 517/518 replaced setup.py-only builds. PEP 518 introduced pyproject.toml; PEP 517 defined a standard build backend hook API.

What is PEP 541 (Package Index Name Retention)?

PEP 541 defines how PyPI reassigns an abandoned project name to a new owner, and the protections that stop a name being taken from a reachable maintainer.

What is PEP 561?

PEP 561 defines how packages ship type info: py.typed markers for inline annotations, -stubs packages for separate types.

What is PEP 604?

PEP 604 lets Python 3.10+ write union types with the pipe operator: int | str replaces Union[int, str], and int | None replaces Optional[int].

What is PEP 609?

PEP 609 establishes the governance model for the Python Packaging Authority, formalizing membership, decision making, and project lifecycle.

What is PEP 612?

PEP 612 adds ParamSpec and Concatenate to Python's typing system so decorators can preserve the signatures of the functions they wrap.

What is PEP 621?

PEP 621 defines the [project] table in pyproject.toml, standardizing package metadata across all build tools.

What is PEP 649?

PEP 649: Deferred type annotations in Python 3.14. Avoid runtime errors from forward references and complex types.

What is PEP 660?

PEP 660 standardizes how build backends implement editable installs, replacing the setuptools-only setup.py develop approach.

What is PEP 668?

PEP 668 marks system Python installations as externally managed, causing pip to refuse package installation outside a virtual environment.

What is PEP 681?

PEP 681's dataclass_transform marker tells type checkers a library's classes behave like dataclasses, eliminating the need for per-library checker plugins.

What is PEP 688?

PEP 688 types the buffer protocol. Learn why type checkers now reject bytearray where bytes is expected.

What is PEP 695?

PEP 695 adds Python 3.12 syntax for generics: class Box[T], def first[T], and type aliases without TypeVar or Generic base classes.

What is PEP 703?

PEP 703 adds a build configuration that lets CPython run without the Global Interpreter Lock, producing the free-threaded Python interpreter.

What is PEP 723?

Inline script metadata in Python files. PEP 723 lets uv, pipx, and other runners execute scripts with dependencies declared at the top.

What is PEP 735?

PEP 735: Dependency groups in pyproject.toml. Declare test, lint, docs deps separately from production.

What is PEP 740?

PEP 740 lets PyPI store signed attestations proving which CI workflow published each file. How attestations work and how to verify one.

What is PEP 751?

PEP 751 introduces pylock.toml, a standardized lockfile format for reproducible Python dependency installation.

What is PEP 772?

PEP 772 creates the Python Packaging Council. Understand new governance for packaging standards and the PyPA.

What is PEP 773?

PEP 773 introduces PyManager, a unified tool for installing and managing Python versions on Windows, replacing the traditional installer and py launcher.

What is PEP 779?

PEP 779 sets the criteria the free-threaded Python build had to meet before Python 3.14 could mark it officially supported.

What is PEP 8?

PEP 8 is Python's style guide. Compare its naming, spacing, import, and line-length rules in a quick reference and before/after example.

What is PEP 810?

PEP 810: lazy imports speed short-running CLIs by deferring module loads until first use. Long-running services see no startup benefit.

What is PEP 829 (Package Startup Configuration Files)?

PEP 829 closes the .pth import-line surface by splitting into two files: .pth for sys.path, .start for package startup entry points.

What is the Python typing conformance suite?

Learn what Python's typing conformance suite measures, how its weighted score works, and why the score is not a type-checker ranking.

Why pylock.toml Includes Digital Attestations

pylock.toml reserves a table for publisher identities. What it proves, why uv and pip leave it empty, and how to verify provenance today.

Coming From Another Language

Python tooling for engineers experienced with Go, Rust, TypeScript, Java, or C#

Why Python Tooling Looks Like This

Opinionated takes on packaging history, defaults, and recommended choices

Can you trust uv long-term?

uv is VC-funded and Astral was acquired by OpenAI. The dual MIT / Apache license and a forkable codebase make uv a defensible long-term bet anyway.

Do I need a project to use uv?

uv works without a project directory. Here are options for using uv with single-file scripts, script collections, and when each approach makes sense.

Does Poetry Support Python Standards for Dependency Management?

Poetry supports standard project metadata and dependency groups in pyproject.toml, with Poetry-specific settings for sources, plugins, and package discovery.

Is Conda actually free?

conda and conda-forge are free and open source. Anaconda's commercial repository requires a license for organizations with over 200 employees.

Should I run `python setup.py`?

Commands like python setup.py install and python setup.py sdist are deprecated. Use uv build or python -m build instead.

Should I use Homebrew to install Python?

Homebrew's Python exists to support other Homebrew tools and can break unexpectedly on upgrade. Use uv to manage Python instead.

Why are there so many Python packaging tools?

Python packaging tools overlap because building packages, installing dependencies, and managing project environments are separate jobs. Learn which choices matter.

Why doesn't Python just fix packaging?

Python's packaging is decentralized by design: each organization has its scope, so standards replaced unified tools.

Why Doesn't the Authoritative Python Packaging Guide Mention the Best Thing that's Happened to Python Packaging?

The Python Packaging User Guide omits uv because PyPA only documents its own tools, despite uv's widespread adoption.

Why Installing a Python Package Can Run Code

Python packages run code at install time, import time, and startup via .pth files. Supply chain attack surfaces and defense strategies.

Why should I avoid using the system Python?

Learn why to avoid system Python: global package installs can break OS tools and cause conflicts. Use uv or virtual environments instead.

Why should I choose Conda?

Conda manages non-Python dependencies that pip cannot, making it the right choice when your project depends on compiled libraries across languages.

Why Should I Choose pyproject.toml over requirements.txt for managing dependencies?

pyproject.toml or requirements.txt? Side-by-side comparison, when to use each, when to use both, and how to migrate.

Why should I use a virtual environment?

Virtual environments prevent dependency conflicts, protect system Python, and make projects reproducible across machines.

Why use native uv commands instead of uv pip

uv's native project interface integrates dependency declarations, lockfiles, and managed environments; uv pip keeps compilation and synchronization as separate steps.

Why Use Trusted Publishing for PyPI?

Trusted publishing for PyPI uses short-lived OIDC credentials instead of long-lived API tokens. CI-scoped security for package uploads.

Why You Should Try uv if You Use Python

Why uv combines dependency management, virtual environments, Python versions, and command-line tools, plus what to check before switching from pip.

Topic Deep Dives

Longer explorations of how Python tools work under the hood

Enough Git to Supervise Your AI Coding Agent

The mental model of Git and GitHub you need to understand what your AI coding agent is doing with version control.

How do I ship a Python application to end users?

A practical guide to the 2026 options for distributing Python applications: from uvx one-liners to freezer bundles to ONNX for ML.

How Does Hot Reloading Work in Python?

Python has no universal hot-reload convention. Instead, different tools and frameworks implement their own approaches to reloading code during development.

How mypy, ty, and Pyrefly handle untyped code

Compare unannotated-body checking, return inference, untyped imports, and configuration in mypy, ty, and Pyrefly.

How Python Package Formats Evolved: From tar.gz to .whl

The 25-year journey from distutils tarballs through eggs to wheels, and how each format solved one problem while creating the next.

How Python tools adopt uv under the hood

Hatch, PDM, pixi, tox, and other tools embed uv's resolver and installer as shared infrastructure, giving their users uv's speed without switching tools.

Modern Python Project Setup Guide for AI Assistants

Project setup instructions for coding agents: choose a uv layout, configure Python quality tools, and record reproducible setup and verification commands.

Running Python on Serverless

Compare Lambda, Cloud Run, Vercel, Modal, and other serverless platforms for uv projects. How uv and lockfiles change deployments.

What Happens When You Run `uv run`

What happens when you run `uv run`: project discovery, Python resolution, environment creation, locking, syncing, and command execution in six stages.

Why Installing GPU Python Packages Is So Complicated

Wheels can't express GPU requirements, so CUDA packages invent workarounds. How the ecosystem works and what wheel variants will change.

Why is Python Slow?

Why Python is slower than compiled languages: dynamic type lookups, attribute resolution, and boxed values. When optimization matters.

Last updated on