sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
951 stars 405 forks source link

Pin `packaging` version #2535

Closed SnoopJ closed 8 months ago

SnoopJ commented 8 months ago

@Exirel discovered that we have some problems with type analysis on master if one has a packaging version that is 'too old'.

$ mypy --check-untyped-defs sopel
sopel/lifecycle.py:147: error: Unsupported operand types for >= ("tuple[int, ...]" and "None")  [operator]
sopel/lifecycle.py:147: note: Right operand is of type "tuple[int, ...] | None"

The above was observed with packaging==21.3.

I tried to look in their changelog to see if there was a specific version that fixed the issue we saw, but came up empty-handed. Pinning the lower bound to the latest version is the next best thing to do, and this package has excellent compatibility, so it shouldn't be a problem.

Checklist

dgw commented 8 months ago

After some question about dropping back to earliest-good after I found the source of mypy considering the version's release property optional (tuple[...] | None), we elected to just keep this latest-good release constraint. It's fine.