Skip to content

Commit 701fcd2

Browse files
authored
Merge pull request #53 from espressif/fix/wheels_fixtures
Fixed wheels issues with Python 3.14 + improvements
2 parents f6205e2 + 7130418 commit 701fcd2

File tree

8 files changed

+78
-33
lines changed

8 files changed

+78
-33
lines changed

.github/workflows/build-wheels-defined.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ jobs:
226226
fail-fast: false
227227
matrix:
228228
python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }}
229-
container: python:${{ matrix.python-version }}-bullseye
229+
container: python:${{ matrix.python-version }}-bookworm
230230
steps:
231231
- name: Checkout repository
232232
uses: actions/checkout@v4
@@ -265,7 +265,7 @@ jobs:
265265
fail-fast: false
266266
matrix:
267267
python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }}
268-
container: python:${{ matrix.python-version }}-bullseye
268+
container: python:${{ matrix.python-version }}-bookworm
269269
steps:
270270
- name: Checkout repository
271271
uses: actions/checkout@v4

.github/workflows/build-wheels-platforms.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
os: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
2525
- windows-latest
2626
- ubuntu-latest
27-
- macos-13 # MacOS x86_64
27+
- macos-15-intel # MacOS x86_64
2828
- macos-latest # MacOS arm64 (M1)
2929
- ubuntu-24.04-arm
3030
- linux-armv7-self-hosted
3131
include:
3232
- os: linux-armv7-self-hosted
33-
CONTAINER: python:${{ needs.get-supported-versions.outputs.oldest_supported_python }}-bullseye
33+
CONTAINER: python:${{ needs.get-supported-versions.outputs.oldest_supported_python }}-bookworm
3434
python-version: ['${{ needs.get-supported-versions.outputs.oldest_supported_python }}']
3535

3636
# Use python container on ARM
@@ -66,23 +66,24 @@ jobs:
6666
python-version: ${{ matrix.python-version }}
6767

6868

69-
- name: Get Python version
69+
- name: Install build dependencies
7070
run: |
71-
python --version
72-
python -m pip install --upgrade pip setuptools setuptools-scm
73-
pip show pip setuptools setuptools-scm
71+
python -m pip install --upgrade pip
72+
python -m pip install -r build_requirements.txt
7473
7574
76-
- name: Install build dependencies
77-
run: python -m pip install -r build_requirements.txt
75+
- name: Get Tools versions
76+
run: |
77+
python --version
78+
pip show pip setuptools
7879
7980
8081
- name: Install additional OS dependencies - Ubuntu
8182
if: matrix.os == 'ubuntu-latest'
8283
run: os_dependencies/ubuntu.sh
8384

8485
- name: Install additional OS dependencies - MacOS
85-
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
86+
if: matrix.os == 'macos-latest' || matrix.os == 'macos-15-intel'
8687
run: os_dependencies/macos.sh
8788

8889
- name: Install additional OS dependencies - Linux ARM
@@ -97,7 +98,7 @@ jobs:
9798
- name: Build wheels for IDF
9899
if: matrix.os != 'windows-latest'
99100
run: |
100-
# Rust directory needs to be included for Linux ARM7
101+
# Source Rust environment for self-hosted ARMv7 runner
101102
if [ "${{ matrix.os }}" = "linux-armv7-self-hosted" ]; then
102103
. $HOME/.cargo/env
103104
fi
@@ -106,8 +107,7 @@ jobs:
106107
107108
- name: Build wheels for IDF - Windows
108109
if: matrix.os == 'windows-latest'
109-
run: |
110-
python build_wheels.py
110+
run: python build_wheels.py
111111

112112
- name: Upload artifacts of downloaded_wheels directory
113113
uses: actions/upload-artifact@v4

