Skip to content

Commit 27791c1

Browse files
Test with Pyodide 0.27.2 (#183)
* Bump to Pyodide 0.27.2 * Also run [integration] tests * Fix `AttributeError` with `_compat_in_pyodide` [integration] * Coloured output for tests [integration] * Use updated `micropip` version for test [integration] * Try: set scheme as "file" if not set * Fix `file://` scheme insertion in test assert * Run [integration] tests * Don't directly instantiate `ParseResult` [integration] * Revert "Don't directly instantiate `ParseResult` [integration]" This reverts commit 09772c8. * Enforce `file:///` scheme and no netloc [integration] * Revert "Enforce `file:///` scheme and no netloc [integration]" This reverts commit f1de916.
1 parent 4728a85 commit 27791c1

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ concurrency:
99
group: main-${{ github.head_ref || github.run_id }}
1010
cancel-in-progress: true
1111

12+
env:
13+
FORCE_COLOR: 3
14+
1215
jobs:
1316
test:
1417
runs-on: ${{ matrix.os }}
@@ -19,12 +22,12 @@ jobs:
1922
fail-fast: false
2023
matrix:
2124
os: [ubuntu-latest]
22-
pyodide-version: ["0.27.0a2"]
25+
pyodide-version: ["0.27.2"]
2326
test-config: [
24-
# FIXME: recent version of chrome gets timeout
25-
{runner: selenium, runtime: chrome, runtime-version: "125" },
26-
{runner: selenium, runtime: node, runtime-version: "22" },
27-
]
27+
# FIXME: recent version of chrome gets timeout
28+
{ runner: selenium, runtime: chrome, runtime-version: "125" },
29+
{ runner: selenium, runtime: node, runtime-version: "22" },
30+
]
2831

2932
steps:
3033
- uses: actions/checkout@v4

micropip/wheelinfo.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,15 @@ def from_url(cls, url: str) -> "WheelInfo":
6969
See https://www.python.org/dev/peps/pep-0427/#file-name-convention
7070
"""
7171
parsed_url = urlparse(url)
72-
if parsed_url.scheme == "":
73-
url = "file:///" + url
72+
if not parsed_url.scheme:
73+
parsed_url = ParseResult(
74+
scheme="file",
75+
netloc=parsed_url.netloc,
76+
path=parsed_url.path,
77+
params=parsed_url.params,
78+
query=parsed_url.query,
79+
fragment=parsed_url.fragment,
80+
)
7481
file_name = Path(parsed_url.path).name
7582
name, version, build, tags = parse_wheel_filename(file_name)
7683
return WheelInfo(

tests/test_install.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ async def myfunc():
252252

253253
fetch_response_mock.string.side_effect = myfunc
254254

255-
@patch("micropip._compat_in_pyodide.pyfetch", return_value=fetch_response_mock)
255+
@patch(
256+
"micropip._compat._compat_in_pyodide.pyfetch", return_value=fetch_response_mock
257+
)
256258
async def call_micropip_install(pyfetch_mock):
257259
try:
258260
await micropip.install("pyodide-micropip-test", credentials="include")
@@ -278,7 +280,7 @@ async def test_load_binary_wheel1(
278280

279281
@pytest.mark.skip_refcount_check
280282
@run_in_pyodide(packages=["micropip"])
281-
async def test_load_binary_wheel2(selenium):
283+
async def test_load_binary_wheel2(selenium_standalone_micropip):
282284
from pyodide_js._api import repodata_packages
283285

284286
import micropip

tests/test_transaction.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ def test_parse_wheel_url1(protocol, path):
2424
url = protocol + path
2525
wheel = WheelInfo.from_url(url)
2626

27-
check_url = url if protocol else "file:///" + path
2827
assert wheel.name == "snowballstemmer"
2928
assert str(wheel.version) == "2.0.0"
3029
assert wheel.sha256 is None
3130
assert wheel.filename == SNOWBALL_WHEEL
32-
assert wheel.url == check_url
31+
assert wheel.url == url
3332
assert wheel.tags == frozenset(
3433
{Tag("py2", "none", "any"), Tag("py3", "none", "any")}
3534
)

0 commit comments

Comments
 (0)