PyCQA / bandit

Bandit is a tool designed to find common security issues in Python code.
https://bandit.readthedocs.io
Apache License 2.0
6.51k stars 612 forks source link

ModuleNotFoundError: No module named 'typing_extensions' #1180

Closed olllyyyj closed 1 month ago

olllyyyj commented 1 month ago

Describe the bug

Today bandit versions 1.7.5 - 1.7.10 started failing with the following traceback in Github Actions and local environments when running bandit -c:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.20/x64/bin/bandit", line 5, in <module>
    from bandit.cli.main import main
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/bandit/__init__.py", line 7, in <module>
    from bandit.core import config  # noqa
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/bandit/core/__init__.py", line 7, in <module>
    from bandit.core import manager  # noqa
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/bandit/core/manager.py", line 16, in <module>
    from rich import progress
  File "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/site-packages/rich/progress.py", line 45, in <module>
    from typing_extensions import Self  # pragma: no cover
ModuleNotFoundError: No module named 'typing_extensions'

Reproduction steps

1. `pip3 install bandit`
2. `bandit -c <args>`

Expected behavior

Bandit runs as expected

Bandit version

1.7.10

Python version

3.9

Additional context

No response

jccastillocano commented 1 month ago

https://github.com/PyCQA/bandit/pull/1181 could fix it :)

jccastillocano commented 1 month ago

This issue has been fixed in the latest version of rich. See https://github.com/Textualize/rich/releases/tag/v13.9.1

olllyyyj commented 1 month ago

Resolved