.github/workflows/build-wheels-python-dependent.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
os:
2323
- windows-latest
2424
- ubuntu-latest
25-
- macos-13 # MacOS x86_64
25+
- macos-15-intel # MacOS x86_64
2626
- macos-latest # MacOS arm64 (M1)
2727
- ubuntu-24.04-arm
2828
- linux-armv7-self-hosted
@@ -34,16 +34,16 @@ jobs:
3434
- python-version: ${{ inputs.oldest_supported_python }}
3535
os: ubuntu-latest
3636
- python-version: ${{ inputs.oldest_supported_python }}
37-
os: macos-13
37+
os: macos-15-intel
3838
- python-version: ${{ inputs.oldest_supported_python }}
3939
os: macos-latest
4040
- python-version: ${{ inputs.oldest_supported_python }}
4141
os: ubuntu-24.04-arm
4242
- python-version: ${{ inputs.oldest_supported_python }}
4343
os: linux-armv7-self-hosted
4444

45-
# Use python container on ARM - dynamically constructed
46-
container: ${{matrix.os == 'linux-armv7-self-hosted' && format('python:{0}-bullseye', matrix.python-version) || null }}
45+
# Use python container on ARM - dynamically constructed with bookworm (Debian 12)
46+
container: ${{matrix.os == 'linux-armv7-self-hosted' && format('python:{0}-bookworm', matrix.python-version) || null}}
4747

4848
steps:
4949
- name: Checkout repository
@@ -71,7 +71,7 @@ jobs:
7171
run: os_dependencies/ubuntu.sh
7272

7373
- name: Install additional OS dependencies - MacOS
74-
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
74+
if: matrix.os == 'macos-latest' || matrix.os == 'macos-15-intel'
7575
run: os_dependencies/macos.sh
7676

7777

@@ -96,7 +96,7 @@ jobs:
9696
- name: Build Python dependent wheels for ${{ matrix.python-version }}
9797
if: matrix.os != 'windows-latest'
9898
run: |
99-
# Rust directory needs to be included for Linux ARM7
99+
# Source Rust environment for self-hosted ARMv7 runner
100100
if [ "${{ matrix.os }}" = "linux-armv7-self-hosted" ]; then
101101
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
102102
. $HOME/.cargo/env

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Supported architectures:
1515
- ARM64
1616

1717
Supported Python versions:
18+
* 3.14
1819
* 3.13
1920
* 3.12
2021
* 3.11

build_requirements.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,15 @@ PyYAML~=6.0.1
66
colorama~=0.4.6
77
# ----- build process -----
88
boto3~=1.34.4
9+
10+
# setuptools and wheel are needed for Python < 3.10, otherwise resolution with importlib_metadata might be broken
11+
# https://github.com/espressif/esp-idf/commit/3bad4348d0597597e4079878aa5de1871403e0b2
12+
setuptools<75.8.1; python_version < "3.10"
13+
wheel<0.45.0; python_version < "3.10"
14+
15+
# Common build dependencies for packages built with --no-build-isolation
16+
cffi>=1.15.0 # Required by packages with C extensions (e.g., xcffib, cryptography)
17+
setuptools-scm>=6.2,<9 # Required by packages using git-based versioning
18+
setuptools-rust>=1.5.0,<2 # Required by packages with Rust extensions (e.g., cryptography, bleak, rpds-py)
19+
cython>=0.29.0 # Required by packages using Cython (e.g., coverage, pyyaml speedups)
20+
poetry-core>=1.0.0 # Required as build backend for packages using Poetry

build_wheels.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ def build_wheels(requirements: set, local_links: bool = True) -> dict:
288288
"https://pypi.org/simple/",
289289
"--wheel-dir",
290290
f"{dir}",
291+
"--no-cache-dir",
292+
"--no-build-isolation",
291293
f"{argument}",
292294
f"{arg_param}",
293295
],
@@ -314,6 +316,8 @@ def build_wheels(requirements: set, local_links: bool = True) -> dict:
314316
"https://pypi.org/simple/",
315317
"--wheel-dir",
316318
f"{dir}",
319+
"--no-cache-dir",
320+
"--no-build-isolation",
317321
],
318322
stdout=subprocess.PIPE,
319323
stderr=subprocess.PIPE,

exclude_list.yaml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
platform: ['linux']
1717
python: '==3.8'
1818

