-
-
Notifications
You must be signed in to change notification settings - Fork 42
Fix micropip.install to search shared libraries inside the wheel correctly #97
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
Changes from all commits
6f53434
175b60a
1f62c0e
5c96a83
1811291
d6e8ca2
c4e5ddf
405cb3d
9cf088f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,10 +127,13 @@ def _register_handler(self, path: Path) -> str: | |
|
|
||
| return self._httpserver.url_for(f"/{path.name}") | ||
|
|
||
| def add_wheel(self, path: Path): | ||
| def add_wheel(self, path: Path, replace: bool = True): | ||
| name = parse_wheel_filename(path.name)[0] | ||
| url = self._register_handler(path) | ||
|
|
||
| if name in self._wheels and not replace: | ||
| return | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should raise here? I think silently doing nothing is likely to be confusing.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used this method to register all the wheels included in the Pyodide distribution as test wheels, as without this, they would conflict with pytest wheel, etc that I put in for testing. I think it will be fine as long as we know what we are doing. I added some comments about it. |
||
|
|
||
| self._wheels[name] = self.Wheel( | ||
| path, name, path.name, name.replace("-", "_"), url | ||
| ) | ||
|
|
@@ -140,12 +143,19 @@ def get(self, name: str) -> Wheel: | |
|
|
||
|
|
||
| @pytest.fixture(scope="session") | ||
| def wheel_catalog(): | ||
| def wheel_catalog(pytestconfig): | ||
| """Run a mock server that serves pre-built wheels""" | ||
| with WheelCatalog() as catalog: | ||
| for wheel in TEST_WHEEL_DIR.glob("*.whl"): | ||
| catalog.add_wheel(wheel) | ||
|
|
||
| # Add wheels in the pyodide distribution so we can use it in the test. | ||
| # This is a workaround to get a wheel build with a same emscripten version that the Pyodide is build with, | ||
| # But probably we should find a better way that does not depend on Pyodide distribution. | ||
| dist_dir = Path(pytestconfig.getoption("dist_dir")) | ||
| for wheel in dist_dir.glob("*.whl"): | ||
| catalog.add_wheel(wheel, replace=False) | ||
|
|
||
| yield catalog | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.