Skip to content

Commit 81b2eae

Browse files
committed
ci(gh_actions): fix python version in github actions
1 parent 955a7c8 commit 81b2eae

File tree

4 files changed

+42
-12
lines changed

4 files changed

+42
-12
lines changed

.github/workflows/build_esptool.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
name: Build and test in ${{ matrix.platform }}
2222
with:
2323
arch: ${{ matrix.platform }}
24-
distro: ubuntu20.04
24+
distro: ubuntu22.04
2525
shell: /bin/bash
2626
# Not required, but speeds up builds by storing container images in
2727
# a GitHub package registry.
@@ -31,17 +31,20 @@ jobs:
3131
dockerRunArgs: --volume "${PWD}/${{ env.DISTPATH }}:/${{ env.DISTPATH }}"
3232
install: |
3333
apt-get update -y
34-
apt-get install --ignore-missing -y python3 python3-pip python3-setuptools python-is-python3 pkg-config openssl libffi-dev libssl-dev cargo rustc
34+
apt-get install -y software-properties-common
35+
add-apt-repository -y ppa:deadsnakes/ppa
36+
apt-get update -y
37+
apt-get install --ignore-missing -y python3.11 python3.11-dev python3-pip pkg-config openssl libffi-dev libssl-dev cargo rustc
38+
python3.11 -m pip install --upgrade pip setuptools wheel
3539
run: |
40+
python3.11 -m pip install --upgrade cffi
3641
adduser --disabled-password --gecos "" builder
3742
chmod -R a+rwx /home/runner/work/esptool
3843
su builder <<EOF
3944
export PATH=\$PATH:/home/builder/.local/bin
4045
# Install dependencies
41-
python -m pip install --upgrade pip
42-
# PyInstaller >=6.0 results in significantly more antivirus false positives
43-
pip install pyinstaller==5.13.2
44-
pip install --user -e .
46+
python3.11 -m pip install pyinstaller==6.11.1
47+
python3.11 -m pip install --user -e .
4548
4649
# Build with PyInstaller
4750
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.STUBS_DIR }}1/*.json:${{ env.STUBS_DIR }}1/" --add-data="${{ env.STUBS_DIR }}2/*.json:${{ env.STUBS_DIR }}2/" esptool.py
@@ -87,7 +90,7 @@ jobs:
8790
- platform: linux-amd64
8891
TARGET: linux-amd64
8992
SEPARATOR: ':'
90-
RUN_ON: ubuntu-20.04
93+
RUN_ON: ubuntu-22.04
9194
env:
9295
DISTPATH: esptool-${{ matrix.TARGET }}
9396
STUBS_DIR: ./esptool/targets/stub_flasher/
@@ -96,15 +99,14 @@ jobs:
9699
steps:
97100
- name: Checkout repository
98101
uses: actions/checkout@master
99-
- name: Set up Python 3.8
102+
- name: Set up Python 3.11
100103
uses: actions/setup-python@master
101104
with:
102-
python-version: 3.8
105+
python-version: "3.11"
103106
- name: Install dependencies
104-
# PyInstaller >=6.0 results in significantly more antivirus false positives
105107
run: |
106108
python -m pip install --upgrade pip
107-
pip install pyinstaller==5.13.2
109+
pip install pyinstaller==6.11.1
108110
pip install --user -e .
109111
- name: Build with PyInstaller
110112
run: |

.github/workflows/test_esptool.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: Set up Python 3.10
7272
uses: actions/setup-python@master
7373
with:
74-
python-version: 3.10
74+
python-version: "3.10"
7575

7676
- name: Run pre-commit hooks
7777
run: |

docs/en/installation.rst

+19
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,25 @@ Creating a virtual environment (venv) is a good practice. This is particularly h
4646
- When you're done using ``esptool.py``, deactivate the virtual environment: ``deactivate``. The environment can be reused by activating it again.
4747
- If you no longer need the virtual environment, you can remove it by deleting the ``esptoolenv`` directory.
4848

49+
Binary Releases
50+
^^^^^^^^^^^^^^^^
51+
52+
If you do not want to install Python and all the dependencies, you can use the pre-built binaries from the `GitHub Releases <https://github.com/espressif/esptool/releases>`_.
53+
54+
Please note that the binaries might have some limitations:
55+
56+
- The binaries might rely on some system libraries that are not available on all systems.
57+
- The binaries are available only for selected operating systems - currently macOS (x86_64, arm64), Linux (x86_64, armv7,aarch64) and Windows (x86_64).
58+
- The binaries might get reported as malware by your antivirus software.
59+
- The application is larger in size compared to the Python package installation, as it includes all dependencies.
60+
- The application has slower startup time compared to running the Python script directly.
61+
- The application cannot be imported as a Python module in other Python applications.
62+
63+
.. note::
64+
65+
For Linux, the binaries are built using Ubuntu 22.04 as the base image. That means any version older than Ubuntu 22.04 (or any other distribution that uses ``glibc<2.35``) might not work.
66+
For using on Ubuntu 20.04, please use the Python package installation or ``v4.*`` release.
67+
4968
How to Update
5069
-------------
5170

docs/en/migration-guide.rst

+9
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,12 @@ The ``make_image`` command for the ESP8266 has been **removed in v5**. This comm
180180
**Migration Steps:**
181181

182182
1. Replace any ``make_image`` workflows with the recommended way of assembling firmware images using **objcopy** and ``elf2image``.
183+
184+
Using Binary from GitHub Releases on Linux
185+
******************************************
186+
187+
The ``esptool.py`` binary from GitHub Releases on Linux is now using Ubuntu 22.04 as the base image. That means the image is using ``glibc`` 2.35, which is not fully compatible with the ``glibc`` 2.28 from Ubuntu 20.04 (the base image for ``v4.*``).
188+
189+
**Migration Steps:**
190+
191+
1. Update your operating system to a newer version which bundles ``glibc`` 2.35 or later

0 commit comments

Comments
 (0)