Skip to main content

A command line utility to check for obsolete, missing and transitive dependencies in a poetry managed python project.

Project description

deptry

Release Build status Supported Python versions PyPI - Downloads License


deptry is a command line tool to check for issues with dependencies in a poetry managed Python project. It checks for four types of issues:

  • Obsolete dependencies: Dependencies which are added to your project's dependencies, but which are not used within the codebase.
  • Missing dependencies: Modules that are imported within your project, but no corresponding package is found in the environment.
  • Transitive dependencies: Packages from which code is imported, but the package (A) itself is not in your projects dependencies. Instead, another package (B) is in your list of dependencies, which depends on (A). Package (A) should be added to your project's list of dependencies.
  • Misplaced dependencies: Development dependencies that should be included as regular dependencies.

deptry detects these issues by scanning the imported modules within all Python files in a directory and its subdirectories, and comparing those to the dependencies listed in pyproject.toml.


Documentation: https://fpgmaas.github.io/deptry/


Quickstart

Installation

deptry can be added to your project with

poetry add --group dev deptry

or for older versions of poetry:

poetry add --dev deptry

Warning deptry is still in the early phases of development. Although we will do our best not to introduce any backwards-incompatible changes, at this stage this can not be guaranteed. For one-off testing of your project's dependencies, this is no issue. However, if you plan to use deptry in a CI/CD pipeline, it is a good idea to pin the version.

Prerequisites

In order to check for obsolete imports, deptry requires a pyproject.toml file to be present in the directory passed as the first argument, and it requires the corresponding environment to be activated.

Usage

To scan your project for obsolete imports, run

deptry .

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 documentation.


Repository initiated with fpgmaas/cookiecutter-poetry.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deptry-0.2.13.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deptry-0.2.13-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file deptry-0.2.13.tar.gz.

File metadata

  • Download URL: deptry-0.2.13.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.9.7 Linux/5.15.0-1019-azure

File hashes

Hashes for deptry-0.2.13.tar.gz
Algorithm Hash digest
SHA256 fb1455bb4cfa46566449ffbea5aa4c35149d4ec67018a88926b1a6d8322f0f94
MD5 b4cfd34ffaa6df8c6e55ef7f1013be34
BLAKE2b-256 3bd17404316490c2be3132e64bad20d5d516c251552a305afe890b4cc1290857

See more details on using hashes here.

File details

Details for the file deptry-0.2.13-py3-none-any.whl.

File metadata

  • Download URL: deptry-0.2.13-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.9.7 Linux/5.15.0-1019-azure

File hashes

Hashes for deptry-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 87b00212785e592167efa81b2878549f4bda48a0cbd68872bdfd54bcc1d5c8d5
MD5 ede7b28d971085fcf2603e4306f1e137
BLAKE2b-256 63c7e6c1619ab524168d3d97cb4e368c4329f1dad727d658a3fbc0f46c5b72ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page