-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Pin PyScript #16
Pin PyScript #16
Conversation
- PyScript deprecated latest and requires pinning for newer versions
Also, I'm a bit mystified by PyScript's configuration. For instance, I find the PR where |
Pyscript has definitely gone through some big changes since I last did a big Toga update; most of those changes have been very welcome (distancing "getting Python working in the browser" from "having opinions about look and feel"). So - the splash screen handling has definitely been removed; and terminal handling has... changed. Part of that seems to be a new default handler for However, we also need to fix some other issues that have slipped in as a result of API updates.
On the last point, I'm not sure if that should be a Toga concern or a Briefcase concern - at least for the moment, I suspect it needs to be a Briefcase concern, because Toga can't provide any code that will contribute to the "pre-javascript executing" state of the page. I started looking broadly at this problem in beeware/briefcase#1285; that set of changes would provide a mechanism for a wheel to contribute content to the Briefcase-generated HTML. However, I've been distracted with Py3.13 and getting binary wheels working for the last year, so I haven't been able to give the web backend the attention it needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely a set of changes we should make; but we need to fix the behavior change issues flagged (which might require a Toga change as well to adapt how button handlers are attached)
Makes sense :) I rather doubt I will further pursue additional efforts then to bring support back up to date; I am mostly intrigued because PyScript is particularly interesting...but it's also at the edge of a lot of my knowledge. So, I'll leave to your discretion to just close this PR...or possibly expand upon it...whatever this case is fine with me. |
I've updated to PyScript 2024.11.1, and added a corresponding Briefcase PR to remove the obsolete configuration settings:
It works fine for me in both Chrome and Safari.
Fixed in beeware/toga#3035. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made 2 small changes:
- I've added an animation throb to the splash screen
- I've added an initial templated pyscript.toml file that turns on the "official" way to hide error output, rather than a CSS-based approach. This config file will be overwritten by the current mainline Briefcase; but I've updated the Briefcase PR to read-and-rewrite pyscript.toml if it the template provides it. This should allow us to accomodate future pyscript.toml changes without needing a Briefcase change (unless there's a change to the format for
packages
...)
I'm happy with where this is right now; leaving for @mhsmith to cross-check and merge these changes.
In that case, the CSS to hide the stderr should be unnecessary, so I've removed it. |
Changes
latest
and requires pinning for newer versions<py-script>
can just be<script type="py">
nowasync="false"
to disable it<py-config>
isn't necessary since it can be specified via<script type="py" config="pyscript.toml">
Notes
import warnings; warnings.filterwarnings("ignore")
toindex.html
technically works....BRIEFCASE_REPO: https://github.com/mhsmith/briefcase
BRIEFCASE_REF: pyscript-2024.11.1
PR Checklist: