Releases: fpgmaas/deptry
0.21.0
What's Changed
Breaking changes
Ignore files handling
Unless --exclude
is used, deptry excludes files found in common ignore files (.gitignore
, .ignore
, $HOME/.config/git/ignore
. ...), by using ignore
Rust crate. The default behaviour has been changed, so that now:
- git-related ignore rules (
.gitignore
,$HOME/.config/git/ignore
, ...) are only used if deptry is run inside a git repository .gitignore
files that are in parent directories of the git repository from where deptry is run are not used (previously, deptry would traverse parent directories up to the root system)
If you were using .gitignore
files for non-git repositories, you might want to switch to .ignore
files, or use --extend-exclude
.
Requirements files parsing
deptry now uses requirements-parser
to parse dependencies from requirements files, meaning that it can now extract nested requirements files referenced in other requirements files without having to explicitly configure it in deptry.
For instance, if you have:
# requirements.txt
-r cli-requirements.txt
httpx==0.27.2
# cli-requirements.txt
click==8.1.7
With the default configuration, when parsing requirements.txt
, both httpx
and click
will now be listed as dependencies by deptry, while previously, only httpx
was, unless deptry was instructed about cli-requirements.txt
by using --requirements-files
. This new behaviour also impacts development requirements files, that can be overridden by using --requirements-files-dev
.
Python 3.8 support dropped
Support for Python 3.8 has been dropped, as it has reached its end of life.
Features
- deptry now detects development dependencies from
[dependency-groups]
section, introduced by PEP 735 (#892) - deptry now supports
setuptools
dynamic dependencies set in[tool.setuptools.dynamic]
section, see https://deptry.com/supported-dependency-managers/#setuptools for more details (#894, #724) - Drop support for Python 3.8 (#874)
- Improve ignore handling (#908)
- Parse requirements files with
requirements-parser
, adding support for parsing nested requirements files referenced with-r <requirement_file>
(#913)
Full Changelog: 0.20.0...0.21.0
0.20.0
What's Changed
Breaking changes
In release 0.15.0, we announced the deprecation of the following flags:
--requirements-txt
(and itsrequirements_txt
setting counterpart inpyproject.toml
)--requirements-txt-dev
(and itsrequirements_txt_dev
setting counterpart inpyproject.toml
)
Those flags have now been removed. If you relied on them, you should now use, respectively:
--requirements-files
(and itsrequirements_files
setting counterpart inpyproject.toml
)--requirements-files-dev
(and itsrequirements_files_dev
setting counterpart inpyproject.toml
)
Features
- deptry now detects uv and reads development dependencies from
[uv.tool.dev-dependencies]
section (#816) - Dynamically set max terminal width for better readability when displaying help (#817)
- Remove deprecated
--requirements-txt
/--requirements-txt-dev
flags (#819)
Full Changelog: 0.19.1...0.20.0
0.19.1
0.19.0
What's Changed
This release reverts #753 that caused a noticeable performance regression on large codebases. The intent of the initial PR was to support projects following PEP 420, so if your project currently relies on this behaviour, feel free to manifest your interest in #740.
Fixes
New Contributors
Full Changelog: 0.18.0...0.19.0
0.18.0
0.17.0
0.16.2
What's Changed
Bug Fixes
- Avoid crashing on PEP 621 and Poetry projects with no dependencies (#752)
- Recursively search for Python files to detect local modules, to better support namespace packages (#753)
Miscellaneous
- Provide macOS ARM wheels for PyPy (#691)
Full Changelog: 0.16.1...0.16.2
0.16.1
0.16.0
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
if 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 https://deptry.com/usage/#imports-extraction for more information.
requirements.in
handling
On projects using pip
requirements format for defining dependencies, if requirements_files
option is not overridden,
deptry will first search for a requirements.in
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 requirements.in
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
:
[tool.deptry]
requirements_files = ["requirements.txt"]
Features
- Skip type checking blocks when parsing imports (#652)
- Search for
requirements.in
beforerequirements.txt
on projects usingpip
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
0.15.0
What's Changed
Breaking changes
-
In release 0.12.0, we announced the deprecation of the following flags:
--ignore-unused
--ignore-obsolete
--ignore-missing
--ignore-misplaced-dev
--ignore-transitive
--skip-unused
--skip-obsolete
--skip-missing
--skip-misplaced-dev
--skip-transitive
These flags are now no longer supported. If you are still using these flags and are planning to upgrade to this release, please refer to the release notes of 0.12.0 for instructions on how to migrate to the new method of configuration. (#596)
Deprecations
- The options
requirements-txt
andrequirements-txt-dev
are replaced withrequirements-files
andrequirements-files-dev
, respectively, to provide better support for projects that use both arequirements.in
and arequirements.txt
. The legacy options will still be usable for the time being, with a warning being shown in the terminal, but they will be removed in a future release, so you are advised to migrate to the new ones. (#609)
Features
- Implement the collection of all Python files to be scanned by deptry in Rust (#591)
- Implement import extraction for notebooks in Rust (#606)
- Use ruff's AST parser for import extraction from Python files. This also adds support for files with Python 3.12 f-string syntax, see PEP 701. (#615)
- Improved logging of the detected imports and their locations when deptry is run in verbose mode (#627)
- Introduce the
--pep621-dev-dependency-groups
flag that allows users to specify which groups under[project.optional-dependencies]
are considered development dependencies (#628)
Bug Fixes
- Add back the license classifier, which was lost during the transition from Poetry to PDM in (#624)
Miscellaneous
- Remove upper bound on
requires-python
(#621) - Moved the documentation to deptry.com (#630)