|
| 1 | +# Python 3.8 Backport for Debian buster |
| 2 | + |
| 3 | +The aim of this project is to provide a Python 3.8 backport to Debian buster. Packages are of course much better manageable then compiling the source from scratch. |
| 4 | + |
| 5 | +Motivation for this project was the [deprecation of Python 3.7 support in Home Assistant](https://www.home-assistant.io/blog/2020/10/07/release-116/#python-37-deprecated). Support ends in version 0.118 which is scheduled for somewhere in December. While Debian bullseye will not be released anytime before Apil 2021. In the meantime, you can use this backport. |
| 6 | + |
| 7 | +## Scope |
| 8 | +The scope of this project is limited to backporting just Python 3.8 itself. So no defaults (which provide virtual packages so `python3` get's automatically linked to `python3.8`), no pip and no pip-packages. This version should be an extension to your system, but it's not meant to replace an existing Python installation. |
| 9 | + |
| 10 | +### Virtual enviroment |
| 11 | +To make the `venv` module work without backporting all pip-related packages, the `python3.8-venv` package depends on `python3-distutils` which is present in buster. After you have created your virtual enviroment you can then update pip itself and any packages as usual. |
| 12 | + |
| 13 | +## Repository |
| 14 | +You can download the packages in my repository at `deb.pascalroeleven.nl` by adding this line to your sources.list: |
| 15 | +```sh |
| 16 | +deb http://deb.pascalroeleven.nl/python3.8 buster-backports main |
| 17 | +``` |
| 18 | +You should also add my PGP (which you can get from my website via https) to APT's sources keyring: |
| 19 | +```sh |
| 20 | +wget https://pascalroeleven.nl/deb-pascalroeleven.gpg |
| 21 | +sudo apt-key add deb-pascalroeleven.gpg |
| 22 | +``` |
| 23 | + |
| 24 | +## Support |
| 25 | +Currently there is support for **`amd64`** and **`armhf`** architectures. The `amd64` packages are build natively while the `armhf` packages are crossbuilt. Testing is not possible while crossbuilding, so these packages did not undergo the same amount of testing as usual Debian packages do. |
| 26 | + |
| 27 | +## Building the packages yourself |
| 28 | +If you want to build the packages yourself, you can use the Dockerfile and the patches in this repository. Patches will be applied by the Dockerfile. |
| 29 | + |
| 30 | +Two targets are supported: `native` and `crossbuild`. You should specify either of these: |
| 31 | +```sh |
| 32 | +docker build --target native . |
| 33 | +``` |
| 34 | + |
| 35 | +When crossbuilding, you can specify the architecture by adding the `CROSSBUILD` build argument: |
| 36 | +```sh |
| 37 | +docker build --target crossbuild --build-arg CROSSBUILD=armhf . |
| 38 | +``` |
| 39 | + |
| 40 | +You can also specify your name, email and changelog message when building which will then be added to the changelog. |
| 41 | +```sh |
| 42 | +docker build --target native --build-arg NAME= "James Smith" --build-arg EMAIL= "[email protected]" --build-arg CHANGE= "Initial backport for buster" . |
| 43 | +``` |
| 44 | + |
| 45 | +Building natively takes about 2 hours on a modern decent PC because of the extensive testing. Cross building takes about 30 minutes (but uses native binaries so requires the extra 2 hours the first time). |
0 commit comments