Skip to content

Releases: fpgmaas/deptry

0.10.0

08 May 15:41
6ae3d47
Compare
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
Compare
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
Compare
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
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.7.0...0.7.1

0.7.0

27 Dec 15:53
01f6b83
Compare
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
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.6.5...0.6.6

0.6.5

14 Nov 14:06
db4a942
Compare
Choose a tag to compare

What's Changed

  • Add more pre-commit hooks by @mkniewallner in #180
  • Add Renovate configuration to the repository to handle dependencies updates by @mkniewallner in #179
  • chore(deps): update dependency flake8-comprehensions to v3.10.1 by @renovate in #181
  • chore(deps): update pre-commit hook psf/black to v22.10.0 by @renovate in #186
  • chore(deps): update pre-commit hook asottile/pyupgrade to v3.2.2 by @renovate in #182
  • chore(deps): update pre-commit hook charliermarsh/ruff-pre-commit to v0.0.110 by @renovate in #183
  • chore(deps): update dependency flake8-bugbear to v22.10.27 by @renovate in #184
  • chore(deps): update dependency mypy to ^0.990 by @renovate in #185
  • chore(deps): update pre-commit hook charliermarsh/ruff-pre-commit to v0.0.112 by @renovate in #189
  • fix(deps): update dependency mkdocstrings to ^0.19.0 by @renovate in #187
  • chore(deps): update pre-commit hook charliermarsh/ruff-pre-commit to v0.0.114 by @renovate in #191
  • Improve documentation by @mkniewallner in #190
  • chore(deps): update pre-commit hook charliermarsh/ruff-pre-commit to v0.0.117 by @renovate in #194
  • Improve and simplify CI configuration and fix 3.11 random failures by @mkniewallner in #192
  • Run renovate on saturdays and add renovate config check to pre-commit hook by @fpgmaas in #195

New Contributors

Full Changelog: 0.6.4...0.6.5

0.6.4

09 Nov 13:34
91e0d2b
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.6.3...0.6.4

0.6.3

23 Oct 11:28
ef0b7ee
Compare
Choose a tag to compare
fixed the docs for pre-commit hooks (#164)

0.6.2

22 Oct 16:07
0c42bd0
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.6.1...0.6.2