deptry icon indicating copy to clipboard operation
deptry copied to clipboard

Inconsistant behaviour CI vs local

Open fellnerse opened this issue 7 months ago • 2 comments

Environment

  • deptry version: 0.23.0
  • Python version: 3.11
  • Operating system macOs 15.4 and python:3.11-bookworm docker image

Describe the issue

I get different results running the same version of deptry on the same repository with the same config. The difference seems to stem from the package module name map. In the CI I get this output:

...
Assuming the corresponding module name of package 'azure-eventhub' is 'azure_eventhub'. Install the package or configure a package_module_name_map entry to override this behaviour.
Assuming the corresponding module name of package 'azure-identity' is 'azure_identity'. Install the package or configure a package_module_name_map entry to override this behaviour.
...

and Locally I do not get this output at all.

But in the CI it fails then because the two examples listed above are mapped wrongly. Locally when running with -v flag I can see this output:

Dependency 'azure-eventhub' with top-levels: {'azure'}.
Dependency 'azure-identity' with top-levels: {'azure'}.

Which solves the error.

Minimal way to reproduce the issue

I have no Idea. I suppose it's related to the setup of those environments?

Expected behavior

The result should be the same.

Additional context

We run it with pre-commit:

  - repo: https://github.com/fpgmaas/deptry.git
    rev: "0.23.0"
    hooks:
      - id: deptry
        args: [ "--config", "pyproject.toml" ]

locally installed with uv: uv add --dev deptry and in CI via pip, in the dockerfile running the pre-commit hook: RUN pip3 install commitizen==4.4.1 pre-commit==4.2.0 deptry==0.23.0

fellnerse avatar Apr 28 '25 08:04 fellnerse