Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest v.8.1.1 introduces mypy (typing) errors in user code #513

Open
lowvoltage opened this issue Dec 23, 2024 · 0 comments
Open

Latest v.8.1.1 introduces mypy (typing) errors in user code #513

lowvoltage opened this issue Dec 23, 2024 · 0 comments

Comments

@lowvoltage
Copy link

Describe the bug
Upgrading to the latest v.8.1.1 causes mypy issues to be reported throughout the client code that imports and uses deepdiff. It seems those can't be suppressed globally, via config and need to be ignored one by one.

The minimalist main.py + mypy.ini setup below is based on the parse_path usage example from its docstring.

To Reproduce

❯ cat main.py
from deepdiff import parse_path
parse_path("root[1][2]['age']")

❯ cat mypy.ini
[mypy]
strict = True

[mypy-deepdiff.*]
ignore_missing_imports = True

❯ pip install deepdiff==8.0.1
...
Successfully installed deepdiff-8.0.1 orderly-set-5.2.2

❯ mypy main.py
Success: no issues found in 1 source file

❯ pip install deepdiff==8.1.1
...
Successfully installed deepdiff-8.1.1 orderly-set-5.2.3

❯ mypy main.py
main.py:1: error: Module "deepdiff" does not explicitly export attribute "parse_path"  [attr-defined]
main.py:2: error: Call to untyped function "parse_path" in typed context  [no-untyped-call]
Found 2 errors in 1 file (checked 1 source file)

Expected behavior
No new mypy errors are introduced

OS, DeepDiff version and Python version (please complete the following information):

  • OS: macOS v.14.6; Ubuntu 24.04
  • Python Version: 3.11.7
  • DeepDiff Version: 8.1.1

Additional context
Seems to be caused by the presence of the py.typed marker ( #507 ) while the deepdiff codebase itself is not fully typed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant