Skip to content

Commit

Permalink
Bump Pyodide on CI (#130)
Browse files Browse the repository at this point in the history
* Bump Pyodide on CI

Also change to explicitely use strings.

I'm guessing this should be bumped, maybe there is an automatic way to
do latest ? Also not sure if you want to test on alphas, but I guess
it's always useful to catch bugs.

* fix tests

* debug

* Shot in the dark, ar warnings sets to stderr ?

* extra log

* partial

* I'm not smart and cant make a proper versioncheck

* moar stuff

* Remove not relevant test.

As pointed out by Gyeongjae Choi in 130, those file are listed since
Python 3.12 and thus this error shouls not trigger.
  • Loading branch information
Carreau authored Aug 28, 2024
1 parent 57fadc7 commit eb8c449
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 45 deletions.
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",
)
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(
"A file '%s' listed in the metadata of '%s' does not exist.",
file,
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

0 comments on commit eb8c449

Please sign in to comment.