Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Pyodide on CI #130

Merged
merged 9 commits into from
Aug 28, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04]
pyodide-version: [0.24.1, 0.25.0]
pyodide-version: ['0.24.1', '0.25.0', '0.26.2', '0.27.0a2']
test-config: [
{runner: selenium, runtime: chrome, runtime-version: latest },
]
Expand Down
6 changes: 5 additions & 1 deletion micropip/_commands/uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ def uninstall(packages: str | list[str], *, verbose: bool | int = False) -> None
# - scripts
# - entry_points
# Since we don't support these, we can ignore them (except for data_files (TODO))
logger.warning(
"skipping file '%s' that is relative to root",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"skipping file '%s' that is relative to root",
"skipping file '%s' that is relative to root", str(file),

)
continue

# see PR 130, it is likely that this is never triggered since Python 3.12
# as non existing files are not listed by get_files_in_distribution anymore.
logger.warning(
f"A file '{file}' listed in the metadata of '{name}' does not exist.",
)
Expand Down
43 changes: 0 additions & 43 deletions tests/test_uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,49 +159,6 @@ async def run(selenium):
run(selenium_standalone_micropip)


def test_warning_file_removed(selenium_standalone_micropip, wheel_catalog):
"""
Test warning when files in a package are removed by user.
"""

@run_in_pyodide()
async def run(selenium, pkg_name, wheel_url):
from importlib.metadata import distribution
import micropip
import contextlib
import io

with io.StringIO() as buf, contextlib.redirect_stdout(buf):
await micropip.install(wheel_url)

assert pkg_name in micropip.list()

dist = distribution(pkg_name)
files = dist.files
file1 = files[0]
file2 = files[1]

file1.locate().unlink()
file2.locate().unlink()

micropip.uninstall(pkg_name)

captured = buf.getvalue()
logs = captured.strip().split("\n")

assert len(logs) == 2
assert "does not exist" in logs[-1]
assert "does not exist" in logs[-2]

test_wheel = wheel_catalog.get(TEST_PACKAGE_NAME)

run(
selenium_standalone_micropip,
test_wheel.name,
test_wheel.url,
)


def test_warning_remaining_file(selenium_standalone_micropip, wheel_catalog):
"""
Test warning when there are remaining files after uninstallation.
Expand Down
Loading