19 releases (7 breaking)
Uses new Rust 2024
| new 0.9.1 | Mar 4, 2026 |
|---|---|
| 0.8.0 | Feb 23, 2026 |
| 0.5.2 | Dec 27, 2025 |
#553 in Text editors
Used in deps-lsp
390KB
8K
SLoC
deps-pypi
PyPI/Python support for deps-lsp.
This crate provides parsing and registry integration for Python's PyPI ecosystem.
Features
- PEP 621 Support — Parse
[project.dependencies]and[project.optional-dependencies] - PEP 735 Support — Parse
[dependency-groups](new standard) - Poetry Support — Parse
[tool.poetry.dependencies]and groups - Lock File Parsing — Extract resolved versions from
poetry.lockanduv.lock - PEP 508 Parsing — Handle complex dependency specifications with extras and markers
- PEP 440 Versions — Validate and compare Python version specifiers
- PyPI API Client — Fetch package metadata from PyPI JSON API
- EcosystemHandler — Implements
deps_core::EcosystemHandlertrait
Usage
[dependencies]
deps-pypi = "0.5"
use deps_pypi::{parse_pyproject_toml, PyPiRegistry};
let dependencies = parse_pyproject_toml(content)?;
let registry = PyPiRegistry::new(cache);
let versions = registry.get_versions("requests").await?;
Supported Formats
PEP 621 (Standard)
[project]
dependencies = [
"requests>=2.28.0,<3.0",
"flask[async]>=3.0",
]
[project.optional-dependencies]
dev = ["pytest>=7.0", "mypy>=1.0"]
PEP 735 (Dependency Groups)
[dependency-groups]
test = ["pytest>=7.0", "coverage"]
dev = [{include-group = "test"}, "mypy>=1.0"]
Poetry
[tool.poetry.dependencies]
python = "^3.9"
requests = "^2.28.0"
[tool.poetry.group.dev.dependencies]
pytest = "^7.0"
Benchmarks
cargo bench -p deps-pypi
Parsing performance: ~5μs for PEP 621, ~8μs for Poetry format.
License
Dependencies
~18–29MB
~415K SLoC