19+
# dbus-python can not be build with Python > 3.11 on MacOS
20+
- package_name: 'dbus-python'
21+
platform: 'darwin'
22+
python: '>3.11'
23+
1924
# PyGObject is difficult to build from source on Windows due to MSYS2/pkg-config issues
2025
- package_name: 'pygobject'
2126
platform: ['win32']
@@ -25,11 +30,6 @@
2530
- package_name: 'pygobject'
2631
platform: ['linux']
2732

28-
# dbus-python can not be build with Python > 3.11 on MacOS
29-
- package_name: 'dbus-python'
30-
platform: 'darwin'
31-
python: '>3.11'
32-
3333
# gevent==1.5.0 can not be build with Python > 3.8
3434
- package_name: 'gevent'
3535
version: '==1.5.0'
@@ -43,15 +43,15 @@
4343
- package_name: 'Pillow'
4444
version: '==9.5.0'
4545

46-
# some versions of greenlet are not supported by Python 3.13
46+
# some versions of greenlet are not supported by Python 3.13 and newer
4747
- package_name: 'greenlet'
4848
version: '<3.0'
49-
python: '==3.13'
49+
python: '>=3.13'
5050

51-
# Python 3.13 does not support ruamel.yaml.clib 0.2.8 (0.2.12+ supports Python 3.13)
51+
# Python 3.13 and newer does not support ruamel.yaml.clib 0.2.8 (0.2.12+ supports Python 3.13 and newer)
5252
- package_name: 'ruamel.yaml.clib'
5353
version: '==0.2.8'
54-
python: '==3.13'
54+
python: '>=3.13'
5555

5656
# tree-sitter versions are not supported by all Python versions
5757
# https://pypi.org/project/tree-sitter/
@@ -89,3 +89,27 @@
8989
- package_name: 'pytest-embedded-serial-esp'
9090
version: '>1.17.0'
9191
python: ['==3.8', '==3.9']
92+
93+
# windows_curses does not support Python 3.14
94+
# https://pypi.org/project/windows-curses/
95+
# https://github.com/zephyrproject-rtos/windows-curses/issues/76
96+
- package_name: 'windows_curses'
97+
platform: ['win32']
98+
python: '>=3.14'
99+
100+
# pydantic and some dependencies have issues with Python 3.14 and mainly MacOS
101+
- package_name: 'pydantic_core'
102+
version: '<2.41.2'
103+
python: '>=3.14'
104+
- package_name: 'rpds_py'
105+
version: '<0.27.0'
106+
python: '>=3.14'
107+
- package_name: 'pyobjc_core'
108+
platform: ['darwin']
109+
version: '==10.3.2'
110+
python: '>=3.14'
111+
112+
# mcp is not supported by Python older than 3.10
113+
# https://pypi.org/project/mcp/
114+
- package_name: 'mcp'
115+
python: ['==3.8', '==3.9']

upload_wheels.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,21 @@
2525

2626
wheels_subdirs = os.listdir(WHEELS_DIR)
2727

28+
29+
def normalize(name):
30+
return re.sub(r"[-_.]+", "-", name).lower()
31+
32+
2833
for subdir in wheels_subdirs:
2934
wheel_files = os.listdir(f"{WHEELS_DIR}{os.sep}{subdir}")
3035

3136
for wheel in wheel_files:
32-
pattern = re.compile(r"(\w*)-(\d+)")
37+
pattern = re.compile(r"^(.+?)-(\d+)")
3338
match = pattern.search(wheel)
3439
if match:
3540
wheel_name = match.group(1)
3641

37-
wheel_name = wheel_name.lower()
38-
wheel_name = wheel_name.replace("_", "-")
42+
wheel_name = normalize(wheel_name)
3943

4044
BUCKET.upload_file(f"{WHEELS_DIR}{os.sep}{subdir}{os.sep}{wheel}", f"pypi/{wheel_name}/{wheel}")
41-
print(f"Uploaded {wheel}")
45+
print(f"Uploaded {wheel_name}/{wheel}")

0 commit comments

Comments
 (0)