Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mkdocstrings/python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.6
Choose a base ref
...
head repository: mkdocstrings/python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.0.7
Choose a head ref
  • 2 commits
  • 8 files changed
  • 2 contributors

Commits on Aug 17, 2026

  1. fix: Don't render environment paths in source block labels

    When an object's file lives in a virtual environment inside the current working directory (for example a pydantic `BaseModel` subclass documented with `preload_modules: [pydantic]` and an in-project `.venv`), source blocks were labeled with the environment path, like `.venv/lib/python3.10/site-packages/pydantic/main.py`.
    
    The path is relative to the current working directory, so it slipped past the `is_absolute()` check that normally keeps environment paths out of rendered docs.
    
    Add a `source_location` filter that strips everything up to and including a `site-packages` directory from displayed source paths, and use it for every source block label: merged `__init__`, class, and function, in both themes. 
    
    Centralizing the logic also fixes the label for single-file modules installed directly in `site-packages` (like `six.py`), whose package-relative path still contained the environment directory. Labels of objects belonging to the documented package itself are unchanged.
    
    Issue-333: #333
    PR-338: #338
    cdwilson authored Aug 17, 2026
    Configuration menu
    Copy the full SHA
    84ba73e View commit details
    Browse the repository at this point in the history
  2. chore: Prepare release 2.0.7

    pawamoy committed Aug 17, 2026
    Configuration menu
    Copy the full SHA
    624974a View commit details
    Browse the repository at this point in the history
Loading