• Stars
    star
    895
  • Rank 51,027 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 2 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Find unused, missing and transitive dependencies in a Python project.

deptry logo

Release Build status Supported Python versions codecov PyPI - Downloads License

deptry is a command line tool to check for issues with dependencies in a Python project, such as unused or missing dependencies. It supports the following types of projects:

  • Projects that use Poetry and a corresponding pyproject.toml file
  • Projects that use PDM and a corresponding pyproject.toml file
  • Projects that use a requirements.txt file according to the pip standards

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.


Documentation - Contributing


Quickstart

Installation

To add deptry to your project, run one of the following commands:

# 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:

deptry .

Example output could look as follows:

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 section of the documentation..


Repository initiated with fpgmaas/cookiecutter-poetry.

More Repositories

1

cookiecutter-poetry

A modern cookiecutter template for Python projects that use Poetry for dependency management
Python
372
star
2

cookiecutter-uv

A modern cookiecutter template for Python projects that use uv for dependency management
Python
279
star
3

ckit

A command line utility to help you organise and quickly run frequently used commands.
Python
65
star
4

simple-homepage

command line utility that helps you create a personal homepage for your browser.
Python
65
star
5

pypi-scout

Find Python Packages on PyPI with the help of vector embeddings
Python
41
star
6

cookiecutter-poetry-example

An example of a project generated with cookiecutter-poetry.
Makefile
14
star
7

stream-iot

An end-to-end workflow for processing streaming data on Azure.
Python
10
star
8

cookiecutter-pdm

A modern cookiecutter template for Python projects that use PDM for dependency management
Python
8
star
9

aws-cdk-py-docker-lambdas

A repository that contains code to deploy multiple lambdas with one single Docker image using AWS CDK
TypeScript
7
star
10

rotterdam-marathon

Some R code that webscrapes the results of the 2018 Rotterdam marathon and visualizes it by means of a timelapse.
R
6
star
11

poems

Code that analyzes the poetry by /u/poem_for_your_sprog on Reddit. The result is available at https://fpgmaas.com.
Jupyter Notebook
5
star
12

sporthive-api-scraper

Python code to scrape results from Sporthive events
Python
3
star
13

ckit-files

This repository contains configuration files that can be used to get you started with ckit.
3
star
14

map-nl

A Python package to help you quickly create PC4 maps of the Netherlands.
Python
3
star
15

cookiecutter-uv-example

An example of a project generated with cookiecutter-uv
Makefile
2
star
16

cloudrun-example-infra

Example Terraform project used in the blogpost 'Deploying a Flask API to Google Cloud Run using Terraform'
HCL
2
star
17

azure-terraform-github-actions

HCL
2
star
18

cloudrun-example-api

An example API used in the blogpost 'Deploying a Flask API to Google Cloud Run using Terraform'
Dockerfile
2
star
19

fpgmaas.com

My personal website. Developed in Gatsby.
JavaScript
2
star
20

databricks-sdk-example

Python
1
star
21

deptry-benchmark

Python
1
star
22

squadsub

Python code that helps you optimize your substitution strategy during a match
Python
1
star
23

timelapse

Use your RaspberryPi in combination with a webcam to create a timelapse.
Python
1
star
24

azure-airflow-kubernetes

Example code to deploy Kubernetes and Airflow on Azure
HCL
1
star