zopefoundation / Products.BTreeFolder2

A BTree based implementation for Zope's OFS.
Other
3 stars 8 forks source link

Remove dependency on `future` package #16

Closed petschki closed 1 year ago

petschki commented 1 year ago

in setup.py there's the dependency on future package with the comment "for cgi/html.escape()" ... is this still needed?

davisagli commented 1 year ago

It provides a polyfill for html.escape which is not present in Python 2, but is used here: https://github.com/zopefoundation/Products.BTreeFolder2/blob/2942dee90b7fa3133c2734bd7def10a24909ef0f/src/Products/BTreeFolder2/BTreeFolder2.py#L18

It can be removed when this package drops support for Python 2, or could be replaced with a conditional import to use cgi.escape in Python 2.

dataflake commented 1 year ago

It should be replaced by a conditional import. Adding a dependency when something can be fixed with a conditional import just doesn't make sense.

icemac commented 1 year ago

It can be fixed by switching to six as we do it in all the other zopefoundation packages. There is no need to use future.

icemac commented 1 year ago

The usage of six can be automatically removed using pyupgrade when dropping Python 2 support.

dataflake commented 1 year ago

Fixed by https://github.com/zopefoundation/Products.BTreeFolder2/commit/4926bc72ff89a620631bab870354201578da24f9

The dependency can be removed without any further changes. The only situation where the import would fail is under Python 2.7. Python 2.7 necessitates Zope 4. future happens to be a direct dependency there.