diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2020-06-18 13:36:09 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2020-06-18 13:39:30 +0300 |
commit | bf1eb547d76d416c83ec3c3ca2d8f8f6fdc2770b (patch) | |
tree | f994b75d8ec77595ec5107b0818356571752d0d9 /docs | |
parent | 040cd30712a4e8a62c0b36a39e776e18e93d0052 (diff) |
Change generator to use Python 3 by default (#441, #509).
This may break things for users that have python-protobuf installed
only for Python 2. Easiest fix is to just install python3-protobuf.
After much consideration, I think making the change now will make
life easiest for most users. There are now alternative files that
can be used if only Python 2 is available, see migration.rst.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/migration.rst | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/docs/migration.rst b/docs/migration.rst index 8a73d5b..2b00fba 100644 --- a/docs/migration.rst +++ b/docs/migration.rst @@ -11,8 +11,33 @@ are included, in order to make it easier to find this document. .. contents :: -Nanopb-0.4.0 (future) -===================== +Nanopb-0.4.2 (2020-xx-xx) +========================= + +Generator now uses Python 3 by default +-------------------------------------- + +**Rationale:** Previously `nanopb-generator.py` had hashbang of +`#!/usr/bin/env python`, which would execute with Python 2 on most systems. +Python 2 is now deprecated and many libraries are dropping support for it, which +makes installing dependencies difficult. While `nanopb_generator.py` has worked +with Python 3 for years now, and overriding the python version was possible +with virtualenv, that was an extra complication. + +**Changes:** Hashbang now uses `#!/usr/bin/env python3`. New file +`nanopb_generator.py2` can be used to run with Python 2, if necessary. + +**Required actions:** If possible, just verify Python 3 is installed and necessary +dependencies are installed for it. For example `pip3 install protobuf grpcio-tools` +should take care of it. If this is not possible, call `nanopb_generator.py2` from +your build scripts instead. + +**Error indications:** `python3: command not found` if Python 3 is not installed. +`Could not import the Google protobuf Python libraries` if dependencies are only +installed for Python 2. + +Nanopb-0.4.0 (2019-12-20) +========================= New field descriptor format --------------------------- |