Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ concurrency:
group: main-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
FORCE_COLOR: 3

jobs:
test:
runs-on: ${{ matrix.os }}
Expand All @@ -19,12 +22,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
pyodide-version: ["0.27.0a2"]
pyodide-version: ["0.27.2"]
test-config: [
# FIXME: recent version of chrome gets timeout
{runner: selenium, runtime: chrome, runtime-version: "125" },
{runner: selenium, runtime: node, runtime-version: "22" },
]
# FIXME: recent version of chrome gets timeout
{ runner: selenium, runtime: chrome, runtime-version: "125" },
{ runner: selenium, runtime: node, runtime-version: "22" },
]

steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 9 additions & 2 deletions micropip/wheelinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,15 @@
See https://www.python.org/dev/peps/pep-0427/#file-name-convention
"""
parsed_url = urlparse(url)
if parsed_url.scheme == "":
url = "file:///" + url
if not parsed_url.scheme:
parsed_url = ParseResult(

Check warning on line 73 in micropip/wheelinfo.py

View check run for this annotation

Codecov / codecov/patch

micropip/wheelinfo.py#L72-L73

Added lines #L72 - L73 were not covered by tests
scheme="file",
netloc=parsed_url.netloc,
path=parsed_url.path,
params=parsed_url.params,
query=parsed_url.query,
fragment=parsed_url.fragment,
)
file_name = Path(parsed_url.path).name
name, version, build, tags = parse_wheel_filename(file_name)
return WheelInfo(
Expand Down
6 changes: 4 additions & 2 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ async def myfunc():

fetch_response_mock.string.side_effect = myfunc

@patch("micropip._compat_in_pyodide.pyfetch", return_value=fetch_response_mock)
@patch(
"micropip._compat._compat_in_pyodide.pyfetch", return_value=fetch_response_mock
)
async def call_micropip_install(pyfetch_mock):
try:
await micropip.install("pyodide-micropip-test", credentials="include")
Expand All @@ -279,7 +281,7 @@ async def test_load_binary_wheel1(

@pytest.mark.skip_refcount_check
@run_in_pyodide(packages=["micropip"])
async def test_load_binary_wheel2(selenium):
async def test_load_binary_wheel2(selenium_standalone_micropip):
from pyodide_js._api import repodata_packages

import micropip
Expand Down
3 changes: 1 addition & 2 deletions tests/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ def test_parse_wheel_url1(protocol, path):
url = protocol + path
wheel = WheelInfo.from_url(url)

check_url = url if protocol else "file:///" + path
assert wheel.name == "snowballstemmer"
assert str(wheel.version) == "2.0.0"
assert wheel.sha256 is None
assert wheel.filename == SNOWBALL_WHEEL
assert wheel.url == check_url
assert wheel.url == url
assert wheel.tags == frozenset(
{Tag("py2", "none", "any"), Tag("py3", "none", "any")}
)
Expand Down