https://github.com/zbowling/depwise
A fast, comprehensive dependency analyzer for Python that detects unused, missing, and optional dependencies.
https://github.com/zbowling/depwise
linter python-tools rust tools
Last synced: 5 months ago
JSON representation
A fast, comprehensive dependency analyzer for Python that detects unused, missing, and optional dependencies.
- Host: GitHub
- URL: https://github.com/zbowling/depwise
- Owner: zbowling
- License: mit
- Created: 2025-03-19T20:19:53.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-23T06:15:30.000Z (9 months ago)
- Last Synced: 2025-07-10T12:13:40.015Z (6 months ago)
- Topics: linter, python-tools, rust, tools
- Language: Rust
- Homepage:
- Size: 181 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Depwise
> Depwise is pre-alpha software. It is not ready.
A fast, comprehensive dependency analyzer for Python projects that detects unused, missing, and optional dependencies across multiple environments. Supports requirements.txt, conda, pyproject.toml, pixi, and setup.py without requiring installation. Features intelligent pattern detection for optional dependencies, synthetic fast-pass analysis, and validation against actual environments. Designed for pre-commit hooks and CI/CD pipelines.

## Usage
To check a project, you can use the `depwise check` command.
```bash
# Check a project using a pyproject.toml file
depwise check --project
# Check a project using a requirements.txt file. Explictly treat the path as a module and not recursively check subdirectories.
depwise check --requirements --module
# Check a project using a conda environment file. Explictly treat the path as a project and recursively check subdirectories.
depwise check --condayml --project
```
To check source code in the currently active Python environment, you can use the `depwise check` command with the `--current` flag.
```bash
depwise check --current
```
To check a wheel, sdist, or conda package, you can use the `depwise check-package` command.
```bash
depwise check-package
```
## Configuration
To make it easier to test multiple environments, Depwise can be configured using a `depwise.toml` or `pyproject.toml` (using the `[tool.depwise]` prefix) file.
```toml
[depwise]
# Ignore these module imports
# Configure a project
[depwise.project.my-project]
type = "pyproject" # or "requirements", "conda", "pixi"
# We will try to infer the path from the type given common conventions,
# but you can specify it here
project = "path/to/pyproject.toml"
# Test with and without specified optional-dependencies/extras
extras = ["*"] # or specify a list of extras to test ["extra1", "extra2"]
# Array of paths to sources to check
source = ["path/to/source"]
# List of regexes to ignore imports matching these patterns
ignore = ["^test_.*"]
# Ignore modules by name
ignore-imports = ["dep1", "dep2"]
[depwise.package.default]
# Test with and without specified optional-dependencies/extras
extras = ["*"] # or specify a list of extras to test ["extra1", "extra2"]
# List of regexes to ignore imports matching these patterns
ignore = ["^test_.*"]
# Ignore modules by name
ignore-imports = ["dep1", "dep2"]
```