At line 656 in wheelfile.py the following was causing heartache on python 3.6. Python 3.7 added the tell method on zipfile.ZipExtFile which is the actual type for buf as called from line 1371.
assert buf.tell() == 0, (
f"Stale buffer given - current position: {buf.tell()}."
)
Additionally several tests use zipfile.Path which wasn't added until Python 3.8.
By adding a dependency on zipfile38 (which is a backport of zipfile from Python 3.8, if you couldn't guess :P ) all the zipfile dependencies just kind of resolve themselves. zipfile38 is not typed so I pulled the zipfile.pyi from typeshed and modified it so that it would always assume it was running on a Python 3.8 environment which is what zipfile38 provides. So both the mypy tests and pytests all pass
At line 656 in wheelfile.py the following was causing heartache on python 3.6. Python 3.7 added the tell method on zipfile.ZipExtFile which is the actual type for buf as called from line 1371.
Additionally several tests use zipfile.Path which wasn't added until Python 3.8.
By adding a dependency on zipfile38 (which is a backport of zipfile from Python 3.8, if you couldn't guess :P ) all the zipfile dependencies just kind of resolve themselves. zipfile38 is not typed so I pulled the zipfile.pyi from typeshed and modified it so that it would always assume it was running on a Python 3.8 environment which is what zipfile38 provides. So both the mypy tests and pytests all pass
I ran the following to test on Python 3.6
I've verified it works on Python 3.7 too using the same method.