nornir-automation / nornir

Pluggable multi-threaded framework with inventory management to help operate collections of devices
https://nornir.readthedocs.io/
Apache License 2.0
1.39k stars 235 forks source link

`setuptools` is not listed as a dependency #917

Closed devon-mar closed 3 months ago

devon-mar commented 3 months ago

Importing Nornir in a Python 3.12 virtual environment fails because setuptools is not installed:

    from nornir import InitNornir
.venv/lib/python3.12/site-packages/nornir/__init__.py:1: in <module>
    import pkg_resources
E   ModuleNotFoundError: No module named 'pkg_resources'

In Python 3.12, setuptools is no longer installed in virtual environments (https://docs.python.org/3/whatsnew/3.12.html):

gh-95299: Do not pre-install setuptools in virtual environments created with venv. This means that distutils, setuptools, pkg_resources, and easy_install will no longer available by default; to access these run pip install setuptools in the activated virtual environment.

Manually installing setuptools works, but it should be listed as an explicit dependency of Nornir.

I'd make a PR, but I'm not sure what version constraint to use.

ktbyers commented 3 months ago

Yeah, just make a PR. Just have it install the latest.