Skip to content
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

Pyodide Conversion: requirements.txt not able to deal with wheel-urls #6787

Open
flxmr opened this issue Apr 24, 2024 · 2 comments · May be fixed by #6859
Open

Pyodide Conversion: requirements.txt not able to deal with wheel-urls #6787

flxmr opened this issue Apr 24, 2024 · 2 comments · May be fixed by #6859
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@flxmr
Copy link

flxmr commented Apr 24, 2024

ALL software version info

panel@900fb095b4dfe7c3500321ba7fe84f188b08721a on Python 3.12.2

Description of expected behavior and the observed behavior

I would like to specify a custom url for a wheel in pyiodide conversion. In standard Python I can just put the url in the requirements.txt. As panel uses packaging.requirements.Requirement this doesn't work, because the URL is not a valid requirement. This would not be bad if one could use package @ wheelurl. However this fails, because panel passes this as a string to micropip, which doesn't understand this spec and tries to get http://localhost:8000/mywheel@https://localhost:8000/myhweel.whl.

According to micropip one should https://micropip.pyodide.org/en/stable/project/api.html#micropip.install only pass package names, http or emfs-urls.

Complete, minimal, self-contained example code that reproduces the issue

panel convert mypanel.py --compiled --to pyodide-worker --out pyodide-excel --requirements reqs.txt

where reqs.txt looks like

http://localhost:8000/mywheel.whl

results in:

Failed to convert mypanel.py to pyodide target: Requirements parser raised following error: Expected end or semicolon (after name and no valid version specifier)
    https://localhost:8000/mywheel.whl
  • [x ] I may be interested in making a pull request to address this. Likely I will try to convert the Requirements to package specifications accepted by micropip
@flxmr flxmr changed the title Pyiodide Conversion: requirements.txt not able to deal with wheel-URLS Pyiodide Conversion: requirements.txt not able to deal with wheel-urls Apr 24, 2024
@philippjfr philippjfr changed the title Pyiodide Conversion: requirements.txt not able to deal with wheel-urls Pyodide Conversion: requirements.txt not able to deal with wheel-urls Apr 24, 2024
@flxmr
Copy link
Author

flxmr commented Apr 24, 2024

also:
#6170 (fix the requirements-heuristic)
#5700 (and this bug somewhere)

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Apr 24, 2024
@philippjfr philippjfr added this to the v1.4.3 milestone Apr 24, 2024
@flxmr
Copy link
Author

flxmr commented Apr 25, 2024

As pyodide does only provide one set of emscripten-wheels for every version (...) it doesn't make a lot of sense to use formal Requirements at all I would say. Also the "requirements"-files as read by pip don't have to have a Requirement in every line. This is funny and despite the polish shown by the various "you can run Python in the browser"-projects, this seems very toy-like. (also pip is the only implementation of a proper dependency resolver - and that without an API)

@flxmr flxmr linked a pull request May 22, 2024 that will close this issue
@philippjfr philippjfr modified the milestones: v1.4.3, v1.4.4 May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants