netbox-community / pynetbox

Python API client library for Netbox.
Apache License 2.0
538 stars 165 forks source link

pynetbox import error importlib.metdata python3.6 #574

Closed FliesLikeABrick closed 10 months ago

FliesLikeABrick commented 10 months ago

pynetbox version

v7.1.0

NetBox version

v3.5.7

Python version

3.8

Steps to Reproduce

python 3.6.12

import pynetbox

https://github.com/netbox-community/pynetbox/commit/98625ed05ee28c44cadf75227f5fded6c6312712#diff-7aba52ef4bd5d0cc1d7b34e6f0f3412cf4eb6d58fe0e111df799b4946251685e

This commit included in pynetbox 7.1.0 says it is adding python3.5 support, but in doing so it appears to break at least some support in python 3.6.

This works in the prior release, 7.0.1.

The importlib.metadata.metadata usage is only in pynetbox/init.py.

Expected Behavior

(no output)

Observed Behavior

Traceback (most recent call last): File "", line 1, in File "/home/rrawdon/cnvrtools2023/lib64/python3.6/site-packages/pynetbox/init.py", line 1, in from importlib.metadata import metadata ModuleNotFoundError: No module named 'importlib.metadata'

abhi1693 commented 10 months ago

The support was added for NetBox v3.5 and not python 3.5. The current supported versions released in v7.1.0 are 3.8, 3.9 and 3.10. You can even check the classifiers in https://github.com/netbox-community/pynetbox/blob/v7.1.0/setup.py. There is no official support for python 3.6

FliesLikeABrick commented 10 months ago

Ah thank you for the clarification. We will lock ourselves to 7.0.1 until we complete our system upgrades that let us move to python 3.8+. Apologies for the reading comprehension failure and noise - will apply more coffee

mschmitzer commented 8 months ago

@abhi1693 if you also added the appropriate python_requires to setup.py, you would spare people effort of pinning it down themselves. Pip unfortunately doesn't consider the classifiers when selecting a package to install. That of course won't help with existing releases, unless you yank them from Pypi.