github fpgmaas/deptry 0.16.0

latest release: 0.16.1
20 days ago

What's Changed

Breaking changes

typing.TYPE_CHECKING handling

Imports guarded by typing.TYPE_CHECKING when using from __future__ import annotations are now skipped. For instance:

from __future__ import annotations

from typing import TYPE_CHECKING

    # This import will not be extracted as it is guarded by `TYPE_CHECKING` and `from __future__ import annotations`
    # is used. This means the import should only be evaluated by type checkers, and should not be evaluated during runtime.
    import mypy_boto3_s3

See for more information. handling

On projects using pip requirements format for defining dependencies, if requirements_files option is not overridden,
deptry will first search for a file before requirements.txt, to better support projects using
pip-tools and the like (which includes uv and Rye) out of the box. If you use and want deptry to
use requirements.txt, you can either pass --requirements-files requirements.txt when invoking deptry, or set the
option in pyproject.toml:

requirements_files = ["requirements.txt"]


  • Skip type checking blocks when parsing imports (#652)
  • Search for before requirements.txt on projects using pip requirements format for dependencies (#641)

Bug Fixes

  • Show module name instead of library name when reporting DEP003 (#644
  • Better support for notebooks by handling magic commands and line continuations (#656)

Full Changelog


Don't miss a new deptry release

NewReleases is sending notifications on new releases.