When a local version identifier is present, a package version may look like 1.0.0+localbuild.1.
If the wheel file is hosted on a remote server, the URL encoding results in a filename such as:
foo-1.0.0%2Blocalbuild.1.whl
However, micropip does not unquote the path before parsing. This causes version parsing to fail.
|
file_name = Path(parsed_url.path).name |
micropip._vendored.packaging.src.packaging.version.InvalidVersion: Invalid version: '1.0.0%2Blocalbuild.1'
Steps to reproduce:
- Build a wheel with a local version identifier (e.g., 1.0.0+localbuild.1).
- Host the wheel file on a remote server.
- Install it via micropip.install("https://example.com/foo-1.0.0%2Blocalbuild.1.whl").
- Observe that parsing fails with InvalidVersion.
Expected behavior:
The path should be URL-decoded before version parsing so that 1.0.0+localbuild.1 is correctly recognized as a valid version.
When a local version identifier is present, a package version may look like 1.0.0+localbuild.1.
If the wheel file is hosted on a remote server, the URL encoding results in a filename such as:
However, micropip does not unquote the path before parsing. This causes version parsing to fail.
micropip/micropip/wheelinfo.py
Line 81 in bf15f51
Steps to reproduce:
Expected behavior:
The path should be URL-decoded before version parsing so that 1.0.0+localbuild.1 is correctly recognized as a valid version.