pyodide / micropip

A lightweight Python package installer for Pyodide
https://micropip.pyodide.org
Mozilla Public License 2.0
76 stars 21 forks source link

Fix installing underscore-prefixed unvendored stdlib #41

Closed ryanking13 closed 1 year ago

ryanking13 commented 1 year ago

micropip.install("_hashlib") was failing with:

packaging.requirements.InvalidRequirement: Parse error at "'_hashlib'": Expected W:(0-9A-Za-z)

as it is not a valid package name. But we actually want to install it as it is unvendored stdlib.

rth commented 1 year ago

Maybe it would be better to rename _hashlib to hashlib and avoid leading underscore ? I mean if it's an invalid package name we should not use it.

rth commented 1 year ago

Also it looks like we have no tests in Pyodide for unvendored stlib loading? It's not the first time that one of them doesn't load.

ryanking13 commented 1 year ago

Maybe it would be better to rename _hashlib to hashlib and avoid leading underscore ? I mean if it's an invalid package name we should not use it.

Okay, I'll try that instead.

Also it looks like we have no tests in Pyodide for unvendored stlib loading? It's not the first time that one of them doesn't load.

Right, good point...

ryanking13 commented 1 year ago

Closing as we changed the name of _hashlib: https://github.com/pyodide/pyodide/pull/3349