cannot import name 'Iterable' from 'collections'
When running S3I in Python 3.10+, the following error message appears:
>>> import s3i
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ifos/mambaforge/envs/hsm/lib/python3.11/site-packages/s3i/__init__.py", line 1, in <module>
from s3i.identity_provider import IdentityProvider
File "/home/ifos/mambaforge/envs/hsm/lib/python3.11/site-packages/s3i/identity_provider.py", line 6, in <module>
from jwt.algorithms import RSAPSSAlgorithm
File "/home/ifos/mambaforge/envs/hsm/lib/python3.11/site-packages/jwt/__init__.py", line 19, in <module>
from .api_jwt import (
File "/home/ifos/mambaforge/envs/hsm/lib/python3.11/site-packages/jwt/api_jwt.py", line 4, in <module>
from collections import Iterable, Mapping
ImportError: cannot import name 'Iterable' from 'collections' (/home/ifos/mambaforge/envs/hsm/lib/python3.11/collections/__init__.py)
>>>
This is due to a deprecation in the Python standard library that has only been patched in pyjwt 1.7.0
. S3I currently requires pyjwt 1.6.1
exactly.
GitLab didn't let me fork the repo (needed for putting in a PR), so I'll propose the needed change here:
Change this line to require a higher version, e.g. pyjwt "2.8.0"
if that doesn't cause any problems.