Reference

Last updated on 2026-02-15 | Edit this page

Glossary

Abstract Dependency
A dependency declaration with loose version constraints (e.g., numpy>=1.20) as found in pyproject.toml, maximizing compatibility with other packages.
Artifact
A file produced by the build process, typically a source distribution (.tar.gz) or a wheel (.whl).
Build Backend
The tool that converts source code into installable artifacts (e.g., hatchling, meson-python, setuptools, uv_build).
Build Frontend
The tool that invokes the build backend (e.g., uv build, pip wheel, python -m build).
cibuildwheel
A tool that builds binary wheels for multiple platforms using CI services such as GitHub Actions.
Concrete Dependency
An exact, pinned version of a package (e.g., numpy==2.1.0) as recorded in a lockfile, ensuring reproducibility.
conda-forge
A community-maintained channel of conda packages providing both Python libraries and system-level binaries.
Constraint Satisfaction
The process a package manager uses to find a set of dependency versions that simultaneously satisfy all requirements without conflicts.
Continuous Integration (CI)
The practice of automatically running tests and checks on every code push, typically using a service like GitHub Actions.
Dependency Group
A named set of dependencies in pyproject.toml (e.g., dev, docs) that can be installed selectively. Defined by PEP 735.
Editable Install
An installation mode (uv pip install -e .) where changes to source code are immediately reflected without reinstalling.
F2PY
A tool (part of NumPy) that generates Python bindings for Fortran subroutines, producing C wrapper code and shared objects.
GitHub Actions
A CI/CD platform integrated into GitHub that runs workflows defined in YAML files on push, pull request, or other events.
Inline Script Metadata
A PEP 723 feature that embeds dependency declarations directly in a Python script using a special comment block (# /// script).
Lockfile
A file (e.g., uv.lock) that pins the exact versions of all direct and transitive dependencies for reproducibility.
Manylinux
A standard that defines a minimal set of Linux system libraries a binary wheel may depend on, ensuring broad compatibility across distributions.
Matrix Strategy
A CI configuration that runs the same job across multiple combinations of parameters (e.g., Python versions and operating systems).
Meson
A build system used for compiling C, C++, and Fortran code into shared libraries. Used by NumPy and SciPy.
meson-python
A PEP 517 build backend that integrates the Meson build system with Python packaging, enabling compiled extensions in wheels.
Module
A single .py file that can be imported.
News Fragment
A small text file (e.g., news/42.feature) used by towncrier to record a single changelog entry, avoiding merge conflicts.
OIDC (Trusted Publishing)
An authentication method allowing GitHub Actions to publish to PyPI without storing API tokens, using OpenID Connect identity verification.
Package
A directory containing an __init__.py file (and usually other modules), making it importable as a unit.
PEP
Python Enhancement Proposal. A design document that describes a new feature or standard for Python. Key PEPs in this lesson: 518, 517, 621, 668, 723, 735, 751.
pixi
A cross-platform package manager for managing system dependencies and task automation via conda-forge.
Pixibang
A shebang line (#!/usr/bin/env -S pixi exec ... -- uv run) that chains pixi and uv to provide both system binaries and Python packages for a single script.
prek
A Rust rewrite of the pre-commit tool for running git hooks that enforce code quality checks before commits.
Pre-commit Hook
A git hook that runs automated checks (linting, formatting) before a commit is finalized, preventing bad code from entering the repository.
pyproject.toml
The standard configuration file for Python projects (PEP 621), replacing setup.py and setup.cfg.
PyPI
The Python Package Index, the default repository for Python packages.
pytest
A testing framework for Python that discovers and runs test functions, providing detailed failure reports.
ruff
An extremely fast Python linter and formatter written in Rust, replacing flake8, black, and isort.
Shadowing
When a local file has the same name as a standard library module (e.g., math.py), causing Python to import the local file instead.
Shared Object
A compiled binary (.so on Linux, .dylib on macOS, .dll on Windows) that Python can load as an extension module.
Shebang
The first line of a script (starting with #!) that tells the operating system which interpreter to use to execute the file.
Source Distribution (sdist)
A compressed archive of the source code (.tar.gz) that requires a build step before installation.
Sphinx
The standard documentation generator for Python projects, converting reStructuredText or Markdown into HTML, PDF, or other formats.
src Layout
A project structure where the package source lives under a src/ directory, preventing accidental imports from the project root.
sys.path
The list of directories Python searches when resolving import statements.
Test PyPI
A separate instance of PyPI (test.pypi.org) used for testing package uploads without affecting the production index.
towncrier
A tool for managing changelogs using per-change fragment files to avoid merge conflicts.
Transitive Dependency
A package that is not directly required by your project but is pulled in as a dependency of one of your direct dependencies.
uv
A fast Python package installer and project manager from Astral, written in Rust.
uvx
A tool runner from uv that fetches and executes a command-line tool in an ephemeral environment without permanent installation.
Virtual Environment
An isolated Python environment with its own site-packages directory, preventing dependency conflicts between projects.
Wheel
A binary distribution format (.whl) that can be installed without a build step. It is essentially a ZIP archive with a standardized layout.

Key Commands

uv Commands

Command Description
uv init --lib Create a new library project with src layout
uv add <package> Add a runtime dependency
uv add --dev <package> Add a development dependency
uv add --group docs <pkg> Add a dependency to a named group
uv sync --dev Install all dependencies including dev
uv run <command> Run a command in the project environment
uv build Build sdist and wheel into dist/
uv pip install -e . Install the project in editable mode
uv python install 3.12 Install a specific Python version
uvx twine upload dist/* Upload artifacts to PyPI
uvx <tool> Run a tool in an ephemeral environment

pixi Commands

Command Description
pixi init Initialize a new pixi project
pixi add <package> Add a conda dependency
pixi run <task> Run a defined task
pixi exec --spec <pkg> -- <cmd> Run a command with a package available

ruff Commands

Command Description
ruff check . Lint the current directory
ruff check --fix . Lint and auto-fix issues
ruff format . Format code according to style rules
ruff format --check . Check formatting without modifying files

pytest Commands

Command Description
pytest Run all tests in the tests/ directory
pytest --cov=src Run tests with code coverage reporting
pytest -v Run tests with verbose output
pytest tests/test_file.py Run tests from a specific file

towncrier Commands

Command Description
towncrier create <num>.<type> Create a changelog fragment (e.g., 1.feature, 2.bugfix)
towncrier build --version X.Y.Z Compile fragments into the changelog
towncrier build --yes Compile fragments without confirmation

prek Commands

Command Description
prek Run all configured pre-commit hooks
prek install Install hooks into .git/hooks/

f2py / Meson Commands

Command Description
f2py -c file.f90 -m modname Compile Fortran into a Python extension
f2py -c file.f90 -m modname --build-dir out Compile with intermediate files visible

Sphinx Commands

Command Description
sphinx-quickstart Initialize a docs directory
sphinx-build -b html docs/source docs/build/html Build HTML documentation