Skip to content

Commit 2667137

Browse files
committed
Cleanup build.yaml and Update esp_merge_bin.py
1 parent 779f2f3 commit 2667137

2 files changed

Lines changed: 17 additions & 24 deletions

File tree

.github/workflows/build.yaml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,15 @@ jobs:
8080
- name: Set up Python
8181
uses: actions/setup-python@v5
8282
with:
83-
python-version: "3.x"
84-
- name: Install dependencies
83+
# python-version: "3.x"
84+
python-version: "3.12" # Stable version as of 2024-06
85+
- name: Install PlatformIO & Dependencies
8586
run: |
8687
python -m pip install --upgrade pip
87-
- name: Install Setuptools
88-
run: |
89-
pip install --upgrade setuptools
90-
pip install --upgrade dulwich
91-
- name: Install PlatformIO
92-
run: |
93-
pip install --upgrade platformio
88+
pip install --upgrade platformio dulwich
89+
#- name: Install Setuptools
90+
# run: |
91+
# pip install --upgrade setuptools # obsolete, use importlib.metadata instead
9492
- name: Enable ESP32 platforms from platformio_override-template.ini
9593
run: |
9694
sed 's/; user_setups\/esp32/user_setups\/esp32/g' platformio_override-template.ini > platformio_override.ini
@@ -141,11 +139,12 @@ jobs:
141139
- name: Set up Python
142140
uses: actions/setup-python@v5
143141
with:
144-
python-version: "3.x"
145-
- name: Install PlatformIO
142+
# python-version: "3.x"
143+
python-version: "3.12" # Stable version as of 2024-06
144+
- name: Install PlatformIO & Dependencies
146145
run: |
147146
python -m pip install --upgrade pip
148-
pip install --upgrade platformio
147+
pip install --upgrade platformio dulwich
149148
- name: Enable Linux platform from platformio_override.ini
150149
run: |
151150
sed 's/; user_setups\/linux/user_setups\/linux/g' platformio_override-template.ini > platformio_override.ini
@@ -164,9 +163,5 @@ jobs:
164163
run: |
165164
sed -i 's/; user_setups\/linux/user_setups\/linux/g' platformio_override.ini
166165
mkdir -p .pio/libdeps/linux_sdl/paho/src
167-
- name: Install SDL2 library
168-
run: |
169-
sudo apt-get update
170-
sudo apt-get install libsdl2-dev
171166
- name: Run PlatformIO
172167
run: pio run -e linux_sdl

tools/esp_merge_bin.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os, sys, json
33
import shutil
44
import subprocess
5-
import pkg_resources
5+
from importlib import metadata # Vervang pkg_resources
66

77
buildFlags = env.ParseFlags(env['BUILD_FLAGS'])
88
OUTPUT_DIR = "build_output{}".format(os.path.sep)
@@ -11,14 +11,12 @@
1111
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
1212
FRAMEWORK_DIR = "{}{}".format(FRAMEWORK_DIR, os.path.sep)
1313

14-
required_pkgs = {'dulwich'}
15-
installed_pkgs = {pkg.key for pkg in pkg_resources.working_set}
16-
missing_pkgs = required_pkgs - installed_pkgs
17-
18-
if missing_pkgs:
19-
# As of pip v23.1 the global-options flag has been removed and we should use the config-settings flag instead.
14+
# Verbeterde check voor dulwich
15+
try:
16+
metadata.version('dulwich')
17+
except metadata.PackageNotFoundError:
2018
print("Installing dependencies...")
21-
print("Note: If you see an error about an unknown '--config-settings' option, please update pip to the latest version.")
19+
# Gebruik env.Execute om binnen de PlatformIO omgeving te blijven
2220
env.Execute('$PYTHONEXE -m pip install dulwich --config-settings "--build-option=--pure" --use-pep517')
2321

2422
from dulwich import porcelain

0 commit comments

Comments
 (0)