@@ -43,14 +43,14 @@ inputs:
4343 required : false
4444 default : ' '
4545 pip-extra-index-url :
46- description : Extra pip index URL
46+ description : Extra Python Package Index URL
4747 required : false
4848 default : https://dl.espressif.com/pypi
4949 install-deps-command :
5050 description : Command to install project dependencies. Command will be executed
51- like `python -m {install-deps-command}`
51+ like `uv pip install {install-deps-command}`
5252 required : false
53- default : pip install --user --prefer-binary -e .
53+ default : uv pip install -e .
5454 additional-arm-packages :
5555 description : ' ARMv7 ONLY: Additional system packages to install (space-separated).
5656 e.g. for cryptography: openssl libffi-dev libffi7 libssl-dev'
@@ -137,22 +137,24 @@ runs:
137137 export DEBIAN_FRONTEND=noninteractive
138138 export TZ=UTC
139139 apt-get update -y
140- apt-get install -y software-properties-common
141- add-apt-repository -y ppa:deadsnakes/ppa
142- apt-get update -y
143- apt-get install --ignore-missing -y curl python${{ inputs.python-version }} python${{ inputs.python-version }}-dev pkg-config gcc g++ patchelf binutils zlib1g-dev ${{ inputs.additional-arm-packages }}
144- # Install pip for requested Python version using get-pip.py as ensurepip does not work here
145- curl -sS https://bootstrap.pypa.io/get-pip.py | python${{ inputs.python-version }}
146- python${{ inputs.python-version }} -m pip install --upgrade pip setuptools wheel
140+ apt-get install -y curl git build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev pkg-config gcc g++ patchelf binutils ${{ inputs.additional-arm-packages }}
147141 run : |
148142 adduser --disabled-password --gecos "" builder
149143 chmod -R a+rwx /home/runner/work
150144 su builder <<'EOF'
145+ curl -LsSf https://astral.sh/uv/install.sh | sh
146+ source $HOME/.local/bin/env
147+ # Install Python version using uv
148+ uv python install ${{ inputs.python-version }}
149+ # Create and activate virtual environment
150+ uv venv
151+ source .venv/bin/activate
152+ # Install UV and upgrade tools
153+ uv pip install --upgrade setuptools wheel
151154 export PATH=$PATH:/home/builder/.local/bin
152155
153156 # Setup environment using helper script
154157 /github/action/setup_environment.sh \
155- "python${{ inputs.python-version }}" \
156158 "${{ inputs.pyinstaller-version }}" \
157159 "${{ inputs.pip-extra-index-url }}" \
158160 "${{ inputs.install-deps-command }}"
@@ -163,7 +165,6 @@ runs:
163165 # Build each file using the script
164166 export GITHUB_ACTION_PATH=/github/action
165167 /github/action/build_with_pyinstaller.sh \
166- "python${{ inputs.python-version }}" \
167168 "${{ inputs.target-platform }}" \
168169 "${{ inputs.output-dir }}" \
169170 "${{ inputs.scripts }}" \
@@ -197,31 +198,48 @@ runs:
197198 export DEBIAN_FRONTEND=noninteractive &&
198199 export TZ=UTC &&
199200 apt-get update -y &&
200- apt-get install -y software-properties-common curl &&
201- add-apt-repository -y ppa:deadsnakes/ppa &&
202- apt-get update -y &&
203- apt-get install -y python${{ inputs.python-version }} python${{ inputs.python-version }}-dev pkg-config gcc g++ patchelf binutils zlib1g-dev &&
204- curl -sS https://bootstrap.pypa.io/get-pip.py | python${{ inputs.python-version }} &&
205- python${{ inputs.python-version }} -m pip install --upgrade pip setuptools wheel &&
201+ apt-get install -y curl git build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev pkg-config gcc g++ patchelf binutils &&
202+ curl -LsSf https://astral.sh/uv/install.sh | sh &&
203+ source /root/.local/bin/env &&
204+ # Install Python version using uv
205+ uv python install ${{ inputs.python-version }} &&
206+ # Create and activate virtual environment
207+ uv venv &&
208+ source .venv/bin/activate &&
209+ # Install UV and upgrade tools
210+ uv pip install --upgrade setuptools wheel &&
206211
207212 export GITHUB_ACTION_PATH=/github/action &&
208213 /github/action/setup_environment.sh \
209- 'python${{ inputs.python-version }}' \
210214 '${{ inputs.pyinstaller-version }}' \
211215 '${{ inputs.pip-extra-index-url }}' \
212216 '${{ inputs.install-deps-command }}' &&
213217
214218 # Execute the build script
215- /github/action/build_with_pyinstaller.sh 'python${{ inputs.python-version }}' ' ${{ inputs.target-platform }}' '${{ inputs.output-dir }}' '${{ inputs.scripts }}' '${{ inputs.script-name }}' '${{ inputs.icon-file }}' '/github/action/include_data_dirs.json' '${{ steps.setup-platform.outputs.data-separator }}' '${{ inputs.additional-args }}'
219+ /github/action/build_with_pyinstaller.sh '${{ inputs.target-platform }}' '${{ inputs.output-dir }}' '${{ inputs.scripts }}' '${{ inputs.script-name }}' '${{ inputs.icon-file }}' '/github/action/include_data_dirs.json' '${{ steps.setup-platform.outputs.data-separator }}' '${{ inputs.additional-args }}'
216220 "
217221
222+ - name : Install UV
223+ if : |
224+ steps.setup-platform.outputs.needs-docker == 'false' && steps.setup-platform.outputs.needs-arm-emulation == 'false'
225+ uses : astral-sh/setup-uv@v6
226+ with :
227+ enable-cache : true
228+
218229 - name : Setup environment (Native platforms)
219230 if : |
220231 steps.setup-platform.outputs.needs-docker == 'false' && steps.setup-platform.outputs.needs-arm-emulation == 'false'
221232 shell : bash
222233 run : |
234+ # Create and activate virtual environment
235+ uv venv
236+ if [ "${{ inputs.target-platform }}" == 'windows-amd64' ]; then
237+ source .venv\\Scripts\\activate
238+ else
239+ source .venv/bin/activate
240+ fi
241+
223242 $GITHUB_ACTION_PATH/setup_environment.sh \
224- 'python' \
225243 '${{ inputs.pyinstaller-version }}' \
226244 '${{ inputs.pip-extra-index-url }}' \
227245 '${{ inputs.install-deps-command }}'
@@ -232,7 +250,7 @@ runs:
232250 id : build
233251 shell : bash
234252 run : |
235- $GITHUB_ACTION_PATH/build_with_pyinstaller.sh 'python' ' ${{ inputs.target-platform }}' '${{ inputs.output-dir }}' '${{ inputs.scripts }}' '${{ inputs.script-name }}' '${{ inputs.icon-file }}' '${{ inputs.include-data-dirs }}' '${{ steps.setup-platform.outputs.data-separator }}' '${{ inputs.additional-args }}'
253+ $GITHUB_ACTION_PATH/build_with_pyinstaller.sh '${{ inputs.target-platform }}' '${{ inputs.output-dir }}' '${{ inputs.scripts }}' '${{ inputs.script-name }}' '${{ inputs.icon-file }}' '${{ inputs.include-data-dirs }}' '${{ steps.setup-platform.outputs.data-separator }}' '${{ inputs.additional-args }}'
236254
237255 echo "success=true" >> $GITHUB_OUTPUT
238256
0 commit comments