Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8d5d84e

Browse filesBrowse files
authored
fix: accept current Python version if acceptable for Pyodide (#1868)
* fix: accept current Python version if acceptable for Pyodide Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 4ada77d commit 8d5d84e
Copy full SHA for 8d5d84e

File tree

Expand file treeCollapse file tree

2 files changed

+8
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-3
lines changed

‎action.yml

Copy file name to clipboardExpand all lines: action.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ branding:
2424
runs:
2525
using: composite
2626
steps:
27-
# Set up a non-EOL, cibuildwheel & pipx supported Python version
27+
# Set up the version of Python that supports pyodide
2828
- uses: actions/setup-python@v5
2929
id: python
3030
with:
31-
python-version: "3.8 - 3.12"
31+
python-version: "3.12"
3232
update-environment: false
3333

3434
- id: cibw

‎cibuildwheel/pyodide.py

Copy file name to clipboardExpand all lines: cibuildwheel/pyodide.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import shutil
5+
import sys
56
from collections.abc import Sequence, Set
67
from dataclasses import dataclass
78
from pathlib import Path
@@ -92,7 +93,11 @@ def install_xbuildenv(env: dict[str, str], pyodide_version: str) -> str:
9293
def get_base_python(identifier: str) -> Path:
9394
implementation_id = identifier.split("-")[0]
9495
majorminor = implementation_id[len("cp") :]
95-
major_minor = f"{majorminor[0]}.{majorminor[1:]}"
96+
version_info = (int(majorminor[0]), int(majorminor[1:]))
97+
if version_info == sys.version_info[:2]:
98+
return Path(sys.executable)
99+
100+
major_minor = ".".join(str(v) for v in version_info)
96101
python_name = f"python{major_minor}"
97102
which_python = shutil.which(python_name)
98103
if which_python is None:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.