Skip to main content

A command line utility to check for unused, missing and transitive dependencies in a Python project.

Project description

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 projects using Poetry, pip, PDM, uv, and more generally any project supporting PEP 621 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.


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.

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.24.0.tar.gz (440.2 kB view details)

Uploaded Source

Built Distributions

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

deptry-0.24.0-pp311-pypy311_pp73-win_amd64.whl (1.6 MB view details)

Uploaded PyPyWindows x86-64

deptry-0.24.0-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl (2.0 MB view details)

Uploaded PyPymusllinux: musl 1.1+ x86-64

deptry-0.24.0-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl (2.0 MB view details)

Uploaded PyPymusllinux: musl 1.1+ ARM64

deptry-0.24.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

deptry-0.24.0-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

deptry-0.24.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded PyPymacOS 11.0+ ARM64

deptry-0.24.0-pp311-pypy311_pp73-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded PyPymacOS 10.12+ x86-64

deptry-0.24.0-cp39-abi3-win_arm64.whl (1.6 MB view details)

Uploaded CPython 3.9+Windows ARM64

deptry-0.24.0-cp39-abi3-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

deptry-0.24.0-cp39-abi3-musllinux_1_1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.1+ x86-64

deptry-0.24.0-cp39-abi3-musllinux_1_1_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.1+ ARM64

deptry-0.24.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

deptry-0.24.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

deptry-0.24.0-cp39-abi3-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

deptry-0.24.0-cp39-abi3-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: deptry-0.24.0.tar.gz
  • Upload date:
  • Size: 440.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for deptry-0.24.0.tar.gz
Algorithm Hash digest
SHA256 852e88af2087e03cdf9ece6916f3f58b74191ab51cc8074897951bd496ee7dbb
MD5 dad89331bf461a2d12941119b4f8e7fd
BLAKE2b-256 58aa5cae0f25a2ac5334d5bd2782a6bcd80eecf184f433ff74b2fb0387cfbbb6

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 03d375db3e56821803aeca665dbb4c2fd935024310350cc18e8d8b6421369d2b
MD5 aa776d49a753969b97ba471952d23276
BLAKE2b-256 18b868d6ca1d8a16061e79693587560f6d24ac18ba9617804d7808b2c988d9d5

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 68d90735042c169e2a12846ac5af9e20d0ad1a5a7a894a9e4eb0bd8f3c655add
MD5 68599faa7a91e0e32e7f165c9d090bb8
BLAKE2b-256 e965f33e882d743eda90a7f12515f774be08bdf244520298d259ed9be687e5fe

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 5152ffa478e62f9aea9df585ce49d758087fd202f6d92012216aa0ecad22c267
MD5 265a2b17901a740ad5098dda7826c528
BLAKE2b-256 03c7c3180784855e702aa5fa94c88a4bda3c5364860606dccc13ba86bf45ee90

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 841bf35d62e1facc0c244b9430455705249cc93552ed4964d367befe9be6a313
MD5 2cd3fbc390d4b565aad9eb55991b077d
BLAKE2b-256 4187cac78e750401621a4abf4e724a1f6dd141e0005a33790bda282b275d1359

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3a047e53b76c36737f8bb392bb326fb66c6af4bedafeaa4ad274c7ed82e91862
MD5 496e29df61b528380e1e612a79d522b5
BLAKE2b-256 ee83a52c838fb65929c5589866943348931f2baa22a1051dc7b9c29f4d37dc5d

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4267d74a600ac7fdd05a0d3e219c9386670db0d3bb316ae7b94c9b239d1187cb
MD5 2f09a1f98077847f0b492db5e014c05a
BLAKE2b-256 dd5f225a920799b601611e6089603ab3521a8f4f7e06bb36a2a08e95fbb68863

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-pp311-pypy311_pp73-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-pp311-pypy311_pp73-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6ae96785aaee5540c144306506f1480dcfa4d096094e6bd09dc8c9a9bfda1d46
MD5 bdfd8ae9a1206c7f6a63d5116b864313
BLAKE2b-256 05c31f2b6afca508a9abcd047c5b4ef69a5fc023a204097cd32cea3de261aa57

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-cp39-abi3-win_arm64.whl.

File metadata

  • Download URL: deptry-0.24.0-cp39-abi3-win_arm64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.9+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for deptry-0.24.0-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 ea58709e5f3aa77c0737d8fb76166b7703201cf368fbbb14072ccda968b6703a
MD5 e2e93d18dd4def5b50afd4ef49424cf2
BLAKE2b-256 39696ec1e18e27dd6f80e4fb6c5fc05a6527242ff83b81c0711d0ba470e9a144

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: deptry-0.24.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for deptry-0.24.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 94b354848130d45e16d3a3039ae8177bce33828f62028c4ff8f2e1b04f7182ba
MD5 ae73c5d90cd4cdfc50180e742ad75bd4
BLAKE2b-256 35e423dcbc505f6f35c70ba68015774cf891ceda080331d7fd6d75e84ada9f73

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-cp39-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-cp39-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 92bd8d331a5a6f8e6247436bc6fe384bcf86a8d69fe33442d195996fb9b20547
MD5 61153a79271f611017a324cda389250e
BLAKE2b-256 1b080eac3c72a9fd79a043cc492f3ba350c47a7be2160288353218b2c8c1bf3a

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-cp39-abi3-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-cp39-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 0fbe50a2122d79cec53fdfd73a7092c05f316555a1139bcbacf3432572675977
MD5 574f331da043fe120ef0c0d44cb80f24
BLAKE2b-256 f56c4b972b011a06611e0cf8f4bb6bc04a3d0f9c651950ad9abe320fcbac6983

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd22fa2dbbdf4b38061ca9504f2a6ce41ec14fa5c9fe9b0b763ccc1275efebd5
MD5 e5602f0abe68e210160861b5dab481bd
BLAKE2b-256 ab28960c311aae084deef57ece41aac13cb359b06ce31b7771139e79c394a1b7

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6ddfedafafe5cbfce31a50d4ea99d7b9074edcd08b9b94350dc739e2fb6ed7f9
MD5 4229144e574847e80ab6eb39f79578be
BLAKE2b-256 4ae2af81dfd46b457be9e8ded9472872141777fbda8af661f5d509157b165359

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00ec34b968a13c03a5268ce0211f891ace31851d916415e0a748fae9596c00d5
MD5 5816c30684669528a1f42b7cac2bdc0c
BLAKE2b-256 32b61dcc011fc3e6eec71601569c9de3215530563412b3714fba80dcd1a88ec8

See more details on using hashes here.

File details

Details for the file deptry-0.24.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for deptry-0.24.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a575880146bab671a62babb9825b85b4f1bda8aeaade4fcb59f9262caf91d6c7
MD5 33a2a73cf1070b4e5e0257c774207e19
BLAKE2b-256 215ac1552996499911b6eabe874a994d9eede58ac3936d7fe7f865857b97c03f

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