Releases: fpgmaas/deptry
0.10.0
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
- Add location to error reports by @mkniewallner in #357
- Add colours to text output by @mkniewallner in #368
Full Changelog: 0.9.0...0.10.0
0.9.0
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
- Replace 'PDM' with 'poetry' (typo) by @baggiponte in #294
- fix: account for Windows in code and tests by @mkniewallner in #343
Miscellaneous
- Run tests on macOS and Windows on CI by @mkniewallner in #342
Full Changelog: 0.8.0...0.9.0
0.8.0
What's Changed
Features
- Don't filter out
setuptools
by @mkniewallner in #262 - Use
sys.stdlib_module_names
to get stdlibs in Python >= 3.10 by @mkniewallner in #275
Miscellaneous
- Drop
flake8
to only useruff
by @mkniewallner in #268 - Use more
ruff
rules and replacepyupgrade
andpygrep-hooks
usages by @mkniewallner in #276
Full Changelog: 0.7.1...0.8.0
0.7.1
What's Changed
- Exclude files from
.gitignore
by @mkniewallner in #248 - docs: overhaul of the documentation to make it clearer by @mkniewallner in #255
- test(cli): use JSON output to simplify tests on errors by @mkniewallner in #256
- feat: add support for known first party modules by @mkniewallner in #257
- build(deps): bump
mkdocs-material
to9.0.0
by @mkniewallner in #258 - docs: move
Contributing
todocs
by @mkniewallner in #259
Full Changelog: 0.7.0...0.7.1
0.7.0
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
- refactor: use generic types instead of
typing
by @mkniewallner in #217 - Use
ruff
for import sorting and add more rules by @mkniewallner in #232 - chore: move
renovate-config-validator
to GH Actions by @mkniewallner in #233 - changed badge url by @fpgmaas in #235
- ci: fix
tox
workflow by @mkniewallner in #241 - perf(core): only load local modules once by @mkniewallner in #242
- perf(finder): more efficient Python files retrieval by @mkniewallner in #243
- Separate
pyproject.toml
location fromroot
argument by @mkniewallner in #244 - Expose and handle
--config
argument by @mkniewallner in #245
Full Changelog: 0.6.6...0.7.0
0.6.6
What's Changed
- chore(deps): lock file maintenance by @renovate in #193
- docs: fix PyPI URL by @mkniewallner in #196
- docs: fix typos by @joao-vitor-souza in #198
- Fixed build badge by @fpgmaas in #199
- add .direnv to default exclude argument by @fpgmaas in #197
- downgraded chardet by @fpgmaas in #205
- Refactor import parser by @mkniewallner in #206
- Run
mypy
on tests by @mkniewallner in #208 - refactor(cli): remove obsolete
cli_defaults
module by @mkniewallner in #209 - chore(deps): update pre-commit hook charliermarsh/ruff-pre-commit to v0.0.128 by @renovate in #211
- chore(deps): update dependency mypy to ^0.991 by @renovate in #212
- chore(deps): update pre-commit hook renovatebot/pre-commit-hooks to v34.28.0 by @renovate in #213
- Improve cli command by @mkniewallner in #210
- chore(deps): lock file maintenance by @renovate in #214
- Added logic to NotebookImportExtractor to guess the encoding on initi… by @fpgmaas in #216
New Contributors
- @joao-vitor-souza made their first contribution in #198
Full Changelog: 0.6.5...0.6.6
0.6.5
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
What's Changed
- py311 instead of py311 dev, and remove classifier from pyproject.toml by @fpgmaas in #165
- ci: add Python version to cache key by @mkniewallner in #173
- Handle CI deprecation warnings by @mkniewallner in #170
- Add
pyupgrade
to pre-commit by @mkniewallner in #174 - fix(import_parser): remove obsolete duplicated local import detection by @mkniewallner in #172
- Add support for PEP 621 by @mkniewallner in #166
- Added ruff by @fpgmaas in #175
Full Changelog: 0.6.3...0.6.4