Commit 69fd7b0
committed
Add pyserial package to action virtual environment
Although Arduino boards platforms traditionally have bundled all dependencies, the ESP32 boards platform expects the
pyserial Python package to be preinstalled on Linux systems.
Although there is already test coverage and support for user installation of arbitrary Python package dependencies of a
platform, the situation is more complex when it comes to this important boards platform. The problem is that there is an
established use pattern that should be supported to avoid breaking user workflows. The pattern is the use of a
`pip install pyserial` command in the workflow to install the package. That command correctly installs the package in
the "user site-packages" folder when the job runs in the `ubuntu-18.04` GitHub Actions runner, as was the case when the
use pattern was established. However, pyserial is installed in the Linux package manager "site-packages" folder of the
Ubuntu GitHub Actions runner starting from ubuntu-20.04 (most workflows run the arduino/compile-sketches job in the
`ubuntu-latest` runner, which is currently `ubuntu-22.04`). This causes the established installation command to
terminate without installing the package:
```
Requirement already satisfied: pyserial in /usr/lib/python3/dist-packages (3.5)
```
This did not cause a problem previously because the action was configured to include all system site-packages in the
action's Python virtual environment. Because this approach resulted in the uncontrolled introduction of irrelevant
packages into the action's Python virtual environment, the action was changed to only include the "user site-packages"
in the virtual environment. That is fine if the now-recommended `--ignore-installed` flag is added to the pyserial
installation command, but it breaks the established workflows.
Although the goal was always to provide a flexible system that would allow the user installation of any arbitrary
platform dependency, rather than hardcoding specific dependencies in the action itself, unfortunately I have not been
able to find any way to progress in the improvement of the action without breaking the established workflows that
compile for ESP32 boards. So as a workaround I am reluctantly adding the pyserial package to the action's virtual
environment.
This workaround will be reverted before the 2.0.0 release of the action so the pyserial installation command should be
retained in workflows and occurrences of the historical `pip install pyserial` (or `pip3 install pyserial`) commands
should be updated to the recommended command:
```
pip install --ignore-installed --user pyserial
```1 parent 26f371d commit 69fd7b0
3 files changed
+26
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
| |||
0 commit comments