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
Use the new pyodide feature for better tracebacks, as soon as it's available #36
Comments
beside the need to update to latest interpreter, every interpreter already accept any argument with their own |
Reading that page ... this is really a PyScript enhancement, eventually, and imho definitively not a release blocker. I've also no idea how we're supposed to define the HTML line when every kind of bundler might shrink or change that layout so that in production that'd be |
last blocker to me:
I think I personally don't know what we're doing as we can't map a node into a line in any HTML document ... the live DOM is not a 1:1 relation to what's served to the user. edit we could try to snapshot each time before execution but I don't see that granting better results ... in short, we can use that feature, I don't know who would benefit from it ... let's try once it's out though, maybe I am missing something. |
P.S. these questions are likely not relevant for the |
Happy to experiment once the feature is out. The relation code -> file becomes even more weird with worker either as attribute or as external file as these will be passed as Blob content (entry point) ... all nodes have a target and/or automatic ID so maybe we an use |
Btw, this is still not a polyscript issue as polyscript doesn't care about what's passed along |
I still think it should be a polyscript feature, because it's useful even with raw pyodide: so, if you enable it in polyscript, everyone using That said, your call. As long as we have this in pyscript, I'm happy :) |
polyscript enable any argument to be passed ... to all interpreters ... that's it. It passes anything we want to pass to pyodide already, so that |
On a second though, if you think that dance should be done in here as Pyodide only thing, then that might be case we add Pyodide only features but code will branch out in ugly ways ... although if custom scripts are handled differently, that's an architecture change to think though with the interpreters folders ... reopening until I have something to test, so far this all feel too theoretical and there's no action I can take until Pyodide is out with its latest (yes, I could use the alpha/beta version, but that cannot land in here so I don't want to break previous stable code until that's out). |
yes, this is what I meant, sorry if I wasn't clear enough. |
it is the right thing to do when interpreters support new features, stuff happens in here ... it's just the branching code that is not nice because potentially any interpreter could add its own extra feature and it'll be nuts to branch all those cases beside the |
@antocuni if you put a package that cannot be loaded via pyodide.loadPackage into loadPyodide's option.packages it will throw an error. eg try putting seaborn and it will not be happy edit: this comment is on completely wrong issue.. |
btw ... we have a blocker for 0.24.0 and we need to wait for the next release, apparently: |
Update ... in this MR #81 we tackled a different, more relevant, issue: all hooks before the code would make the line number completely banana/irrelevant ... and that got fixed. As of today, that was the only complain about the error we had because indeed if the stack trace was saying Now that such issue has been solved, I'd like to understand how we can also use
With this case: <script type="py">
error 1
</script>
<script type="py">
error 2
</script> It makes no sense to have error in On top of that: <script type="py" worker>
error 1
</script>
<script type="py" worker>
error 2
</script> Now the code doesn't even run in This would also kinda hint/promote to use external files instead of trashing Python all over the HTML page, which is, I think, a good hint and a better way forward. Thoughts? |
👋 A quick summary of my thoughts:
|
Thanks @ntoll , I think we can close this until we have a plan and solutions around the issues I've rised. Maybe having |
I'm opening this issue mostly as a reminder, so that we don't forget.
In the next days a new pyodide release will be available. The new release will contain this feature:
pyodide/pyodide#3993
Now
runPython
accepts a new argumentfilename
: if it's used, the python tracebacks will look much nicer and will contain references to the actual source code written by the user, so we should just always use it.The text was updated successfully, but these errors were encountered: