Deptry

Latest version: v0.16.1

Safety actively analyzes 623608 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 12

0.16.1

Bug Fixes

* Skip type checking blocks whether future annotations are used ([662](https://github.com/fpgmaas/deptry/pull/662))

Full Changelog

https://github.com/fpgmaas/deptry/compare/0.16.0...0.16.1

0.16.0

Breaking changes

`typing.TYPE_CHECKING` handling

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

python
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`:

toml
[tool.deptry]
requirements_files = ["requirements.txt"]


Features

* Skip type checking blocks when parsing imports ([652](https://github.com/fpgmaas/deptry/pull/652))
* Search for `requirements.in` before `requirements.txt` on projects using `pip` requirements format for
dependencies ([641](https://github.com/fpgmaas/deptry/pull/641))

Bug Fixes

* Show module name instead of library name when reporting DEP003 ([644](https://github.com/fpgmaas/deptry/pull/644)
* Better support for notebooks by handling magic commands and line
continuations ([656](https://github.com/fpgmaas/deptry/pull/656))

Full Changelog

https://github.com/fpgmaas/deptry/compare/0.15.0...0.16.0

0.15.0

Breaking changes

* In release [0.12.0](https://github.com/fpgmaas/deptry/releases/tag/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](https://github.com/fpgmaas/deptry/releases/tag/0.12.0) for instructions on how to migrate to the new method of configuration. ([#596](https://github.com/fpgmaas/deptry/pull/596))


Deprecations

* The options `requirements-txt` and `requirements-txt-dev` are replaced with `requirements-files` and `requirements-files-dev`, respectively, to provide better support for projects that use both a `requirements.in` and a `requirements.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](https://github.com/fpgmaas/deptry/pull/609))

Features

* Implement the collection of all Python files to be scanned by *deptry* in Rust ([591](https://github.com/fpgmaas/deptry/pull/591))
* Implement import extraction for notebooks in Rust ([606](https://github.com/fpgmaas/deptry/pull/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](https://docs.python.org/3/whatsnew/3.12.html#pep-701-syntactic-formalization-of-f-strings). ([615](https://github.com/fpgmaas/deptry/pull/615))
* Improved logging of the detected imports and their locations when *deptry* is run in verbose mode ([627](https://github.com/fpgmaas/deptry/pull/627))
* Introduce the `--pep621-dev-dependency-groups` flag that allows users to specify which groups under `[project.optional-dependencies]` are considered development dependencies ([628](https://github.com/fpgmaas/deptry/pull/628))

Bug Fixes

* Add back the license classifier, which was lost during the transition from Poetry to PDM in ([624](https://github.com/fpgmaas/deptry/pull/624))

Miscellaneous

* Remove upper bound on `requires-python` ([621](https://github.com/fpgmaas/deptry/pull/621))
* Moved the documentation to [deptry.com](https://deptry.com) ([#630](https://github.com/fpgmaas/deptry/pull/630))

Full Changelog

https://github.com/fpgmaas/deptry/compare/0.14.2...0.15.0

0.14.2

This release adds back MIT license classifier in package metadata, that was lost when changing the build backend ([623](https://github.com/fpgmaas/deptry/pull/623)).

Full Changelog

https://github.com/fpgmaas/deptry/compare/0.14.1...0.14.2

0.14.1

This release improves runtime performance of built wheels by about 5%, and reduces their size ([594](https://github.com/fpgmaas/deptry/pull/594)).

PyPy wheels are now also published on PyPI ([612](https://github.com/fpgmaas/deptry/pull/612)).

Bug Fixes

* Improve handling of comments in `requirements.txt` files ([588](https://github.com/fpgmaas/deptry/pull/588))
* Avoid process hanging on error when parsing Python files ([619](https://github.com/fpgmaas/deptry/pull/619))

Full Changelog

https://github.com/fpgmaas/deptry/compare/0.14.0...0.14.1

0.14.0

This release significantly improves the speed of `deptry`, particularly for large projects, by utilizing Rust to manage the parsing of Abstract Syntax Trees (AST) from `.py` files and to extract the import statements. For some benchmarks, see below:

<img src="https://github.com/fpgmaas/deptry/assets/12008199/4f045622-7566-4cc3-a589-dbc6ea12ea5f" width="70%" />

Since the changes are all in the back-end, little has changed for the user other than the execution speed. The two minor notable changes are:

* Improved identification of `column` identifier in imports detection. Where earlier the column identifier for an imported module `foo` in the line `import foo` would be `0`, it now points to column `8`.

Available wheels on PyPI

Where earlier releases published a single `.whl` file to PyPI, with the move to Rust we now build and publish wheels for a variety of platforms and architectures. More specifically, wheel files for the following combinations are now available on PyPI:

- Linux: ABI3 wheels for `x86_64` and `aarch64` architectures.
- Windows: ABI3 wheels for the `x64` architecture.
- macOS: ABI3 wheels for `x86_64` and `aarch64` (Apple Silicon) architectures.

Alongside the ABI3 wheels, we provide a source distribution (sdist) package.

Full Changelog

https://github.com/fpgmaas/deptry/compare/0.13.0...0.14.0

Page 1 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.