A command line utility to check for unused, missing and transitive dependencies in a Python project.
Project description
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.
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
Built Distributions
File details
Details for the file deptry-0.21.1.tar.gz
.
File metadata
- Download URL: deptry-0.21.1.tar.gz
- Upload date:
- Size: 156.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60332b8d58d6584b340511a4e1b694048499f273d69eaea413631b2e8bc186ff |
|
MD5 | dd04699b041f8d6da1e07696451c1b19 |
|
BLAKE2b-256 | 7fc2392a8ca053ff59d1f9c700cab00d8720cea809aa2634189ccfe17c52f3f0 |
File details
Details for the file deptry-0.21.1-pp310-pypy310_pp73-win_amd64.whl
.
File metadata
- Download URL: deptry-0.21.1-pp310-pypy310_pp73-win_amd64.whl
- Upload date:
- Size: 1.6 MB
- Tags: PyPy, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1adf29a5aa1d33d9e1140b9235b212d9753278604b4389b2186f638692e29876 |
|
MD5 | 59f0ad8a30e8df068c6aca7cadd5d07a |
|
BLAKE2b-256 | b203e509fb94cebb72eae52a1011da68703b5f7582bee5a606ac51d8b0e41f7b |
File details
Details for the file deptry-0.21.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: deptry-0.21.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 091288cad2bd6029995d2e700e965cd574079365807f202ee232e4be0a571f43 |
|
MD5 | ac2683fa103409e0215d247215bdf70b |
|
BLAKE2b-256 | 3bfedcb82c7092696dbab2664ed91070882342722f47ed36b2fd0cb834ed78c9 |
File details
Details for the file deptry-0.21.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: deptry-0.21.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e487f520d4fbee513f4767ab98334a29d5d932f78eb413b64e27c977f2bf2756 |
|
MD5 | 6f510db05533e24370bf5bce21a6580f |
|
BLAKE2b-256 | f717939c360fc41f13a400702eef1bbef0e9cef32dfd7846b080de1e7ba63bdf |
File details
Details for the file deptry-0.21.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl
.
File metadata
- Download URL: deptry-0.21.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.6 MB
- Tags: PyPy, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 145a172ea608bb86dd93a9d14f7d45ed8649a36d7f685ea725e0348cbf562f10 |
|
MD5 | 1e369802905d32ceccfe4dabe8256204 |
|
BLAKE2b-256 | 5aab6ae5c67d78bb216a9e1822c3b28441c55b792b45a3c949f2f436040bd88f |
File details
Details for the file deptry-0.21.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: deptry-0.21.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: PyPy, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79593d7631cdbbc39d76503e3af80e46d8b4873e915b85c1567a04c81e8a17d5 |
|
MD5 | 5f05545d39f2f75111b0b2eb969ae86d |
|
BLAKE2b-256 | ee77cbf5dfec0be9fe2a869cff092a2a3c49c2548b8125322dd3988637eb9fd6 |
File details
Details for the file deptry-0.21.1-cp39-abi3-win_arm64.whl
.
File metadata
- Download URL: deptry-0.21.1-cp39-abi3-win_arm64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.9+, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98075550540c6b45f57abdfc453900bd2a179dc495d986ccc0757a813ee55103 |
|
MD5 | e6438a959c25af49752847437b6b4fec |
|
BLAKE2b-256 | a54fc3e63c43c996c945ea79b3daa869b091b031f0e9f99e69c86bd9b85ba466 |
File details
Details for the file deptry-0.21.1-cp39-abi3-win_amd64.whl
.
File metadata
- Download URL: deptry-0.21.1-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.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 981a28e1feeaad82f07a6e3c8d7842c5f6eae3807dc13b24d453a20cd0a42a72 |
|
MD5 | 7fece0089c74f3235e95bf0ad29d0e65 |
|
BLAKE2b-256 | 316cf26fd12717fbe4a56f208e236e03963d9c2e697288fe3163ac377a62ad45 |
File details
Details for the file deptry-0.21.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: deptry-0.21.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4afef1c5eb0b48ebc31de2437b460df0363cb99722252b7faf7fa6f43e10cbcd |
|
MD5 | 93a2f6642f695b25d308c41615286fa3 |
|
BLAKE2b-256 | 435aa597af2b3b6fbd1996c221ad776a891e54529fd0ba4a8c23879187e6e188 |
File details
Details for the file deptry-0.21.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: deptry-0.21.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5eae7afbcb9b7f6baa855b323e0da016a23f2a98d4b181dcfd2c71766512387 |
|
MD5 | 3ff2476bcc05b62b67ea1a1fd33f33f0 |
|
BLAKE2b-256 | 2be7aa86b1a20e334408f43bec0fdffdd0abf23fc14f203ad14c63ccc2710864 |
File details
Details for the file deptry-0.21.1-cp39-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: deptry-0.21.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b53089c22d18076935a3e9e6325566fa712cd9b89fe602978a8e85f0f4209bf |
|
MD5 | a8a4229ddc81e391955691ade497f0f7 |
|
BLAKE2b-256 | 09e1b0bccf884a6e6e3bfc1a049b7eb43a08e5f53d5460711358beece0ced321 |
File details
Details for the file deptry-0.21.1-cp39-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: deptry-0.21.1-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c31e1a66502e28870e1e0a679598462a6119f4bcb656786e63cb545328170a3f |
|
MD5 | bf20c5297129a3c664b7d5141bf07785 |
|
BLAKE2b-256 | 4c0b8f5a5f78fd01387f090284114b32653eebf08a1ca0a90fd8f7246ef03a81 |