Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fpgmaas/deptry
Find unused, missing and transitive dependencies in a Python project.
https://github.com/fpgmaas/deptry
cicd dependencies pep621 poetry python rust
Last synced: 9 days ago
JSON representation
Find unused, missing and transitive dependencies in a Python project.
- Host: GitHub
- URL: https://github.com/fpgmaas/deptry
- Owner: fpgmaas
- License: mit
- Created: 2022-09-01T07:35:36.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-26T15:00:39.000Z (13 days ago)
- Last Synced: 2024-10-27T17:54:03.604Z (12 days ago)
- Topics: cicd, dependencies, pep621, poetry, python, rust
- Language: Python
- Homepage: https://deptry.com/
- Size: 2.41 MB
- Stars: 903
- Watchers: 6
- Forks: 19
- Open Issues: 38
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/contributing.md
- License: LICENSE
- Support: docs/supported-dependency-managers.md
Awesome Lists containing this project
- awesome-pyproject - deptry - A command line tool to check for issues with dependencies in a Python project, such as obsolete or missing dependencies. (Code Analysis)
README
[![Release](https://img.shields.io/github/v/release/fpgmaas/deptry)](https://pypi.org/project/deptry/)
[![Build status](https://github.com/fpgmaas/deptry/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/fpgmaas/deptry/actions/workflows/main.yml)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/deptry)](https://pypi.org/project/deptry/)
[![codecov](https://codecov.io/gh/fpgmaas/deptry/branch/main/graph/badge.svg)](https://codecov.io/gh/fpgmaas/deptry)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/deptry)](https://pypistats.org/packages/deptry)
[![License](https://img.shields.io/github/license/fpgmaas/deptry)](https://img.shields.io/github/license/fpgmaas/deptry)_deptry_ is a command line tool to check for issues with dependencies in a Python project, such as unused or missing
dependencies. It supports projects
using [Poetry](https://python-poetry.org/), [pip](https://pip.pypa.io/), [PDM](https://pdm-project.org/), [uv](https://docs.astral.sh/uv/),
and more generally any project supporting [PEP 621](https://peps.python.org/pep-0621/) specification.Dependency issues are detected by scanning for imported modules within all Python files in a directory and its
subdirectories, and comparing those to the dependencies listed in the project's requirements.---
---
## Quickstart
### Installation
To add _deptry_ to your project, run one of the following commands:
```shell
# Install with poetry
poetry add --group dev deptry# Install with pip
pip install deptry
```> **Warning**: When using pip to install _deptry_, make sure you install it within the virtual environment of your project. Installing _deptry_ globally will not work, since it needs to have access to the metadata of the packages in the virtual environment.
### Prerequisites
_deptry_ should be run within the root directory of the project to be scanned, and the project should be running in its own dedicated virtual environment.
### Usage
To scan your project for dependency issues, run:
```shell
deptry .
```Example output could look as follows:
```console
Scanning 2 files...foo/bar.py:1:0: DEP004 'numpy' imported but declared as a dev dependency
foo/bar.py:2:0: DEP001 'matplotlib' imported but missing from the dependency definitions
pyproject.toml: DEP002 'pandas' defined as a dependency but not used in the codebase
Found 3 dependency issues.
```### Configuration
_deptry_ can be configured by using additional command line arguments, or by adding a `[tool.deptry]` section in _pyproject.toml_. For more information, see the [Usage and Configuration](https://deptry.com/usage/) section of the documentation..
---
Repository initiated with [fpgmaas/cookiecutter-poetry](https://github.com/fpgmaas/cookiecutter-poetry).