Python Dependency Lens
See outdated Python dependencies at a glance and upgrade them with a single click.
Python Dependency Lens enhances your pyproject.toml editing experience by showing the latest PyPI version inline next to each dependency and providing one-click upgrade buttons. It works with uv, pip, and auto-detects your preferred package manager.

Features
🔍 Inline Version Hints
- See the latest version from PyPI displayed directly next to each dependency
- Green checkmark ✓ for up-to-date packages
- Orange arrow ⬆ for outdated packages with the latest version shown
- Warning icon ⚠ when a version can't be fetched
- Info icon ℹ for dependencies without a pinned version
⚡ One-Click Upgrades via CodeLens
- Click the "Upgrade to X.Y.Z" button that appears above each outdated dependency
- Automatically updates the version in
pyproject.toml AND runs the install command
- Upgrade All button in the editor title bar to update everything at once
📦 Smart Package Manager Detection
- Auto-detect: Checks for
uv.lock, then checks if uv is installed, falls back to pip
- Manual override: Configure to always use
uv or pip
- Runs the appropriate command:
uv add or pip install
📊 Package Info Panel
- Click the Info CodeLens to see detailed package information
- Shows: version, summary, author, license, homepage, PyPI link
- Concurrent PyPI API requests (configurable, default 8)
- Smart caching with configurable TTL (default 30 minutes)
- Request deduplication for simultaneous lookups
- Debounced updates on document changes
Python Dependency Lens supports all common pyproject.toml dependency formats:
PEP 621 (Standard)
[project]
dependencies = [
"requests>=2.28.0",
"flask",
"numpy~=1.24",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"black",
]
Poetry
[tool.poetry.dependencies]
requests = "^2.28.0"
flask = {version = "^2.0", optional = true}
[tool.poetry.dev-dependencies]
pytest = "^7.0"
PDM
[tool.pdm.dev-dependencies]
dev = [
"pytest>=7.0",
]
PEP 735 Dependency Groups
[dependency-groups]
test = [
"pytest>=7.0",
]
Configuration
| Setting |
Default |
Description |
pythonDepLens.enabled |
true |
Enable/disable the extension |
pythonDepLens.packageManager |
"auto" |
Package manager: auto, uv, or pip |
pythonDepLens.cacheTTLMinutes |
30 |
Cache duration for PyPI lookups (minutes) |
pythonDepLens.showUpgradeCodeLens |
true |
Show upgrade CodeLens buttons |
pythonDepLens.showStatusBarItem |
true |
Show status bar summary |
pythonDepLens.decorationStyle |
"both" |
Display style: inline, codelens, or both |
pythonDepLens.pypiRegistryUrl |
"https://pypi.org/pypi" |
Custom PyPI registry URL |
pythonDepLens.concurrentRequests |
8 |
Max concurrent PyPI API requests |
Commands
| Command |
Description |
Python Dep Lens: Refresh Dependency Versions |
Re-fetch all versions from PyPI |
Python Dep Lens: Upgrade Dependency |
Upgrade a specific dependency |
Python Dep Lens: Upgrade All Dependencies |
Upgrade all outdated dependencies |
Python Dep Lens: Clear Version Cache |
Clear the cached version data |
Python Dep Lens: Show Dependency Info |
Show package details in a panel |
Requirements
- VS Code 1.108.0 or later
- Python package manager:
uv (recommended) or pip
- Internet access to query PyPI
Installation
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Search for "Python Dependency Lens"
- Click Install
Usage
- Open any
pyproject.toml file
- Dependencies are automatically annotated with their latest versions
- Click "Upgrade to X.Y.Z" on any outdated dependency
- Use the refresh button in the editor title bar to re-fetch versions
- Use "Upgrade All Dependencies" to update everything at once
License
MIT