HWI icon indicating copy to clipboard operation
HWI copied to clipboard

protobuf and Python 3.6 compatibility problems - drop support for Python 3.6, support 3.7?

Open benma opened this issue 3 years ago • 3 comments

Hi

tl;dr: can HWI drop support for Python 3.6 to be in line with the up to date protobuf package version, which also dropped support for Python 3.6? Also, Python 3.6 reached end-of-life on Dec 23, 2021 and is not receiving security fixes anymore.

Details:

protobuf v3.20 introduced a breaking change:

*[Breaking change] Protobuf Python generated codes are simplified. Descriptors and message classes' definitions are now dynamic created in internal/builder.py.

This resulted in BitBox02 users reporting errors when using HWI (example) - their local protobuf version was higher than v3.20. To fix this, the bitbox02 dep now requires protobuf higher than 3.20 (PR), with updated protobuf files, and we released this as bitbox02 6.1.0.

Now I tried to update the HWI bitbox02 dep from 6.0.0 to 6.1.0, to solve this bug for e.g the Sparrow user above.

The problem is that the new protobuf version (from v3.20) requires Python 3.7, see this error when attempting to generate the poetry lock file for HWI after updating the bitbox02 version to 6.1.0:

  The current project's Python requirement (>=3.6,<4.0) is not compatible with some of the required packages Python requirement:
    - protobuf requires Python >=3.7, so it will not be satisfied for Python >=3.6,<3.7
    - protobuf requires Python >=3.7, so it will not be satisfied for Python >=3.6,<3.7
    - protobuf requires Python >=3.7, so it will not be satisfied for Python >=3.6,<3.7
    - protobuf requires Python >=3.7, so it will not be satisfied for Python >=3.6,<3.7
    - protobuf requires Python >=3.7, so it will not be satisfied for Python >=3.6,<3.7
                                                                                                                      
  Because no versions of protobuf match >=3.21,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4
   and protobuf (4.21.0) requires Python >=3.7, protobuf is forbidden.
  And because protobuf (4.21.1) requires Python >=3.7
   and protobuf (4.21.2) requires Python >=3.7, protobuf is forbidden.
  And because protobuf (4.21.3) requires Python >=3.7
   and protobuf (4.21.4) requires Python >=3.7, protobuf is forbidden.
  Because no versions of bitbox02 match >6.1.0,<7.0.0
   and bitbox02 (6.1.0) depends on protobuf (>=3.21), bitbox02 (>=6.1.0,<7.0.0) requires protobuf (>=3.21).
  Thus, bitbox02 is forbidden.             
  So, because hwi depends on bitbox02 (>=6.1.0,<7.0.0), version solving failed.

Can I make a PR that drops support for Python 3.6, requiring Python >=3.7?

benma avatar Aug 02 '22 13:08 benma

Fyi:

Python 3.6 reached end-of-life on Dec 23, 2021 and is not getting any security updates anymore. This is the reason protobuf dropped support, and it makes sense imo to do the same for HWI.

benma avatar Aug 02 '22 13:08 benma

@achow101 a response needed - this is blocking us from updating the bitbox02 package in HWI, preventing the protobuf incompatibility issue to be fixed, which breaks downstream wallets for some BitBox02 users.

benma avatar Oct 17 '22 07:10 benma

I will try to take a look this week, been busy with other work and travel recently.

achow101 avatar Oct 17 '22 14:10 achow101