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

mypy_extensions is only declared as a dev dependency but it directly imported #861

Closed
nemith opened this issue Sep 21, 2023 · 3 comments
Closed

Comments

@nemith
Copy link
Contributor

nemith commented Sep 21, 2023

We are failing to run some CI tests as mypy_extensions is missing

/usr/local/lib/python3.8/site-packages/nornir/__init__.py:3: in <module>
    from nornir.init_nornir import InitNornir
/usr/local/lib/python3.8/site-packages/nornir/init_nornir.py:3: in <module>
    from nornir.core import Nornir
/usr/local/lib/python3.8/site-packages/nornir/core/__init__.py:6: in <module>
    from nornir.core.inventory import Inventory
/usr/local/lib/python3.8/site-packages/nornir/core/inventory.py:23: in <module>
    from mypy_extensions import Arg, KwArg
E   ModuleNotFoundError: No module named 'mypy_extensions'

Looking at https://github.com/nornir-automation/nornir/blob/main/pyproject.toml#L43 it is only declaring mypy_extentions as a dev dependency but in this case it is not a dev dependency but

My guess is something else changes in our dep tree that removed mypy_extension but it needs to be explicitly declared as a runtime dependency as it is being directly imported here https://github.com/nornir-automation/nornir/blob/main/nornir/core/inventory.py#L23

@nemith
Copy link
Contributor Author

nemith commented Sep 21, 2023

@ubaumann
Copy link
Contributor

Nornir was just released some hours ago but we missed this line:

from mypy_extensions import Arg, KwArg

I will take a look when I am home.
In the meantime you can pin the nornir version or add it to your dependencies

@ktbyers
Copy link
Collaborator

ktbyers commented Sep 22, 2023

Fixed here:

#867

New Nornir version 3.4.1 released to pypi.

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

Successfully merging a pull request may close this issue.

3 participants