fpgmaas/deptry

deptry hangs

Closed this issue · 3 comments

Describe the bug

Using v0.13.0 there's no issue. Only when upgrading to v0.14.0a1 / v0.14.0.

As far as I start deptry with deptry . I see the output "Scanning 100 files..." where it hangs forever.

Adding --verbose to the command gives the following output:

No configuration for deptry was found in pyproject.toml.
Running with the following configuration:
root: (PosixPath('.'),)
config: pyproject.toml
no_ansi: False
per_rule_ignores: {}
ignore: ()
exclude: ('venv', '\\.venv', '\\.direnv', 'tests', '\\.git', 'setup\\.py')
extend_exclude: ()
using_default_exclude: True
ignore_notebooks: False
requirements_txt: ('requirements.txt',)
requirements_txt_dev: ('dev-requirements.txt', 'requirements-dev.txt')
known_first_party: ()
json_output: None
package_module_name_map: {}

pyproject.toml found!
pyproject.toml does not contain a [tool.poetry.dependencies] section, so Poetry is not used to specify the project's dependencies.
pyproject.toml does not contain a [tool.pdm.dev-dependencies] section, so PDM is not used to specify the project's dependencies.
pyproject.toml does not contain a [project] section, so PEP 621 is not used to specify the project's dependencies.
Dependency specification found in 'requirements.txt'. Will use this to determine the project's dependencies.

Scanning requirements.txt for dependencies
The project contains the following dependencies:
Dependency 'aws-lambda-powertools' with top-levels: {'aws_lambda_powertools'}.
Dependency 'jsonschema' with top-levels: {'jsonschema'}.
Dependency 'pydantic' with top-levels: {'pydantic'}.
Dependency 'pydantic' (optional) with top-levels: {'pydantic'}.
Dependency 'pysnow' with top-levels: {'pysnow'}.
Dependency 'requests' with top-levels: {'requests'}.
Dependency 'shortuuid' with top-levels: {'shortuuid'}.

Found files with development requirements! ['requirements-dev.txt']
Scanning requirements-dev.txt for dependencies
The project contains the following dev dependencies:
Dependency 'aws-lambda-powertools' with top-levels: {'aws_lambda_powertools'}.
Dependency 'jsonschema' with top-levels: {'jsonschema'}.
Dependency 'pydantic' with top-levels: {'pydantic'}.
Dependency 'pydantic' (optional) with top-levels: {'pydantic'}.
Dependency 'pysnow' with top-levels: {'pysnow'}.
Dependency 'requests' with top-levels: {'requests'}.
Dependency 'shortuuid' with top-levels: {'shortuuid'}.
Dependency 'boto3' with top-levels: {'boto3'}.
Dependency 'boto3-stubs' (optional) with top-levels: {'boto3-stubs'}.
Dependency 'codespell' with top-levels: {'codespell_lib'}.
Dependency 'freezegun' with top-levels: {'freezegun'}.
Dependency 'moto' with top-levels: {'moto'}.
Dependency 'pre-commit' with top-levels: {'pre_commit'}.
Dependency 'pytest' with top-levels: {'_pytest', 'py', 'pytest'}.
Dependency 'pytest-cov' with top-levels: {'pytest_cov'}.
Dependency 'pytest-html' with top-levels: {'pytest_html'}.
Dependency 'pytest-mock' with top-levels: {'pytest_mock'}.
Dependency 'pytest-pep8' with top-levels: {'pytest_pep8'}.
Dependency 'ruff' with top-levels: {'ruff'}.

Collecting Python files to scan...
Python files to scan for imports:
src/api/v1_/....py
<99 more .py files here>

Scanning 100 files...

To Reproduce

Steps to reproduce the behavior:

  1. Upgrade from v0.13.0 to v0.14.0
  2. deptry .

Expected behavior

Should run

System [please complete the following information]:

  • OS: Devcontainer (mcr.microsoft.com/vscode/devcontainers/python:3.12-bullseye) / Debian Bullseye
  • Language Version: Python 3.12
  • Poetry version: no poetry in use, I'm using uv

Thanks for raising this issue! I did some local testing, and I think this is potentially related to #611. We use rayon to parse the files in parallel, but whenever one of the files cannot be parsed it seems it can get stuck. Relevant code here and here. I need some more time to figure out a solution though.

Thanks for raising the issue. This should be fixed with 0.14.1, if you want to test again on this version.

Yes, 0.14.1 fixed this issue. Thanks!