python / importlib_metadata

Library to access metadata for Python packages
https://importlib-metadata.readthedocs.io
Apache License 2.0
122 stars 79 forks source link

Rely on zipfile.Path (where viable) #464

Closed jaraco closed 1 year ago

jaraco commented 1 year ago

When importlib_metadata was originally created, it supported Python 3.6 which didn't have zipfile.Path. Now importlib_metadata supports Python 3.8 and later, where zipfile.Path is available. However, that implementation may have deficiencies compared to later updates. Let's evaluate the state of zipfile.Path and zipp and ascertain a good breakpoint to prefer zipfile.Path.

jaraco commented 1 year ago

Reading back through the changelog, I notice that 3.12.0 adds a bugfix that's only backported to Python 3.10. But I also observe that bugfix is probably not pertinent to importlib_metadata.

It seems to me that 3.9.0 may be the latest change that's likely to impact users of importlib_metadata (if they were to try to pickle Distribution objects).

According to the README, that change was first included in Python 3.12, so no stable release of Python currently has that behavior.

Additionally, 3.4.0 added an important quality-of-life improvement to support multiple arguments to joinpath. That would have been made available in Python 3.11.

It hardly seems worth the effort to support both zipfile.Path and zipp.Path, at least at this stage.