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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(the ones that starts with `../` or `./`)
[#174](https://github.com/pyodide/micropip/pull/174)

- Fixed an error when calling `micropip.install` with `deps=False` is set.
[#187](https://github.com/pyodide/micropip/pull/187)

### Added

- `micropip` now vendors `pypa/packaging` for better reliability.
Expand Down
2 changes: 2 additions & 0 deletions micropip/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@
else:
await wheel_download_task
await self.gather_requirements(wheel.requires(extras))
else:
await wheel_download_task

Check warning on line 272 in micropip/transaction.py

View check run for this annotation

Codecov / codecov/patch

micropip/transaction.py#L272

Added line #L272 was not covered by tests

self.wheels.append(wheel)

Expand Down
19 changes: 19 additions & 0 deletions tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ async def _run(selenium):
_run(selenium_standalone_micropip)


@integration_test_only
def test_integration_install_no_deps(selenium_standalone_micropip, pytestconfig):
@run_in_pyodide
async def _run(selenium):
import micropip

await micropip.install("pyodide-micropip-test", deps=False)

try:
# pyodide-micropip-test depends on snowballstemmer
import snowballstemmer # noqa: F401
except ModuleNotFoundError:
pass
else:
raise Exception("Should raise!")
Comment on lines +44 to +50
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As the intention here is that we want import snowballstemmer to not be installed due to deps=False, is there a better way to handle this?

i.e., is it possible to wrap it in a context manager with with pytest.raises(ModuleNotFoundError (or we have to do it in the current way because pytest isn't installed?)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i.e., is it possible to wrap it in a context manager with with pytest.raises(ModuleNotFoundError (or we have to do it in the current way because pytest isn't installed?)?

Yeah, good point. pytest.raises would work too, but I wanted to keep the test simple, not loading any extra package.


_run(selenium_standalone_micropip)


@integration_test_only
def test_integration_list_basic(selenium_standalone_micropip, pytestconfig):
@run_in_pyodide
Expand Down