shiv
shiv copied to clipboard
Correct Python <= 3.7 compatibility regression in commit 377c70d
This change drops Python 3.6 support as well as enables Python 3.7 support for deferred type evaluation, as this is the minimum version Python version required to support the usage of type annotations requiring deferred evaluation that were introduced in commit 377c70d .
As of the present PyPi release 1.0.7, the following type hinting error occurs under Python 3.6 as well as 3.7:
Traceback (most recent call last):
File "/app/output.s", line 3, in <module>
class Environment:
File "/app/output.s", line 30, in Environment
root: Optional[str] = None,
TypeError: 'type' object is not subscriptable
This can be further illustrated on Compiler Explorer at: https://godbolt.org/z/1eWcT4jsW
https://github.com/linkedin/shiv/pull/255 indicates that compatibility with Python 3.8 was broken as well, presumably due to this issue which manifests in Pythons < 3.9. Don't quote me on that, though.
I only looked at it long enough to determine that 1.0.7 broke Python 3.8, and pinned my requirements to <1.0.7. (It feels like a thing that shouldn't happen on a point release, but hey, nobody's perfect.)