https://pypi.org/project/backports.strenum/ implements a backport of Python 3.11's enum.StrEnum as backports.strenum.StrEnum. It would be nice if UP035 (deprecated-import) added support for replacing it with the original version when targeting 3.11+.
Note that the package instructions already suggests using:
if sys.version_info >= (3, 11):
from enum import StrEnum
else:
from backports.strenum import StrEnum
But if someone is not using the conditional import, it would be good for UP035 to clean it up.
https://pypi.org/project/backports.strenum/ implements a backport of Python 3.11's
enum.StrEnum
asbackports.strenum.StrEnum
. It would be nice ifUP035
(deprecated-import) added support for replacing it with the original version when targeting 3.11+.Note that the package instructions already suggests using:
But if someone is not using the conditional import, it would be good for UP035 to clean it up.
Tested on ruff v0.1.1 - https://play.ruff.rs/c973b82b-0107-469b-9b10-9196353b8901