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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Support for adding mock packages, for use where something is a dependency and you don't need it, or you need only a limited subset of the package. This is done using `micropip.add_mock_package`, `micropip.remove_mock_package` and `micropip.list_mock_packages`. Packages installed like this will be skipped by dependency resolution when you later install real packages.



### Fixed

- When multiple compatible builds for a package exist, the best
Expand All @@ -18,6 +20,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
For example, if a package has two pure Python wheels, one tagged `py30` and
another tagged `py35`, the `py35` wheel will now always get installed.
[#34](https://github.com/pyodide/micropip/pull/34)
- `micropip.install` now supports installing packages by URLs with query parameters
[#33](https://github.com/pyodide/micropip/pull/33)


## [0.1.0] - 2022/09/18

Expand Down
2 changes: 1 addition & 1 deletion micropip/_micropip.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ async def add_requirement(self, req: str | Requirement) -> None:
if isinstance(req, Requirement):
return await self.add_requirement_inner(req)

if not req.endswith(".whl"):
if not urlparse(req).path.endswith(".whl"):
return await self.add_requirement_inner(Requirement(req))

# custom download location
Expand Down
17 changes: 17 additions & 0 deletions tests/test_micropip.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,23 @@ async def test_add_requirement_marker(mock_importlib, wheel_base):
assert t not in wheel_files


@pytest.mark.asyncio
async def test_add_requirement_query_url(mock_importlib, wheel_base, monkeypatch):
pytest.importorskip("packaging")
from micropip._micropip import Transaction

async def mock_add_wheel(self, wheel, extras):
self.mock_wheel = wheel

monkeypatch.setattr(Transaction, "add_wheel", mock_add_wheel)

transaction = create_transaction(Transaction)
await transaction.add_requirement(f"{SNOWBALL_WHEEL}?b=1")
wheel = transaction.mock_wheel
assert wheel.name == "snowballstemmer"
assert wheel.filename == SNOWBALL_WHEEL # without the query params


@pytest.mark.asyncio
async def test_package_with_extra(mock_fetch):
mock_fetch.add_pkg_version("depa")
Expand Down