Skip to content

Releases: fpgmaas/deptry

0.13.0

12 Mar 13:00
d25dbde

Choose a tag to compare

What's Changed

Features

  • deptry will now report invalid configuration options defined in pyproject.toml by @mkniewallner in #571

Bug Fixes

  • Stricten URL detection to avoid flagging libraries like httpx as URLs by @mkniewallner in #570

Full Changelog: 0.12.0...0.13.0

0.12.0

18 Jun 13:54
b280689

Choose a tag to compare

What's Changed

This release introduces a significant change to the command-line flags and configuration options to make use of the error codes introduced in release 0.10.0.

Code Issue
DEP001 Missing dependency
DEP002 Unused/obsolete dependency
DEP003 Transitive dependency
DEP004 Misplaced development dependency

Features

  • Replaced --skip-unused, --skip-obsolete, --skip-missing, --skip-misplaced-dev flags: We have replaced the currently existing flags with the more generalized --ignore flag. Now, instead of skipping types of checks, you can specify the exact error codes to ignore using the --ignore flag (e.g., deptry . --ignore "DEP001,DEP002" to ignore checking for missing and unused dependencies).

The changes are also reflected in pyproject.toml. For example,

[tool.deptry]
skip_missing = true
skip_unused = true

is superseded by

[tool.deptry]
ignore = ["DEP001", "DEP002"]
  • Replaced --ignore-unused, --ignore-obsolete, --ignore-missing, --ignore-misplaced-dev flags: Previously, specific checks for spefific dependencies/modules could be ingored using the --ignore-<code> flags. We are replacing these flags with the more generalized --per-rule-ignores flag. This flag allows you to specify dependencies that should be ignored for specific error codes, offering granular control over which errors are ignored for which dependencies. For instance, deptry . --per-rule-ignores DEP001=matplotlib,DEP002=pandas|numpy means DEP001 will be ignored for matplotlib, while DEP002 will be ignored for both pandas and numpy.

The changes are also reflected in pyproject.toml. For example,

[tool.deptry]
ignore_missing = ["matplotlib"]
ignore_unused = ["pandas", "numpy"]

is superseded by

[tool.deptry.per_rule_ignores]
DEP001 = ["matplotlib"]
DEP002 = ["pandas", "numpy"]

Please note that while the legacy arguments are still functional as of Deptry 0.12.0, we do plan to remove them in a future 1.0.0 release.

  • Consider all groups for dev dependencies (#392)

Bug Fixes

  • Handle SyntaxError raised by ast.parse (#426)

Full Changelog

0.11.0...0.12.0

0.11.0

10 May 13:43
133a9cc

Choose a tag to compare

What's Changed

Deprecations

  • --skip-obsolete CLI option and its skip_obsolete couterpart in pyproject.toml are being replaced with --skip-unused and skip_unused, respectively
  • --ignore-obsolete CLI option and its ignore_obsolete counterpart in pyproject.toml are being replaced with --ignore-unused and ignore_unused, respectively

This is done to account for a wording change, as we are replacing "obsolete" with "unused", since it has a clearer meaning for users.

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.

Features

Bug Fixes

Full Changelog: 0.10.1...0.11.0

0.10.1

09 May 14:59
b5102b1

Choose a tag to compare

What's Changed

Bug Fixes

  • Fix terminal output when only a single file is scanned by @fpgmaas in #372
  • Fix issue with DEP004 being raised incorrectly when a dependency is defined both as a dev one and non-dev one by @fpgmaas in #376

Full Changelog: 0.10.0...0.10.1

0.10.0

08 May 15:41
6ae3d47

Choose a tag to compare

What's Changed

Breaking changes

Release 0.10.0 of deptry brings a significant improvement to the way in which issues are reported. Previously, issues were reported in a summarized format, making it difficult for users to pinpoint exactly where in the code the issue was occurring. This is resolved by #357, which adds location information to the detected issues.

#367 adds error codes to identify the different issue types:

Code Issue
DEP001 Missing dependency
DEP002 Obsolete dependency
DEP003 Transitive dependency
DEP004 Misplaced development dependency

Here's an example of how issues are now reported in release 0.10.0:

foo/bar.py:11:11: DEP002 'an_import' imported but missing from the dependencies
foo/bar.py:12:11: DEP002 'another_import' imported but missing from the dependencies
foo/baz.py:13:11: DEP003 'cfgv' imported but it is a transitive dependency
pyproject.toml: DEP001 'pandas' defined as a dependency but not used in the codebase

The json output generated by using the -o or --json-output is also modified to include the new error codes and location information:

    {
        "error": {
            "code": "DEP001",
            "message": "'seven' imported but missing from the dependency definitions"
        },
        "module": "seven",
        "location": {
            "file": "foo/bar.py",
            "line": 2,
            "column": 0
        }
    },

Features

Full Changelog: 0.9.0...0.10.0

0.9.0

06 May 10:24
8b956e4

Choose a tag to compare

What's Changed

Breaking changes

Python 3.7 support dropped

Support for Python 3.7 has been dropped in #352, given that it will reach end of life soon, and that PyPI stats show a really low usage of it. If you are using deptry on Python 3.7, consider upgrading to 3.8, or staying on <0.9.0.

Behaviour changes in package name guessing

In case packages don't provide the Python modules they expose, deptry tries to guess the package name by converting - to _, as a best effort, and warns about it in the logs. Before #337, deptry always guessed the module name, regardless of if the package provided the necessary information or not. Now, it will only guess the module name if the package does not provide the information and no mapping has been provided using the new --package-module-name-map flag (or package_module_name_map option in pyproject.toml).

Handling modules without __init__.py

With #285, deptry will now consider the following things as local modules:

  • directories without __init__.py (and at least one Python file)
  • single Python files

Previously, deptry only considered directories as local modules if an __init__.py was present, and did not account for cases where a single Python file could also be a local module, alongside directories.

Features

  • Drop support for Python 3.7 by @mkniewallner in #352
  • Only try to guess module associated to a dependency as a fallback for when the package doesn't provide such information by @akeeman in #337
  • Handle local modules without __init__.py by @mkniewallner in #285
  • Ability to configure a map of package names to module names by @akeeman in #333

Bug Fixes

Miscellaneous

Full Changelog: 0.8.0...0.9.0

0.8.0

24 Jan 08:45
4c72b74

Choose a tag to compare

What's Changed

Features

Miscellaneous

Full Changelog: 0.7.1...0.8.0

0.7.1

05 Jan 16:05
c426ae3

Choose a tag to compare

What's Changed

Full Changelog: 0.7.0...0.7.1

0.7.0

27 Dec 15:53
01f6b83

Choose a tag to compare

Breaking changes

Previously, deptry always searched for a pyproject.toml file in the root directory passed as a positional argument to the deptry command. Since this is not in line with what most other tools in the ecosystem do, this is changed in release 0.7.0.

In previous releases, when running:

deptry src

deptry would search for both a pyproject.toml and for Python files to scan in the src directory.

Since this release, when running:

deptry src

deptry will search for pyproject.toml in the location it is run from, and for Python files to scan in the src directory.

The downside of the changes outlined above, is that this could break some projects that did explicitly want to find pyproject.toml in a directory other than the positional argument specified as root. For this purpose, release 0.7.0 adds a --config argument that can be used to explicitly pass the location of pyproject.toml.

What's Changed

Full Changelog: 0.6.6...0.7.0

0.6.6

22 Nov 13:25
2823be6

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.6.5...0.6.6