Guild icon
PyScript 💻
💬 | General / ╰╸pyscript-core
Avatar
tedpatrick 28/09/2022 19:54
Starting to move all pyscript team here.
Avatar
Jeff Glass 29/09/2022 13:34
Welcome!
Avatar
Leonard Wolf 29/09/2022 14:01
Heyo people!
14:02
Nice to meet you all!
14:03
@tedpatrick Umm if you want we can make a another announcement channel like #updates
14:03
Where you can tag @ everyone and say things if you want them to test stuff and all
Avatar
tedpatrick 29/09/2022 16:04
I have updated everyone on the core team with Maintainer Role
Avatar
Avatar
tedpatrick
I have updated everyone on the core team with Maintainer Role
Leonard Wolf 29/09/2022 17:05
Aye aye!
17:05
Should I make it such that admin appear seperate from maintainer?
Avatar
tedpatrick 30/09/2022 20:55
We will be migrating all our team chats here next week. I believe all maintainers are here now. With that... Have a great weekend.
Avatar
Leonard Wolf 01/10/2022 02:35
Nice to see all of you here! If any of you guys need any help please let me know either in here or in dms!
Avatar
I am pretty new to discord and still have to learn some peculiarities. My first question is: is it possible to exit/leave/unsubscribe from some channels?
Avatar
Avatar
antocuni
I am pretty new to discord and still have to learn some peculiarities. My first question is: is it possible to exit/leave/unsubscribe from some channels?
Leonard Wolf 02/10/2022 02:33
Umm like if you wanna mute any particular message and dont want to recieve a popup sound for each message If you are on mobile
  • long press on channel and channel settings will popup next click on mute channel --> until I turn it back on
If you are on pc
  • right click on channel and just click on mute channel no need to select time period it will automatically select the until I turn it back on
Same goes for categories and servers If you want to recieve updates from particular server from particular channel then keep different categories muted and only that channel you wanna keep check on unmuted, if that channel is in category then mute all other channels and keep that channel unmuted
(edited)
02:35
You can even supress @ everyone and @ here and any role mentions this is helpful when you are in a server where they ping everyone every other day and you find it annoying
Avatar
thank you, that's very useful! I assumed that there was a feature similar to slack to enter/leave individual channels, but it seems that it's all-or-nothing. Good to know 🙂
Avatar
Leonard Wolf 03/10/2022 02:27
Umm yeah you can even choose to hide the muted channels but its better to keep them so you can unmute in future
👍 1
Avatar
I have a very selfish request: can we change the icon of the server? 🙂 I am also on the CPython core devs server which has a very similar icon, so I always get confused 🙂
Avatar
Avatar
antocuni
I have a very selfish request: can we change the icon of the server? 🙂 I am also on the CPython core devs server which has a very similar icon, so I always get confused 🙂
maybe we can use the official <py> icon?
Avatar
Avatar
antocuni
I have a very selfish request: can we change the icon of the server? 🙂 I am also on the CPython core devs server which has a very similar icon, so I always get confused 🙂
Leonard Wolf 03/10/2022 15:38
Aha for sure do you have a icon we can replace it with?
15:38
15:38
Ohh you mean this ig . . .
15:41
@antocuni Changed
Avatar
thanks 😍
Avatar
Leonard Wolf 03/10/2022 16:19
:)
Avatar
tedpatrick 07/10/2022 20:45
We are having a PyScript Community Call on Tuesday, October 18 11AM CST https://bit.ly/PyScriptCC
On October 18, 2022, at 11 AM CST, the PyScript Core Team will host our 1st PyScript Community Call. PyScript Community Call Status Report Highlights Q&amp;A We will be organizing the Q&amp...
Avatar
Avatar
tedpatrick
We are having a PyScript Community Call on Tuesday, October 18 11AM CST https://bit.ly/PyScriptCC
wondeful! We should probably publicize it also on the public channels of this discord and maybe also twitter?
✅ 1
Avatar
Avatar
antocuni
wondeful! We should probably publicize it also on the public channels of this discord and maybe also twitter?
Leonard Wolf 08/10/2022 12:46
You can now use #announcements
👍 1
12:46
You can ping @ everyone or @ here without spaces to send everyone a alert
12:46
Example : @everyone
Avatar
Leonard Wolf 16/10/2022 10:54
Umm it should be Discord Server and not Discord Channel as this is a server and within server we have channels
Avatar
PRs welcome 😉
✅ 1
Avatar
Jeff Glass 23/10/2022 18:15
I wonder if it's worth adding a pyscript-dev channel or similar, so we have a place for questions/convos related to developing PyScript, vs questions about using PyScript
18:16
I'm working out a question about running jest, which feels a little out of place in the pyscript-help channel
Avatar
yes, I would like to have a channel where to have conversations about pyscript development
21:47
we have one in your anaconda slack, but I think we should just move all the conversations to a public channel by default
21:48
whether it's good to have yet another channel to the discord server, I don't really know. I'm new to discord but my feeling is that we have waaay too many channels 🙂
Avatar
Jeff Glass 23/10/2022 21:51
In my discord experience, this server is fairly light on the channels 😅 two to three dozen isn't super uncommon for general ones, though I don't know if there are programming- discord communities we could model off of
Avatar
yes but do we really need them? I mean, I think that pyscript-general and pyscript-dev would be enough, considering the very low traffic that we have, wouldn't them?
Avatar
Avatar
Jeff Glass
In my discord experience, this server is fairly light on the channels 😅 two to three dozen isn't super uncommon for general ones, though I don't know if there are programming- discord communities we could model off of
Leonard Wolf 24/10/2022 03:02
There are many servers but many of them also have forums which allow users to make a post for a questions they have and the maintainers or collaborators reply to it
Avatar
tedpatrick 26/10/2022 01:50
Ok coordinating the move here for all chat this week. ✅
Avatar
tedpatrick 26/10/2022 03:17
Any thought on Github Discussions? https://github.com/nodejs/node/discussions
Node.js JavaScript runtime ✨🐢🚀✨ - Discussions · nodejs/node
Avatar
Avatar
tedpatrick
Any thought on Github Discussions? https://github.com/nodejs/node/discussions
Leonard Wolf 26/10/2022 11:32
Umm as in you guys want to enable discussion for github PyScript?
Avatar
Avatar
tedpatrick
Any thought on Github Discussions? https://github.com/nodejs/node/discussions
basically we are already using github issues as a place where to have discussions. So having a proper place for discussions might be a good idea? But I don't have any experience with them
Avatar
Avatar
antocuni
basically we are already using github issues as a place where to have discussions. So having a proper place for discussions might be a good idea? But I don't have any experience with them
Leonard Wolf 26/10/2022 12:33
Umm if you want we also have forums within discord!
12:33
If you wanna test we can make a forum and test in private and hidden from public
Avatar
my first gut feeling is that a github-based forum is better because it allows easier cross-reference with issues and PRs. That said, I don't have experience with either
Avatar
Avatar
antocuni
my first gut feeling is that a github-based forum is better because it allows easier cross-reference with issues and PRs. That said, I don't have experience with either
Leonard Wolf 26/10/2022 12:35
Umm thats true!! Well you are right there ofc umm as you guys say!
Avatar
tedpatrick 26/10/2022 15:01
I view chat as short form/immediate but we need a medium that is long-form and SEO friendly. Many of the issues in PyScript are general questions, some are bugs, some are feature requests. I would like to see all but bugs move to discussions.
Avatar
tedpatrick 26/10/2022 19:59
Also ready to update <py-repl> once your PR is set.
Avatar
the docs for py-repl mentions exec-id and root, but they are internal-use only and they should not be documented IMHO
✅ 1
Avatar
tedpatrick 26/10/2022 23:11
I will catch these on a followup PR
✅ 1
Avatar
tedpatrick 28/10/2022 16:52
Welcome Fabio Rosado as PyScript Maintainer https://github.com/pyscript/pyscript/issues/898
We are pleased to announce the addition of Fabio Rosado as a PyScript Maintainer. Fabio has been active within the PyScript community and has contributed several significant additions to PyScript. ...
🎉 2
Avatar
FabioRosado 28/10/2022 16:55
Thank you!
🙌 1
Avatar
I think from tomorrow on we should migrate to here, correct? @tedpatrick @antocuni @nick is missing? @madhurt @fabio is missing we have @FabioRosado tho that starts tomorrow! and the people around us like Martin and Alex 🙂
Avatar
@3l3ktr4 nope... @ntoll isn't missing... 👋 😝 My usual handle everywhere is just ntoll, with the orangutan 🦧
Avatar
great! 🙂
Avatar
tedpatrick 01/11/2022 13:57
Ok PyScript-core is publicly viewable
13:58
Today is the day we move here. All team chat will be here from now on.
14:02
We all have written it thousands of times, but this time is very appropriate: Hello world! 😅 (edited)
14:06
@tedpatrick are you sure that this channel is publicly visible? I still see a lock, and the permission page seems to suggest that it's not
Avatar
tedpatrick 01/11/2022 14:14
Yes it was private, now not.
Avatar
FabioRosado 01/11/2022 16:08
This is pretty cool! Excited to be part of the team (although I am starting officially next week which is good since we all been sick with flu at home 😞 )
Avatar
Avatar
FabioRosado
This is pretty cool! Excited to be part of the team (although I am starting officially next week which is good since we all been sick with flu at home 😞 )
tedpatrick 01/11/2022 16:35
Feel better Fabio!
Avatar
FabioRosado 01/11/2022 16:40
Thanks!
Avatar
OK folks... that's me done for the day. I'll be travelling to Sweden tomorrow morning but should be around in the afternoon. From 4pm is a pre-conference speakers reception thingamabob.
Avatar
tedpatrick 01/11/2022 21:01
@Fabio You there?
Avatar
Yup
🤩 1
Avatar
tedpatrick 02/11/2022 01:48
Ok Yesterday and Today bot is working. Should post here at 8AM London-time 🙂
Avatar
Yesterday & Today BOT 02/11/2022 10:28
📆 Yesterday & Today - 11/02/2022 🧵
tedpatrick started a thread. 02/11/2022 10:41
Avatar
tedpatrick 02/11/2022 10:55
Made a mistake in bot cron. Now set to 7 UTC
Avatar
👋 greetings from Sweden
🙌 4
🇸🇪 2
Avatar
FabioRosado 02/11/2022 14:25
@antocuni I was about to shoot you a message about the userError haha I misunderstood what you said, I thought you were suggesting that instead of us doing showError("blah") we would do raise UserError and then the withUserErrorHandler should allow the code to keep going. Buuuut.... I clearly misunderstood and tried to do the impossible? 😄
14:26
In most cases where we use showError we just want to stop execution, but in others not like the case where the user passes multiple <py-config> (this should probably be a warning)
Avatar
yes exactly. Basically, in my opinion:
  • if it's an error, it MUST stop the execution (and hence an exception is very appropriate because it does just that)
  • if we want the execution to continue, then it's a warning, not an error
14:36
so:
  • errors => raise UserError("my messsage")
  • warnings => showWarning("my message") of course, we also need someone to catch UserError and display the appropriate message on the page. withUserErrorHandler is just a convenience, but you could also do it manually
14:38
for example, look at this code: https://github.com/pyscript/pyscript/blob/5b671dd1d0c2a4d88a8160bdc939c3cc03c3eaea/pyscriptjs/src/main.ts#L99-L108 the first showError is a real error, but then I had to manually use return to stop the execution. The second showError is actually a warning
Avatar
FabioRosado 02/11/2022 14:40
That makes a lot of sense, I dont know what I was thinking haha this also makes my life easier 🥷
Avatar
Here there is another interesting example: https://github.com/pyscript/pyscript/blob/5b671dd1d0c2a4d88a8160bdc939c3cc03c3eaea/pyscriptjs/src/pyconfig.ts#L142-L146 The author (who I believe was @madhurt ) had to do manually both the showError and the throw. With the new logic, you could just do throw UserError(message), and then the logic to actually display (or not) the error to the user will be handled elsewhere (and it will be configurable)
Avatar
FabioRosado 02/11/2022 14:44
Cool thanks! And apologies I know we been going back and forth with this haha
Avatar
Avatar
FabioRosado
Cool thanks! And apologies I know we been going back and forth with this haha
no problem, really. Thanks for doing this 🙂
Avatar
@antocuni @madhurt I'm just finishing catching up on #519 and I think there's something wrong with the universe... I mostly agree with @antocuni 😱 It must be the 3rd or 4th time in a week!!! lol Anyway, will comment on the issue with a few considerations/tweaks
😁 2
Avatar
Avatar
Fabio
@antocuni @madhurt I'm just finishing catching up on #519 and I think there's something wrong with the universe... I mostly agree with @antocuni 😱 It must be the 3rd or 4th time in a week!!! lol Anyway, will comment on the issue with a few considerations/tweaks
the real question is: do we start to agree because you finally see things as me, or I should be worried because I see things as you? 😂
Avatar
Avatar
antocuni
the real question is: do we start to agree because you finally see things as me, or I should be worried because I see things as you? 😂
I think we should both worry 😄
Avatar
lol
Avatar
OK... I'm AFK now.... off to the pre-conference "thing"
15:31
Catch you (on and off) tomorrow.
👍 1
15:50
do we actually use it, btw?
Avatar
ok, I'll delete it in my PR
🚢 1
✅ 1
Avatar
Avatar
antocuni
do we actually use it, btw?
noo don't delete it!| we do use it
16:35
it's the thing that pushes stuff to the dashboard the dashboard we don't use 😅
16:35
but maybe we should? specially with the stuff that ted was saying about integrating teams on kanbans on github
Avatar
tedpatrick 02/11/2022 16:35
I am going to delete the dashboard and start fresh!
Avatar
that dashboard is copying what Conda does
Avatar
tedpatrick 02/11/2022 16:35
💣
16:36
I am ok rebuilding it all. 🙂
Avatar
alright if you think you can build smth that fits our needs better 👍
Avatar
tedpatrick 02/11/2022 16:37
It will flow into the "agile coaching" we are doing around OSS + Github. Ideally seamless but light. (edited)
16:37
Otherwise @antocuni will hunt me down. 🙂
🤩 1
16:38
The plan remains... Kanban + Github only with light processes.
👍 1
tedpatrick started a thread. 02/11/2022 18:45
Avatar
Yesterday & Today BOT 03/11/2022 07:00
📆 Yesterday & Today - 11/03/2022 🧵
antocuni started a thread. 03/11/2022 08:34
Avatar
uhm, I'm still confused about discord threads. It seems that the bot posts a message, which is something different than starting a thread?
Avatar
Avatar
antocuni
uhm, I'm still confused about discord threads. It seems that the bot posts a message, which is something different than starting a thread?
tedpatrick 03/11/2022 12:29
Yes I need to work on the bot. It lacks thread creation permissions.
Avatar
wow, I don't know what I did exactly, but I managed to cause a segfault inside node when running jest tests 😱
🫠 1
tedpatrick started a thread. 03/11/2022 16:50
Avatar
woo, I have a <py-terminal> tag, implemented as a Plugin (edited)
🤯 3
🔌 1
🎉 3
Avatar
Avatar
antocuni
woo, I have a <py-terminal> tag, implemented as a Plugin (edited)
PR 917, is you are curious. But don't review it yet, it's still very WIP (in particular the Plugin system). https://github.com/pyscript/pyscript/pull/917
Avatar
Actually, since we are talking about plugins.. Let's explicitly talk about where should the official plugins (supported by the core team) should go. Main repo (like /pyscriptjs/plugins or /pyscriptjs/src/plugins), new repo (like /pyscript/plugins) or.... ? 🧵 (edited)
Avatar
Yesterday & Today BOT 04/11/2022 07:00
📆 Yesterday & Today - 11/04/2022 🧵
antocuni started a thread. 04/11/2022 09:42
Avatar
I just stumbled upon an interesting article abour running ffmpeg under WASM/WASI, which also explains (although a bit too shortly) the differences between WASI and emscripten: https://runno.dev/articles/ffmpeg
👍 4
🧭 2
Avatar
Leonard Wolf 05/11/2022 08:18
Am on trip atm so hope you guys are able to handle stuff here!!
Avatar
A couple of tweets about my PyScript talk at PyCon Sweden: https://twitter.com/jonas_lindemann/status/1588648118563663872 and https://twitter.com/kushaldas/status/1588542493003780096 (yes, I was introduced to the conference by a little girl, called Py). 🤣
It was interesting 😀 Let’s see when we can run CALFEM in the browser…. #pyscript #calfem
Our next speaker is ntoll talking about @pyscript_dev and introduced by Py. @pyconse @ThePSF @anacondainc
🤩 2
Avatar
tedpatrick 06/11/2022 01:06
Playing with wabt, part of the bytecode alliance tools. Lets you write raw wasm in s-expressions and convert directly to wasm binary. Turns out it supports importing from the browsers native js functions... (module (import "console" "log" (func $log (param i32))) (func (export "logIt") i32.const 13 call $log)) this imports console.log as $log, then creates a function logIt that calls it. links: https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format wabt: https://github.com/WebAssembly/wabt
01:08
At least if I am reading this right, I can have a module that exposes all browser native js functions in python.
01:09
Calling these is direct to the native code in browser, it does not go through JS (edited)
Avatar
Yes. Something like this is (I seem to remember) explained in the O'Reilly "Toto the dog" WASM book. But this is a really cool thing for us. I'm not too clear on the details, but how does this WABT code become a module in Python (or MicroPython)..? Surely there needs to be some API or interaction layer..? (I have to admit, this is very much on my "to investigate" list, so I'm very ignorant, but keen to learn more).
Avatar
tedpatrick 06/11/2022 13:44
From mannings wasm book… There are three options available for dynamic linking when using Emscripten: Your C or C++ code can manually link to a module by using the dlopen function. You can instruct Emscripten that there are WebAssembly modules to link to by specifying them in the dynamicLibraries array of Emscripten’s generated JavaScript file. When Emscripten instantiates the WebAssembly module, it will automatically download and link modules that are specified in this array. In your JavaScript, you can manually take the exports of one module and pass them in as imports to another using the WebAssembly JavaScript API.
🎉 1
13:47
How dynamic linking works for WebAssembly modules · Why you might want to use dynamic linking and why you might not · How to create WebAssembly modules as main or side modules · What the different options are for dynamic linking and how to use each approach
Avatar
Side topic but https://github.com/pyscript/pyscript/pull/914 is ready for its first review 😁
Avatar
I guess pyodide is adding support for it too: https://github.com/pyodide/pyodide/pull/3230/files
Avatar
Avatar
tedpatrick
Playing with wabt, part of the bytecode alliance tools. Lets you write raw wasm in s-expressions and convert directly to wasm binary. Turns out it supports importing from the browsers native js functions... (module (import "console" "log" (func $log (param i32))) (func (export "logIt") i32.const 13 call $log)) this imports console.log as $log, then creates a function logIt that calls it. links: https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format wabt: https://github.com/WebAssembly/wabt
yes, this is a standard webassembly feature: each WASM module declares a set of "imports" (which can be either memory or functions taking/returning primitive types), and then it's the job of whoever instantiates the module to provide them. If you instantiate it in the browser, you can pass JS functions as "imports"
Avatar
Avatar
tedpatrick
At least if I am reading this right, I can have a module that exposes all browser native js functions in python.
you can export only simple functions, and you have to enumerate all of them. You cannot pass objects this way
Avatar
Avatar
tedpatrick
Calling these is direct to the native code in browser, it does not go through JS (edited)
how to implement the call of imported functions is up to the implementation of course. I'd be surprised that they can completely bypass JS in all cases, but I can imagine that they can have optimized paths for certain functions
Avatar
Avatar
ntoll
Yes. Something like this is (I seem to remember) explained in the O'Reilly "Toto the dog" WASM book. But this is a really cool thing for us. I'm not too clear on the details, but how does this WABT code become a module in Python (or MicroPython)..? Surely there needs to be some API or interaction layer..? (I have to admit, this is very much on my "to investigate" list, so I'm very ignorant, but keen to learn more).
this is basically equivalent of asking "in linux, how does a .so file become a Python extension"? For CPython, there are basically two options: either it is a python extension module (which uses #include <Python.h>) or it's a plan C library and you call it using ctypes/cffi. (I'm not sure that ctypes/cffi works for WASM but in principle they should). For MicroPython, I have no idea, but the first step is to understand whether it has support for extension modules independently of WASM
Avatar
yes, that's exactly what happens when you do import numpy in pyodide 😅
15:05
what emiscripten does is to implement a "dynamic linking convention" on top of standard WASM features (i.e., imports and exports of symbols and functions). But AFAIK this convention is not fixed in stone and it's evolving, which in practice it means that you can dlopen() a library only if if were compiled with the very same version of emscripten that you are using
Avatar
tedpatrick 06/11/2022 15:10
I am going to look at v8 to native apis in chromium. It might result in an improved set of web apis that work cross runtime.
Avatar
I'm confused, what do you mean exactly?
Avatar
tedpatrick 06/11/2022 15:12
Well the web apis are all native code in chromium and I can use that interface to build a wat that imports every web api accurately.
Avatar
only if the web APIs accept int32 and double
15:15
you cannot pass a "Javascript object" into WASM. What you can do is to record somewhere that "this object is the number 42" and pass "42" into WASM. This is essentially what the js module does in Pyodide
Avatar
tedpatrick 06/11/2022 15:15
Proxies all the way down 🐢
Avatar
yes, but that's by design of how WASM works
15:17
(newer WASM features such as GC integration and reference types might make this barrier a bit softer, but for our current purposes I suggest we just ignore them)
15:17
I'm also unsure about what is the problem that you are trying to solve 😅
Avatar
tedpatrick 06/11/2022 15:19
Well first problem is just understanding how this works at the lowest level. What does that enable?
Avatar
ok, if you just experimenting, please go on :). But apart from experiments, we already have a way to call JS from Python and viceversa, and it's pyodide's js module. You can try to do it again, but you would quickly end up reimplementing the same thing
15:22
and, incidentally, we need something like this for micropython eventually, but it's not straightforward and it will take a lot of time (which is the main reason for why I'm skeptical that micropython will be useful for anything more than experiments any time soon)
Avatar
tedpatrick 06/11/2022 15:23
Well pyodides js module has some edges… js.WebSocket.new
15:24
I would love to see that improved. Especially the implicit use of JS Map. That type breaks all of js
Avatar
I think you are underestimating the effort which is needed there 😅. I predict that reimplementing the js module would take several months, and probably we would introduce other quirks. This always happen when you try to map features of language A onto language B
15:27
IMHO a better approach is to talk to the pyodide people, understand why they decided to implement things in a certain way and see whether it can be improved
Avatar
tedpatrick 06/11/2022 15:28
Or if we can call native web methods directly
Avatar
you can't 🤷‍♂️ , but feel free to try 🙂
Avatar
tedpatrick 06/11/2022 15:28
🙂
Avatar
(to start with, you cannot call methods from WASM. You can call only functions)
Avatar
also, I'm happy to give you (or anybody else who is interested) a guided tour of the relevant code in pyodide, to understand how it works
Avatar
Will it be related to / a recap of what we discussed in Austin?
Avatar
yes, basically the same thing
Avatar
ok, we record this time
Avatar
you can also do it if you want 😉
Avatar
haha, I am afraid I forgot some things so I could also appreciate a recap
Avatar
I'm sure that I forgot them as well, I'd have to re-read the source code
😅 1
Avatar
FabioRosado 06/11/2022 16:30
If you do it can I signup? 😄
Avatar
tedpatrick 06/11/2022 18:38
https://webassembly.github.io/wabt/demo/wat2wasm/ (module (import "js" "import1" (func $i1)) (import "js" "import2" (func $i2)) (func $main (call $i1)) (start $main) (func (export "f") (call $i2)) ) const importObject = { js: { import1: () => console.log("hello,"), import2: () => console.log("world!") } }; const wasmInstance = new WebAssembly.Instance( wasmModule, importObject ); const { f } = wasmInstance.exports; f()
18:39
In effect the js importObject is the only thing in WASM to "import".
18:42
You can call across wasm to js but data types are limited.
Avatar
Yesterday & Today BOT 07/11/2022 07:00
📆 Yesterday & Today - 11/07/2022 🧵
antocuni started a thread. 07/11/2022 08:15
Avatar
Original message was deleted or could not be loaded.
@madhurt could you please move this message to the actual thread that I just created?
Avatar
Yes done, deleted the original one too
Avatar
thanks! 🙂
Avatar
Each time this has to be done manually?
08:18
I mean, creating the thread
Avatar
it seems so. Maybe it's possible to fix the box created by @tedpatrick , but I don't know where it lives
Avatar
okay, I didn't know, I will create one if I am the first one to post I guess
👍 1
Avatar
@madhurt PR 914 reviewd
Avatar
Thanks @antocuni but I think you reviewed a previous version / commit since I already added the to_file parameter.
Avatar
Avatar
madhurt
Thanks @antocuni but I think you reviewed a previous version / commit since I already added the to_file parameter.
sigh
09:01
ok, I reviewed also the missing commit, but the rest of my comments still apply
Avatar
yes thanks, gonna check!
Avatar
Avatar
antocuni
also, I'm happy to give you (or anybody else who is interested) a guided tour of the relevant code in pyodide, to understand how it works
Yes please (just so I have some context).
09:15
I'm so looking forward to a month without travelling anywhere.
😁 1
🌎 1
Avatar
Avatar
antocuni
also, I'm happy to give you (or anybody else who is interested) a guided tour of the relevant code in pyodide, to understand how it works
oh ye that'd be awesome 🔥
Avatar
what is the javascript/TS idiomatic equivalent of if mystring in ('foo', 'bar', baz')?
Avatar
['joe', 'jane', 'mary'].includes('jane')
👍 1
14:01
but I guess array.indexOf(search) >= 0 is more efficient according to StackOverflow
Avatar
My py-terminal/plugin PR is ready to review: https://github.com/pyscript/pyscript/pull/917
🎉 1
Avatar
Here's the same <py-repl> widget but with different runtimes (first MicroPython, then Pyodide) - in MicroPyScript.
🎉 3
🪄 2
Avatar
Avatar
antocuni
My py-terminal/plugin PR is ready to review: https://github.com/pyscript/pyscript/pull/917
do you recommend reading the discussion you had with fabio to review that?
19:28
from my understanding of the issue seems like the design is still to be defined?
Avatar
FabioRosado 07/11/2022 20:06
Antonio I'm not pinging you directly because I dont know if you are still working or not 😄 But I think we need to use showWarning or maybe just create the error banner when we call handleFetchError, the test is failing because the page never stops loading - the fetch raises the error so we never call the logic to hide the loading screen. Also since we get a list of paths in fetch Paths, would it make sense to show the warning and keep trying other paths? 🤔 I wonder if we should be start and if we handle any of the UserError we try to toggle the loading screen off
Avatar
Avatar
3l3ktr4
do you recommend reading the discussion you had with fabio to review that?
no, it's unrelated. This is about JS plugins, the discussion with FabioP is about python plugins
Avatar
Avatar
FabioRosado
Antonio I'm not pinging you directly because I dont know if you are still working or not 😄 But I think we need to use showWarning or maybe just create the error banner when we call handleFetchError, the test is failing because the page never stops loading - the fetch raises the error so we never call the logic to hide the loading screen. Also since we get a list of paths in fetch Paths, would it make sense to show the warning and keep trying other paths? 🤔 I wonder if we should be start and if we handle any of the UserError we try to toggle the loading screen off
I'm not working but I'm still online :). Changing the main logic to accommodate the tests sounds wrong -- we need a better tests ;). Look at the defintion of pyscript_run in support.py: it takes a param wait_for_pyscript=True which does exactly what you need
21:13
and see test_invalid_toml_config in test_py_config.py, it seems very similar to what you need
21:15
Also since we get a list of paths in fetch Paths, would it make sense to show the warning and keep trying other paths? 🤔
personally I'm -1 on this. If you expect to download something and this something doesn't exist, better to stop early and show a clear error. If you continue it's very likely that you get an obscure ImportError (if the failed file was a .py file) or a FileNotFoundError later.
21:15
Errors should never pass silently (from the Zen of Python) (edited)
21:16
I wonder if we should be start and if we handle any of the UserError we try to toggle the loading screen off
this is a very good idea!
Avatar
FabioRosado 07/11/2022 21:23
I need to look more into the py-config logic I think 😄 But yeah that makes a lot of sense! Although I wonder if this failing test also picked something odd? The loading screen doesn't finish loading which we expect, but nothing is showing in the page either and no error in the console which is odd 🤔
Avatar
I suggest to run py.test tests/integration/test_whatever.py -k the_name_of_your_test -s --dev --dev is needed to be able to debug the typescript files from the dev tools. Maybe this is useful to understand what's going on
Avatar
FabioRosado 07/11/2022 21:27
oh that's useful to know thanks! let me know (I suspect it might be some weirdness with async and the withUserErrorHandler maybe )
Avatar
I'm lost. Let you know what? 😅
Avatar
FabioRosado 07/11/2022 21:28
the --dev flag haha
Avatar
sorry, I think I'm slow to understand at this time of the day 😂😴 . Are you waiting for some answer/input from me, or you have everything you need not to be blocked?
Avatar
FabioRosado 07/11/2022 21:32
No worries I'm as well haha No I think I got unblocked need to keep playing around with it and see, also fun fact using --dev removes the loading screen, but no banner still or log messages so yeah something odd going on haha
21:32
thanks for the help!
Avatar
np! Going offline now, see you tomorrow 👋
Avatar
FabioRosado 07/11/2022 21:34
see you tomorrow have a good rest 👋
Avatar
Avatar
antocuni
Also since we get a list of paths in fetch Paths, would it make sense to show the warning and keep trying other paths? 🤔
personally I'm -1 on this. If you expect to download something and this something doesn't exist, better to stop early and show a clear error. If you continue it's very likely that you get an obscure ImportError (if the failed file was a .py file) or a FileNotFoundError later.
I may be misreading this, so take that into consideration. I'm +1 on avoiding silent errors and stopping early as default BUT allowing apps to gracefully fail is a good opt-in pattern. It's totally ok to allow apps to silently fail on steps they consider secondary without blocking, allowing users to decide their own strategy to mitigate parts of their apps that are failing.
Avatar
Yesterday & Today BOT 08/11/2022 07:00
📆 Yesterday & Today - 11/08/2022 🧵
Avatar
Avatar
Fabio
I may be misreading this, so take that into consideration. I'm +1 on avoiding silent errors and stopping early as default BUT allowing apps to gracefully fail is a good opt-in pattern. It's totally ok to allow apps to silently fail on steps they consider secondary without blocking, allowing users to decide their own strategy to mitigate parts of their apps that are failing.
I'm on the same page here. By default errors should be chatty, explicit and annoying. Sometimes you can opt-in to silence (some of) them, but it must be very explicit. Also, something to keep in mind is that we are building a framework, not an app: our responsibility is not "gracefully fail", but to give our users the tools to gracefully fail if they want
antocuni started a thread. 08/11/2022 09:02
tedpatrick started a thread. 08/11/2022 15:32
Avatar
jupyterlite workshop invitation - Paris Dec 7th through 9th (edited)
Avatar
Jeff Glass 08/11/2022 16:22
Hi All! Apologies for dropping off the map - I had some family business that took me out of town for the weekend and then some. I'm working this week on the 'What's New in PyScript 2022.11.1" blog post in anticipating of a release, may have some question for individual folks to make sure I'm getting the details right on some of the more breaking PRs (especially arounddisplay() and py-config [[fetch]])
✨ 3
16:22
PR #833 (version numbers) is ready for review, but it's not path-critical for 2022.11.1 I think, so no need to rush it.
👍 1
Avatar
Avatar
Jeff Glass
Hi All! Apologies for dropping off the map - I had some family business that took me out of town for the weekend and then some. I'm working this week on the 'What's New in PyScript 2022.11.1" blog post in anticipating of a release, may have some question for individual folks to make sure I'm getting the details right on some of the more breaking PRs (especially arounddisplay() and py-config [[fetch]])
glad to have you back! I look forward reading your blog post... also because sometimes pyscript evolves so quickly that reading your blog post is a good way to discover what happened 😂.
💯 2
❤️ 1
Avatar
I'd like to write a test for the PyLoader. Problem: the loader automatically disappear at some point. Currently it takes so long that I'm sure I can use a self.page.locator('py-loader') to find it, but theoretically, if the startup is very fast, it could be already gone by the time my test code runs. What is the playwright best practice to test such a case?
Avatar
We are at #927 for issues and pull requests. How are we celebrating #1000 (soon!)? 🥳
Avatar
anyone that can do a quick approval for https://github.com/pyscript/pyscript/pull/929 ?
Avatar
Yesterday & Today BOT 09/11/2022 07:00
📆 Yesterday & Today - 11/09/2022 🧵
madhurt started a thread. 09/11/2022 07:10
Avatar
tedpatrick 09/11/2022 14:07
Earlier this year we unveiled PyScript to enable users to create Python applications in the browser. In order for PyScript to succeed, we at Anaconda must make strategic investments in both the project itself and its core technology dependencies, such as WebAssembly (Wasm) and the fantastic Pyodide…
🎉 4
Avatar
thank you for the effort which you put on this 🙏
✨ 1
Avatar
tedpatrick 09/11/2022 14:12
I need to thank @ntoll 🦜 📜 is magic
Avatar
Thank you @tedpatrick for all your efforts too.
🦜 1
Jeff Glass started a thread. 09/11/2022 14:17
Avatar
Paul Everitt 09/11/2022 15:01
Kudos to all at Anaconda and beyond...any one of those 3 would be a big announcement on its own.
❤️ 1
🙌 4
Avatar
'k folks... I'm stepping onto a train home from London. AFK.
Avatar
@FabioRosado I'm not sure whether it's related to your PR, but test_py_config.py::test_paths_that_do_not_exist fails on my machine
19:46
no error banner is displayed at all
19:47
and honestly looking at the code I don't understand how it could possibly work, since the call to this.afterRuntimeLoad(this.runtime); is not wrapped into a withUserErrorHandler
19:48
does it work for you? And more importantly, why it doesn't fail on CI? 🤔
Avatar
FabioRosado 09/11/2022 19:51
wrapping afterRuntimeLoad didn't show the banner for me that's why I kept the same behaviour and the unfortunate duplication of code and call _createBanner in handleFetchError. If you do --headed does the splash screen disappear from the page? Also what failure are you seeing? 🤔
Avatar
Avatar
FabioRosado
wrapping afterRuntimeLoad didn't show the banner for me that's why I kept the same behaviour and the unfortunate duplication of code and call _createBanner in handleFetchError. If you do --headed does the splash screen disappear from the page? Also what failure are you seeing? 🤔
19:58
nothing is shown
19:58
and the test fails because it cannot find the error message
Avatar
FabioRosado 09/11/2022 20:00
do you see anything in the devtools? 🤔
20:00
I can also try to pull your branch if it helps
Avatar
uh, something is very wrong
20:02
await runtime.loadFromFile(paths[i], fetchPaths[i]); I can see a 404, but it doesn't raise any exception
20:02
but I see this behavior also on main, not in my branch
20:02
oh I see
20:03
with --headed it works, with --dev it doesn't 😱
Avatar
FabioRosado 09/11/2022 20:03
Oh!
20:03
yeah I was meant to reach out to you after you mention the --dev
20:03
I was getting a completely different behaviour when using the dev flag
Avatar
ok but this is worrying
20:04
because --dev uses a real web server
Avatar
FabioRosado 09/11/2022 20:04
But I think the --dev flag runs a server right? So the expected test would fail anyway since it expects to see the "run webserver" error
Avatar
so I expect it to have a behavior which is closer to the one that you get in production
Avatar
FabioRosado 09/11/2022 20:04
Yeah and it should still fail with the non-existent file
Avatar
anyway, I'll debug it tomorrow I suppose
20:05
afk 👋 (edited)
Avatar
FabioRosado 09/11/2022 20:11
Oh I think I see the the problem, I'll create an issue as it will be probably easier to link code 😄
👍 1
Avatar
FabioRosado 09/11/2022 20:25
https://github.com/pyscript/pyscript/issues/934 Let me try checking the status code and raising and error, hopefully it will be a quick fix
Checklist I added a descriptive title I searched for other issues and couldn&#39;t find a duplication I already searched in Google and didn&#39;t find any good information or help What is t...
Avatar
Leonard Wolf 10/11/2022 03:43
Umm hey guys have been on trip
03:44
Regarding this message I can allow maintainers role to change roles of a member
Avatar
Yesterday & Today BOT 10/11/2022 07:00
📆 Yesterday & Today - 11/10/2022 🧵
Avatar
Avatar
Leonard Wolf
Regarding this message I can allow maintainers role to change roles of a member
FabioRosado 10/11/2022 07:46
That would be good if seems the bot has done issues DMing folks, I’m worried that people might not come back because they couldn’t get verified or see any other channels
💯 1
antocuni started a thread. 10/11/2022 08:47
Avatar
Avatar
FabioRosado
That would be good if seems the bot has done issues DMing folks, I’m worried that people might not come back because they couldn’t get verified or see any other channels
Leonard Wolf 10/11/2022 10:38
Umm if you guys say we can remove the protection all together
10:39
Its a captcha protection if you want we can make all channels public
✅ 1
Avatar
This allows to run tests offline (if the cache is already populated), and to make them much faster if you are on a slow connection. Running a single tests went from ~8s to ~5s on my machine. Moreov...
✅ 1
🎉 1
Avatar
Avatar
Leonard Wolf
Its a captcha protection if you want we can make all channels public
Jeff Glass 10/11/2022 12:59
I'd say open it up, and if we encounter an issue with spam/bots or similar, we can discuss reverting to requiring verification?
👍 2
✅ 1
😎 1
Avatar
Avatar
Jeff Glass
I'd say open it up, and if we encounter an issue with spam/bots or similar, we can discuss reverting to requiring verification?
Leonard Wolf 10/11/2022 13:20
Aye as you guys say!
Avatar
Avatar
Leonard Wolf
used /captcha stop
DiSWIKI BOT 10/11/2022 13:21
Verification system for this server has been disabled! Feel free to start it again by typing /captcha start
Avatar
Leonard Wolf 10/11/2022 13:25
Also I wish to know if this channel can be viewed by public? And if they can type in it?
Avatar
tedpatrick 10/11/2022 13:30
This channel should be Viewable
13:33
PyScript-core should be public but chat is limited to maintainers
13:34
I believe the settings are correct now
Avatar
@tedpatrick are we having the plugin call tomorrow?
Avatar
Avatar
antocuni
@tedpatrick are we having the plugin call tomorrow?
tedpatrick 10/11/2022 13:56
Are you off tomorrow?
Avatar
no, I'll be working (edited)
Avatar
tedpatrick 10/11/2022 13:57
Was about to set that meeting up just after the HackDay Demos
Avatar
works for me
Avatar
tedpatrick 10/11/2022 14:00
Sent!
Avatar
FabioRosado 10/11/2022 14:55
While chatting with Mariana today, I mentioned that the folks at OSS in my previous company used to use Tandem to work, its kind of discord where you can have rooms and you can start video with other folks in a room. They used to do that while debugging stuff and also at times while working just to feel like they are working with other folks Not sure what you all think about his, but perhaps we could try do that in discord at one point
Avatar
Avatar
FabioRosado
While chatting with Mariana today, I mentioned that the folks at OSS in my previous company used to use Tandem to work, its kind of discord where you can have rooms and you can start video with other folks in a room. They used to do that while debugging stuff and also at times while working just to feel like they are working with other folks Not sure what you all think about his, but perhaps we could try do that in discord at one point
Leonard Wolf 10/11/2022 14:59
Umm we do have option for that
Avatar
Avatar
Leonard Wolf
Umm we do have option for that
FabioRosado 10/11/2022 14:59
Yeah that's why I mentioned, we could do it in discord 🙂
✅ 1
Avatar
yep! I thought it was a cool idea 🙂 feel like @ntoll would be fond of it? (edited)
Avatar
I'm fond of anything that makes working together easier. 🙂
Avatar
tedpatrick 10/11/2022 16:41
I want to welcome @mchilvers and @almart to PyScript Core. They are both at Anaconda working on PyScript.
🎉 5
16:51
Hah... my internet's choppy, so going to the BBC website is my go to quick way to work out if stuff's working. Clearly I had the wrong focus. 🤦
16:52
Just gonna restart my router before the 5pm meeting
Avatar
Fwiw, I wanted to participate to the pyscript fun call, but my internet is not working 😤
❤️ 2
Avatar
@antocuni we all wore hats today 😛
Avatar
Avatar
madhurt
@antocuni we all wore hats today 😛
like, real hats on the head? Why? 😅
🦜 1
Avatar
because it was a FUN meeting haha
Avatar
tedpatrick 10/11/2022 18:37
🤠
18:37
We need to open up these meetings to all Maintainers.
Avatar
Jeff Glass 10/11/2022 19:55
PR #928 (removing implicit coroutine scheduling, i.e. no more top-level-await) is ready for review. 🎉
🎉 1
Avatar
Avatar
Jeff Glass
PR #928 (removing implicit coroutine scheduling, i.e. no more top-level-await) is ready for review. 🎉
I'll review it tomorrow
Avatar
tedpatrick 10/11/2022 22:56
pyodide CDN by jsDelivr - A free, fast, and reliable Open Source CDN for npm and GitHub
22:58
22:58
pyodide.asm.wasm down 1.4MB in size
23:00
Also distutils.tar is gone
Avatar
wow
23:25
uhm, I'm looking at the changelog. This is a breaking change for us: https://github.com/pyodide/pyodide/blob/8523da0f36150b0ce070b17a2a76128b310a4eb7/docs/project/changelog.md#L143-L160 (micropip must be installed explicitly) (edited)
Avatar
Avatar
antocuni
uhm, I'm looking at the changelog. This is a breaking change for us: https://github.com/pyodide/pyodide/blob/8523da0f36150b0ce070b17a2a76128b310a4eb7/docs/project/changelog.md#L143-L160 (micropip must be installed explicitly) (edited)
Jeff Glass 11/11/2022 02:17
From my reading of that note, this just presents the ability to install a different version of micropip from the bundled one, if desired. From the PR, it looks like it’ll be bundled with Pyodide as it was before, the code’s just been moved to its own repo; the package source is a PyPI source instead of local source (edited)
👍 1
Avatar
Avatar
Jeff Glass
From my reading of that note, this just presents the ability to install a different version of micropip from the bundled one, if desired. From the PR, it looks like it’ll be bundled with Pyodide as it was before, the code’s just been moved to its own repo; the package source is a PyPI source instead of local source (edited)
tedpatrick 11/11/2022 02:47
conda in js 🙂
Avatar
Yesterday & Today BOT 11/11/2022 07:00
📆 Yesterday & Today - 11/11/2022 🧵
antocuni started a thread. 11/11/2022 08:04
Avatar
pff, I hate squash&merge. I started my more-plugins branch on top of py-terminal, but now that py-terminal is merged to main, when I do git merge origin/main I get tons of conflict, because from the point of view of git the commit which merged py-terminal has nothing to do with the original branch 😤.
Avatar
Avatar
antocuni
pff, I hate squash&merge. I started my more-plugins branch on top of py-terminal, but now that py-terminal is merged to main, when I do git merge origin/main I get tons of conflict, because from the point of view of git the commit which merged py-terminal has nothing to do with the original branch 😤.
In case anyone encounters this problem in the future, I fixed it with this command: git rebase --onto=main antocuni/py-terminal antocuni/more-plugins which basically means "take all the commits which starts from py-terminal (excluded) to more-plugins (included) and rebase them on main (edited)
Avatar
FabioRosado 11/11/2022 09:39
Oh that's very useful to know thanks!
Avatar
Learning and getting suck on overriding pyodide's typing
I don't know if this is related or not to the typing, but I mention just in case it is. Currently, we have a very awkward way of loading/typing pyodide: 1. at runtime, pyodide is loaded by adding a <script> tag to the <head>: once it's loaded, loadPyodide will be available as a JS global function https://github.com/pyscript/pyscript/blob/3c3dffd5ede31aaee868e4260379eac86b7e27a2/pyscriptjs/src/main.ts#L139-L144 2. typescript doesn't know about this of course. The typing comes from the npm installed pyodide package, which is not necessarily the same as the one which we load at runtime of course. AFAIK, the local pyodide package is used only for this and to run jest tests: https://github.com/pyscript/pyscript/blob/3c3dffd5ede31aaee868e4260379eac86b7e27a2/pyscriptjs/src/pyodide.ts#L4-L11 3. I think that "someone, at some point, in some place" (sorry, I don't remember more details) mentioned the fact that we could load pyodide dynamically as a ES module instead of using a <script> tag. It sounds a better solution to me, and maybe it also helps typing (but I don't really know)
Avatar
FabioRosado 11/11/2022 09:55
Thanks that's great info! Yesterday I was reading about typing and overriding some of the types and stackoverflow mentioned using a custom-typings.d.ts and do something like: export declare type "Pyodide" { blah} But that didn't work, although my terrible workaround seems to be okay(ish) , I'm creating an interface like this just to support the extra methods that the Pyodide typing doesn't have export declare interface PyProxy extends PyProxy { connect(): void; get(value: string): function | object; set(id: string, proxy: PyProxyClass): void; } Although the get return is pretty bad 😬
Avatar
I think this is a rabbit hole and it will never work well. There are certain things which are intrinsically dynamic, there is no point in trying to add a precise type to them. runtime.run and runtime.globals.get are good examples of this: they can return "whatever", so their return type is just any. Trying to type them is "static typing for the sake of static typing" IMHO
10:06
the quote is a bit old, but "C and Fortran" are examples of statically typed languages, and "Common Lisp" is an example of dynamically typed language
Avatar
here we start from a dynamic language (JS), we add static types (TS), and they we try to work around them to get dynamic types again, which looks a bit nonsense to me. Static typing is a very useful tool to catch a very specific set of bugs: the parts of your programs which are naturally statically typed can benefits from it, but if you try to apply static types to the parts of your programs which are intrinsically dynamic, you are just making things more convoluted with no extra safety at all. (The golden rule should be: does this thing help to catch bugs?)
Avatar
FWIW - the reason I chose to write MicroPyScript in JS and not TS was because I prefer dynamic types.
Avatar
the problem with JS is that when they types are wrong, it just tries to guess something, and usually it guesses wrongly. So in this sense TS over JS is much more useful compared to e.g. mypy over Python
10:29
anyway, time to close all my chats and start coding!
👍 1
Avatar
@FabioRosado I noticed that you never put semicolons at the end of the statements. I think that it's a good practice to do it because if you rely on automatic semicolon insertion you might encounter some very weird corner cases (or at least, that's what I've read in some book 😅)
Avatar
FabioRosado 11/11/2022 10:50
Sorry for the delay I’m walking home 😄 those are very good points also for the get specifically even with these types we still need to write a type for the thing we are getting like Display for example. I might have been a bit too eager to kill all warnings 🤣
10:51
Oh yeah I definitely need to work on that most of the times React is happy with whatever
Avatar
I might have been a bit too eager to kill all warnings
it's probably a discussion that we should have as a team, because it doesn't make sense to have half of the team introducing warnings and half of the team fixing them. I know that e.g. @tedpatrick has a different opinion than me, for example
Avatar
FabioRosado 11/11/2022 11:03
That’s probably a good idea also there are a lot of eslint-disable on my branch since I’m seeing some weird behaviour where TS has the types but eslint is complaining that the typing is any
Avatar
tedpatrick 11/11/2022 12:42
Yawn… TS what?
12:48
Goal should be types that make refactoring easier and validate key parts. TS supports dynamic behavior and best to limit to range of types. Structural typing is a bit different than static.
12:50
let foo vs let foo: number | null = null
12:52
The first case is the wild west. The 2nd case just limits the range of foo to 2 types number and null. Anywhere foo is used, it must enforce foo to null or number. (edited)
12:55
As we push more types into the codebase, the error cases get more interesting and highlight problems.
12:57
In my experience, TS adds value 2 ways: 1. It is a giant compile time test 2. It makes refactoring great as you can aggressively break things and TS will show you the issues to fix (edited)
12:58
Today, our typing is mixed. If you turn on strict mode there are 70 errors. tsconfig.json set... "compilerOptions": { "strict": false } (edited)
13:01
If you run npm run tsc you will see the error list in full.
13:02
We need to discuss as a team
Avatar
FabioRosado 11/11/2022 13:10
Oh just toggled strict to true and ran tsc and still got 85 errors. My changes didn't mattered much (main has 88 errors), I was running npm run lint thinking that this was the issues that strict mode would complain about 😦
Avatar
tedpatrick 11/11/2022 13:14
We started at 129 errors. Progress
Avatar
It makes refactoring great as you can aggressively break things and TS will show you the issues to fix
I fundamentally disagree on this. If you have a good test suite, all the errors which are caught by the TS typesystem are also caught by tests. If you have a type error which would not be caught by a test, it means that you are missing a test. A static typechecker does help in finding a specific class of errors, but it comes with a cost in terms of "burden". It is fine until a certain point, and after that the cost of the "burden" surpasses the benefits (always IMHO). About refactoring, in my experience static typing makes refactoring harder because you cannot "break everything and fix things test after test", you need to fix everything before you are even able to run the first test. I encountered exactly this issue two days ago in my plugin branch.
13:18
Structural typing is a bit different than static.
no I'm talking about dynamic vs static type checks. Here you are talking about structural vs nominal typing. They are orthogonal
(edited)
Avatar
tedpatrick 11/11/2022 13:39
I disagree. 🙂
😅 1
Avatar
For what it's worth, I quite like console based modal editors... :wq 😛
Avatar
Avatar
ntoll
For what it's worth, I quite like console based modal editors... :wq 😛
years ago I'd have started a flamewar here, but the world has changed so much that compared to modern IDEs, vim suddenly looks like a very reasonable choice 😂
Avatar
Hahahaha... a perfect and beautifully crafted response. 😄
Avatar
tedpatrick 11/11/2022 14:33
It's ok I feel for anyone not using VSCode. 🙂
14:37
TS and VSCode are a pair, it runs in process and highlights all the problems. There are language services for TS that should enable visibility in vim/emacs but that is a foreign land for me.
Avatar
tedpatrick 11/11/2022 14:46
Contribute to tedpatrick/ts-in-depth-2020 development by creating an account on GitHub.
Contribute to tedpatrick/ts-in-depth-2020 development by creating an account on GitHub.
14:47
In the 3 years since, they added union types and all sorts of stuffs. Need to update.
Avatar
if you disable the type checking, you don't need to highlight errors
😆 1
Avatar
tedpatrick 11/11/2022 14:48
JS just lacks any cohesion as a language. If a cat walks across your keyboard in a js project, well good luck.
😹 2
14:48
Add in multiple devs with different approaches... oh shit... death
tedpatrick started a thread. 11/11/2022 14:52
Avatar
tedpatrick 11/11/2022 16:18
If folks want to talk ahead of the "Refine: Plugins for PyScript" meeting , I am hanging out there.
Avatar
Gotta say, I love those meetings. So stimulating, so friendly.. etc
❤️ 4
tedpatrick started a thread. 11/11/2022 17:06
Avatar
Avatar
ntoll
Gotta say, I love those meetings. So stimulating, so friendly.. etc
tedpatrick 11/11/2022 17:07
We need to meet on features more often. 🦜 ❤️
💯 4
Avatar
Guys, should we upgrade to use the latest Pyodide?
17:30
I mean, this could be a part of the release
17:30
before Ted goes for a vacation
Avatar
Avatar
madhurt
Guys, should we upgrade to use the latest Pyodide?
Jeff Glass 11/11/2022 17:42
We're on the current patch release currently (0.21.3)... I'm not sure if we want to move to an Alpha release (most current is 0.22.0a3), so might depend on timing?
Avatar
yeah, then we should probably wait for a stable one first
Avatar
Avatar
Jeff Glass
We're on the current patch release currently (0.21.3)... I'm not sure if we want to move to an Alpha release (most current is 0.22.0a3), so might depend on timing?
tedpatrick 11/11/2022 17:48
Let's test with 0.22.0a3 and ship on 0.21.3 support.
Avatar
μSQLite library module for MicroPython. Contribute to spatialdude/usqlite development by creating an account on GitHub.
Avatar
No I did not.
18:23
OK folks... it's the weekend. 👋
🧃 1
🦜 1
🕺 1
🤸 1
tedpatrick started a thread. 12/11/2022 22:46
Avatar
Jeff Glass 13/11/2022 19:53
Am I right in thinking we don't currently have a way to route the stdout of a <py-script> tag on a tag-by-tag basis? Similar to how <py-script std-out="..."> prior to the introduction of display()?
Avatar
Avatar
Jeff Glass
Am I right in thinking we don't currently have a way to route the stdout of a <py-script> tag on a tag-by-tag basis? Similar to how <py-script std-out="..."> prior to the introduction of display()?
do you mean the stdout, or the display target?
Avatar
Jeff Glass 13/11/2022 19:55
the stdout
Avatar
so you would like two different <py-script> to print() to two different output streams?
Avatar
Jeff Glass 13/11/2022 19:56
Yes
Avatar
I think it's a bit of ill-formed request, because stdout is inherently a property of the process (i.e., of the pyodide/emiscripten instance in this case). There can be only one stdout.
19:58
what we could do is to intercept the python-level sys.stdout and redirect it somewhere else, similar to the old OutputManagerCtx
Avatar
Jeff Glass 13/11/2022 20:01
Fair enough - I suppose what I'm looking for is "for this <py-script> tag, anything that is written to stdout should be sent to such-and-such HTML element" (or, more powerfully, handled by such-and-such function) and that's not currently something that we can do, unless I've missed something. But yes, something like what was possible with the old OutputManagerCtx and <py-script std-out> (edited)
20:02
Or is that part of the StdioMultiplexer from your Plugin implementation @antocuni ?
Avatar
"handled by such-and-such function" is easy: that's exactly that StdioMultiplexer does
20:04
you can easily register your hand stdio handler and receive the data which is written to stdout (edited)
20:05
the hard part is to make it per-tag, for basically the same reasons why it's hard to implement display()
20:06
well, the old OutputManagerCtx was half-broken 😅. For example, it didn't intercept the stdout which were emitted by C code
😵‍💫 1
20:07
what is the use case that you have in mind?
20:13
(I'm on a train so I might disappear at any moment if I loose connection)
Avatar
Jeff Glass 13/11/2022 20:13
No worries! Sorry for the delay just trying to put together the most concise example I can
20:17
Here's the situation I run into when writing blog posts/tutorials about Python/PyScript. Here's a really stripped down example from an imaginary tutorial about how print() works: <p>This print() function in Python is how we print things to the terminal</p> {{ displaycode helloworld.py" }} <py-script src="helloworld.py" std-out="first-example"></py-script> <div id="first-example"></div> <p>print() can be used to print just about any object:</p> {{ displaycode print_list.py }} <py-script src="print_list.py" std-out="second-example"></py-script> <div id="second-example"></div> #helloworld.py print("Hello, world"!) #print_list.py print([1,2,3,4]) (edited)
20:19
I know we've got ongoing evolution of src="...", but it's mostly used here for brevity. I use it here to emphasize that having the displayed-code and the executed code be the same is really, really useful for ensuring that the examples do what they claim they're going to (edited)
Avatar
Jeff Glass 13/11/2022 20:33
Rather than the user seeing: print("Hello, world") and having to use the following as source: <py-script> with ContextManager_RedirectStdoutToElemWithID("first-example"): print("hello, world") </py-script> (edited)
Avatar
ok, I see your point. Your example seems a bit odd though, because the comments says "we print things to the terminal" and then it prints them to a div, which is not a terminal. For example, consider this: <py-script std-out="xxx"> print("what's your name?") name = input() </py-script> Where does the input come FROM?
Avatar
Jeff Glass 13/11/2022 20:52
Please do forgive the verbiage of the example - would like a way to show the output contents of what would be in the terminal, in order to illustrate the functionality of print() in Python. To make it possible to use PyScript to better illustrate Python concepts in a way that doesn't expose the reader to any additional PyScript machinery (edited)
Avatar
ah ok sorry, I didn't realize that you were talking about python and not pyscript
👍 1
20:57
what about the following: 1. we add new plugin hooks before-py-script and after-py-script which are executed before and after the execution of each <py-script> tag
20:58
2. you can write a custom plugin for your page which does the redirect and/or tweaks StdioMultiplexer to redirect each py-script to its own py-terminal
20:59
this should solve your use case, without adding a half-broken functionality to the pyscript core
21:01
(we can talk about adding such functionality to the core, of course. My gut feeling is that it doesn't play well with the rest of the execution model, but I agree that in certain simple use cases it might be useful)
Avatar
Avatar
antocuni
(we can talk about adding such functionality to the core, of course. My gut feeling is that it doesn't play well with the rest of the execution model, but I agree that in certain simple use cases it might be useful)
Jeff Glass 13/11/2022 21:04
Your intuition about execution flow is probably better than anyone's at this point, given how much of the refactoring you've done - I'd be more than happy with the ability to write it as a Plugin, and if we see the need for it popping up a lot more, maybe we can revisit it being in the core at that point, if it's warranted. (edited)
Avatar
cool :). I think that we have almost enough machinery for doing that already
21:05
my more-plugins PR is almost ready
21:06
once it's merged, it should be very easy to add the two new hooks
21:06
and we "only" need a way to register custom plugins from the page, since currently the list of plugins is hardcoded
21:07
also, we need to understand whether it's better to write your plugin in python or JS
21:08
and the before/after-py-script hooks are very useful on its own I think: for example, I can imagine using them to write a very simple&dump profiler
Avatar
Avatar
antocuni
and the before/after-py-script hooks are very useful on its own I think: for example, I can imagine using them to write a very simple&dump profiler
Jeff Glass 13/11/2022 21:13
Absolutely - for doing things that are meant to respond to/involve a specific tag, I can imagine them being quite useful. Perhaps a poor-man's "debugging" plugin that only executes one pyscript tag at a time, then doesn't run the next one until an event is dispatched. To help illuminate execution order or similar.
21:14
Another sort of things that probably half-works...
Avatar
yes, I like that idea although I am already imagining N ways in which such a way would subtly break things 😅
❤️ 1
21:15
(e.g. if you run an event handler before the executing a py-script which is usually executed at startup)
Avatar
Jeff Glass 13/11/2022 21:31
You know I love systems that subtly break 😅
21:31
I'm gonna open a short Issue over on GitHub to remind us of the new hooks when the time comes
👍 1
Avatar
Yesterday & Today BOT 14/11/2022 07:00
📆 Yesterday & Today - 11/14/2022 🧵
antocuni started a thread. 14/11/2022 09:49
Avatar
Paul Everitt 14/11/2022 12:22
Hi, sorry about Friday and plugin call. Got the email Friday morning, had my day booked.
12:23
On the release planning, "DOM Events" is listed for core event system. Small note: this won't survive worker-ification.
Avatar
FabioRosado 14/11/2022 13:27
Is anyone wanting to work on the workers? I remember that in a meeting someone wanted to, but don't remember who 🤔 If not I might poke at it at the research repo so I get my head around it 😄
Avatar
Avatar
Paul Everitt
On the release planning, "DOM Events" is listed for core event system. Small note: this won't survive worker-ification.
oh, that's a very good point which I didn't think about
Avatar
Paul Everitt 14/11/2022 13:38
FWIW, I'm pushing now a 19-part "diary-driven-development" exploration of "Pyodide Components" that is very worker-centric. There was a LOT of pain involved. 😀 It's a fiddly topic.
Avatar
what is "diary-driven development"?
Avatar
Paul Everitt 14/11/2022 13:40
I implement something step-by-step, with a Sphinx doc explaining the "Why? How?" on each step
13:40
It's useful when trying to explain complex proposals
Avatar
ah interesting. Is it a concept that you invented, or it's well known?
Avatar
Paul Everitt 14/11/2022 13:40
I just made it up
Avatar
ok, that's why google couln't help 😅
Avatar
Paul Everitt 14/11/2022 13:41
I proposed the same thing in September, did a video for it...need to do that on this re-do
Avatar
(I know that it's an unpopular opinion nowadays but I still find text a much more useful medium than videos to explain stuff. I suppose it means that I'm old 😅)
Avatar
Paul Everitt 14/11/2022 13:43
I'm older 🙂
13:44
Anyway, here are the docs: https://pyodide-components.readthedocs.io/en/latest/project_init.html
  • Some sections are sparse
  • I haven't finished (incomplete on pre-render, need to add injector)
  • I learned stuff at the end that I needed at the beginning.
13:45
Prototype a testing-oriented, worker-based, message-style framework for Pyodide &quot;components&quot; based on custom elements. - GitHub - pauleveritt/pyodide-components: Prototype a testi...
13:45
Most of all, it's me advocating for a NodeJS-test-oriented "joyful" mode of dev
Avatar
and each page of the doc correspond to a commit?
Avatar
Paul Everitt 14/11/2022 13:50
80% of the time. I got frustrated and did some Mean Commits.
13:50
When I do my re-re-write, I'll compartmentalize, squash, etc.
13:50
I'll also do better on code snippets like here: https://pyodide-components.readthedocs.io/en/latest/vitest.html
Avatar
it's a very interesting concept, I'm enjoying reading it. I don't know how hard is to achieve but I would love to see the diff of each commit directly from the sphinx docs
Avatar
Paul Everitt 14/11/2022 13:53
You're right, that would be immensely helpful. Could actually help reduce work in narrative.
Avatar
maybe you can write a sphinx extension to do it semi-automatically
Avatar
Paul Everitt 14/11/2022 13:54
I will say, the mode of development at the end is quite nice.
13:55
And I think the messaging pattern is a good fit
Avatar
I will say, the mode of development at the end is quite nice.
only if you like writing text. For example, I don't 😅
Avatar
Paul Everitt 14/11/2022 14:00
Ha! Actually, I meant the non-diary mode. Sitting in Vitest, driving stuff.
Avatar
ah ok. Yes, I also like to develop test-first (although I don't understand why you don't want to call it TDD).
Avatar
tedpatrick 14/11/2022 14:03
The hat you have to wear while doing TDD is uncomfortable.
Avatar
but some of the things has to be tested in the browser, at least for pyscript. Have you tried to run the integration tests? With pytest -s --dev the experience is not too bad, since you don't have to switch to the browser, pytest takes case of starting one for you
Avatar
Paul Everitt 14/11/2022 14:03
For me, TDD implies "eat your vegetables"
14:03
Yes, I also have pytest-playwright for that part
14:04
But as it turns out, it still goes far
Avatar
I claim that the pyscript's machinery makes the overall experience an order of magnitude better than pytest-playwright alone. For example, you can see the JS console directly on the terminal, and JS exceptions are automatically turned into pytest failures, etc.
Avatar
Paul Everitt 14/11/2022 14:05
Prototype a testing-oriented, worker-based, message-style framework for Pyodide &quot;components&quot; based on custom elements. - pyodide-components/worker.test.js at main · pauleveritt/py...
❤️ 1
14:07
Point being, the NodeJS side can execute the WASM side
👍 1
14:08
It's awesome sitting in my IDE, setting breakpoints in my tests, not really caring about the console
14:08
Anyway, enough of that, you're more interested in worker stuff
Avatar
not really caring about the console
yes this is probably the main difference in our preference. I don't use an IDE and I start pytest from my big fullscreen terminal 👴
Avatar
Paul Everitt 14/11/2022 16:12
Sorry, I should add...besides workers, the other big idea: custom elements defined 100% on the Python side
16:13
Prototype a testing-oriented, worker-based, message-style framework for Pyodide &quot;components&quot; based on custom elements. - pyodide-components/counter.py at main · pauleveritt/pyodid...
tedpatrick started a thread. 14/11/2022 17:14
Avatar
OK folks, catch you tomorrow. QQ: several of us have a clash with the PyScript core meeting. Should we move it..?
✅ 2
Avatar
Great. I was hoping you'd join the session on Friday because I really wanted to chat about your approach. Help me understand one thing actually. Yes, from an user point of view, custom elements are defined on the Python side but(!) you are still creating a custom element (CE) in JS and using the registry and proxied objects as bridge from the CE in JSland and your class instance in Pythonland, right? Or am I missing something?
Avatar
Avatar
Fabio
Great. I was hoping you'd join the session on Friday because I really wanted to chat about your approach. Help me understand one thing actually. Yes, from an user point of view, custom elements are defined on the Python side but(!) you are still creating a custom element (CE) in JS and using the registry and proxied objects as bridge from the CE in JSland and your class instance in Pythonland, right? Or am I missing something?
Paul Everitt 14/11/2022 18:40
Yes, here is where a runtime JS class is generated for each custom element: https://github.com/pauleveritt/pyodide-components/blob/main/src/pyodide_components/main.mjs#L26 You ask Python for the "registry", then for each item, you make an element https://github.com/pauleveritt/pyodide-components/blob/main/src/pyodide_components/main.mjs#L76
Prototype a testing-oriented, worker-based, message-style framework for Pyodide "components" based on custom elements. - pyodide-components/main.mjs at main · pauleveritt/pyodide-components
Avatar
tedpatrick 14/11/2022 18:55
How can we get these 6 (non-WIP) PRs closed? https://github.com/pyscript/pyscript/pulls
Home Page: https://pyscript.net Examples: https://pyscript.net/examples - Pull requests · pyscript/pyscript
Avatar
Avatar
tedpatrick
How can we get these 6 (non-WIP) PRs closed? https://github.com/pyscript/pyscript/pulls
Jeff Glass 14/11/2022 19:04
I think #928 (don't wait runtime.run()) is ready to merge, but I thought it would be good to give @antocuni a chance to review. From our conversations I know he approves in general (and he opened the original issue), but given how much he's been involved in it (and in lifecycle refactoring) I though it would be nice to have his eyes on the end result, if he wants to.
✅ 1
Avatar
Avatar
Jeff Glass
I think #928 (don't wait runtime.run()) is ready to merge, but I thought it would be good to give @antocuni a chance to review. From our conversations I know he approves in general (and he opened the original issue), but given how much he's been involved in it (and in lifecycle refactoring) I though it would be nice to have his eyes on the end result, if he wants to.
Sorry,I wanted to review it today but you siderailed, I'll try to look at it tomorrow
👍 1
Avatar
Avatar
Paul Everitt
Yes, here is where a runtime JS class is generated for each custom element: https://github.com/pauleveritt/pyodide-components/blob/main/src/pyodide_components/main.mjs#L26 You ask Python for the "registry", then for each item, you make an element https://github.com/pauleveritt/pyodide-components/blob/main/src/pyodide_components/main.mjs#L76
Cool. Glad I read it right. At first, when you mentioned pure Python [Custom Elements] Plugins I thought you meant also the CE creation part, etc.. (like, runtime injecting it into the DOM or some other forbidden magic 🙂 ). I do like the registry idea.
Avatar
Paul Everitt 14/11/2022 21:29
I just wrapped up (as in, 2 min ago) the pre-render part
21:29
So nodes can have HTML before the JS fires up
Avatar
You mean to support server side rendering ?
Avatar
Paul Everitt 14/11/2022 21:31
SSR and SSG
21:31
Might be a way to use a build step to ship with the component wheel
Avatar
Ok, yeah. Makes sense. It's an interesting topic. There's a lot of connections between the design of plugins and what they are allowed to do.... and execution in main thread vs worker vs supporting sever side tasks as well. I honestly don't think there's 1 right answer but many different patterns.
Avatar
Paul Everitt 14/11/2022 21:34
Yep, agreed
21:34
I'm not convinced anybody yet sees things the way I do 😀 But that makes it fun, exploring Python-based components
21:35
Most likely, PyScript will skip trying to move to a worker
Avatar
Avatar
Paul Everitt
Most likely, PyScript will skip trying to move to a worker
What do you mean? Like, likely delay supporting execution on a worked?
Avatar
Paul Everitt 14/11/2022 21:50
My guess is, if you have to choose DOM or worker...you all kind of like using the DOM
21:51
BTW I just talked to Calvin, any of you want to keynote Python Web Conf in March (online)? https://2023.pythonwebconf.com/ (edited)
The most in-depth conference for rising Python experts.
Avatar
tedpatrick 14/11/2022 21:52
Workers make sense for PyScript but it needs to be optional. <pyscript src="app.py"></py-script> <pyscript worker="one" src="worker.py"></py-script>
Avatar
Avatar
tedpatrick
Workers make sense for PyScript but it needs to be optional. <pyscript src="app.py"></py-script> <pyscript worker="one" src="worker.py"></py-script>
Paul Everitt 14/11/2022 21:55
Right. But it would mean no stitching things together with custom DOM events, no talking directly to nodes with node.innerText, etc.
Avatar
Avatar
Paul Everitt
Right. But it would mean no stitching things together with custom DOM events, no talking directly to nodes with node.innerText, etc.
tedpatrick 14/11/2022 21:59
The worker environment is event-oriented (addEventListener) so we can send lifecycle events to it or send events from worker to main to update the DOM.
Avatar
Paul Everitt 14/11/2022 21:59
Yep, exactly
22:00
It's message passing
22:00
It's been a fun way to work
22:01
But you'll need a little instructional language for DOM updates...kind of a "hypertext markup" style language 🙂
Avatar
tedpatrick 14/11/2022 22:01
I would hope there are cleaner apis for it to call workers... from pyscript import Worker worker = Worker("one") # talk to worker by id await worker.foo(1,2,3)
22:04
My take (ted's) is that if we choose worker-only, we make things harder for adoption. If we choose main thread only, we eliminate the worker benefits. So both.
Avatar
tedpatrick 14/11/2022 22:12
PyScript can be a framework that makes a particular type of app (for speed skating).
22:13
or PyScript can be a platform that provides several types of frameworks above.
22:13
I see the later as being better and providing a far longer life-span
22:14
In this case, Pauls framework might be worker only. 100% ok.
22:15
But Megaviz (100% made up) uses both worker and main.
22:17
As a platform, PyScript has just the base things to configure+load a runtime, get lifecycle started, denote worker/async/scope/instances/plugins/modules and start. (edited)
22:19
So once stable... March/April 2022... we will start building frameworks above PyScript.
22:20
Even the APIs we choose can be loaded as plugins.
Avatar
Paul Everitt 14/11/2022 22:35
@antocuni Here's a Vitest test running without a "browser": //@vitest-environment happy-dom import { it, expect } from "vitest"; import { loadPyodide } from "../src/pyodide_components/pyodide/pyodide.mjs"; it("should calculate some Python", async () => { const pyodide = await loadPyodide(); const result = await pyodide.runPythonAsync("1+1"); expect(result).to.equal(2); });
Avatar
Avatar
Paul Everitt
My guess is, if you have to choose DOM or worker...you all kind of like using the DOM
personally, I think that pyscript should be run on a separate worker by default, and allow running on the main thread but only if you explicitly opt-in. But I know that @tedpatrick is of a different opinion 🤷‍♂️
Avatar
Avatar
antocuni
personally, I think that pyscript should be run on a separate worker by default, and allow running on the main thread but only if you explicitly opt-in. But I know that @tedpatrick is of a different opinion 🤷‍♂️
tedpatrick 14/11/2022 22:59
We only disagree on the defaults! 🙂
Avatar
Avatar
tedpatrick
We only disagree on the defaults! 🙂
as usual 😂
Avatar
tedpatrick 14/11/2022 23:01
<py-script async src="async-src.py"></py-script> <py-script scope="foo" src="foo-src.py"></py-script> <py-script scope="bar" src="bar-src.py"></py-script> <py-script worker="one" src="worker-src.py"></py-script>
23:02
I feel we should focus on shipping async/scope/worker attributes on <py-script> next.
Avatar
yes, but I'm mostly worried about this: <py-script> i = 0 while i<10: print(i) # ooops, forgot i+=1 # the UI freezes and the user has to reload the page </py-script>
Avatar
tedpatrick 14/11/2022 23:02
problem solved. It didn't work. 🙂
Avatar
tedpatrick 14/11/2022 23:03
I can do that with JS today. What is the actual problem?
Avatar
that I want to make a better system than JS 😅
Avatar
tedpatrick 14/11/2022 23:07
Can we throw an error if python executes too long before webloop?
Avatar
basically, my point is that one of the user groups which we are targeting are "beginners" and "learners". More advanced users can easily learn how to tweak the settings, but our defaults should be tuned with beginners in mind, IMHO. And python-on-the-main-thread means: 1. that you can easily freeze the UI by mistake 2. that you don't have a good way to know what's going on (because e.g. print() will not be shown until the UI unfreezes, I think?) 3. you cannot run a debugger
💯 1
Avatar
Avatar
tedpatrick
Can we throw an error if python executes too long before webloop?
with enough hacking and by modifying the CPython source code, probably yes
23:10
ah well, not even completely
23:11
if you call e.g. numpy.operation_that_takes_very_long(), (i.e., something implemented in C) the UI freezes completely and we cannot do anything until it completes
Avatar
tedpatrick 14/11/2022 23:11
All I know is that 1 ex-sencha dev made a worker framework https://github.com/neomjs/neo and while cool, they have struggled with adoption as most ways of working are foreign. Even common js things break in the worker context.
Avatar
it probably depends on where you come from? If you are a JS developer, things in the worker are "broken" compared to your usual environmente. But if you are a Python developer it's probably the opposite: I imagine we will be able to run things in the worker "as usual", while on the main thread you will have many different broken corner cases
Avatar
tedpatrick 14/11/2022 23:16
Task 1: Add an element to the dom. Worker: uhhhh Main: js.document.body.innerHTML = "<div>Foo</div>"
23:16
My point is that even at it's simplest, it is hard.
23:17
I would prefer for frameworks above PyScript fail/succeed here.
Avatar
Worker: uhhhh
pydom.document.body.innerHTML = "<div>Foo</div> My point is that we need to have a Pythonic DOM API anyway. And our hypotetical pydom can have two different backends, one which updates the DOM with real JS calls (for the main thread) and one which can do it with message passing (for workers). And the user won't even notice
23:21
where pydom.document.body is something like this: class PyNode: ... def set_inner_html(self, val): self.postMessage("update", self.id, "innerHTML", val) innerHTML = property(get_inner_html, set_inner_html)
Avatar
Paul Everitt 15/11/2022 00:12
Imagine modern JS frameworks...not only do they want to run in a worker, they want to run on the server ("isomorphic")
Avatar
Avatar
antocuni
where pydom.document.body is something like this: class PyNode: ... def set_inner_html(self, val): self.postMessage("update", self.id, "innerHTML", val) innerHTML = property(get_inner_html, set_inner_html)
Paul Everitt 15/11/2022 00:14
That's basically what I'm doing My Python render method leads to the worker telling the main UI to idiomorph a node.
Prototype a testing-oriented, worker-based, message-style framework for Pyodide &quot;components&quot; based on custom elements. - pyodide-components/counter.py at main · pauleveritt/pyodid...
Avatar
Yesterday & Today BOT 15/11/2022 07:00
📆 Yesterday & Today - 11/15/2022 🧵
Avatar
Avatar
Paul Everitt
That's basically what I'm doing My Python render method leads to the worker telling the main UI to idiomorph a node.
I like that approach, although I'm not JS-savy enough to say whether there are potential problems with it. @ntoll this seems very related to what you are doing for micropython, so maybe you want to have a look. And also, if I read the code correctly, this is the relevant code which handles the messages on the main thread: https://github.com/pauleveritt/pyodide-components/blob/main/src/pyodide_components/main.mjs#L87-L106
👍 1
FabioRosado started a thread. 15/11/2022 10:43
Avatar
Avatar
antocuni
I like that approach, although I'm not JS-savy enough to say whether there are potential problems with it. @ntoll this seems very related to what you are doing for micropython, so maybe you want to have a look. And also, if I read the code correctly, this is the relevant code which handles the messages on the main thread: https://github.com/pauleveritt/pyodide-components/blob/main/src/pyodide_components/main.mjs#L87-L106
Paul Everitt 15/11/2022 11:57
Yes, it's a really simple dispatcher. Needs hardening (exception handling). It has a doppleganger in worker.mjs, which maps "messages" into pyodide calls. I've been curious to change that part into a two-way async generator, but I'm not smart enough.
Avatar
Avatar
Paul Everitt
Yes, it's a really simple dispatcher. Needs hardening (exception handling). It has a doppleganger in worker.mjs, which maps "messages" into pyodide calls. I've been curious to change that part into a two-way async generator, but I'm not smart enough.
Yeah, I like that a lot as well. My only concern is that it can be limiting in terms of what authors of plugins can achieve. If you need more than just return a piece of html inside your parent Custom Element (aka, manipulate the DOM, generate events, etc..) then it's limiting. My vote here, as mentioned on GH, it to start simple and add to it.
Avatar
tedpatrick 15/11/2022 21:34
Ok go forth and break things. I return Nov 29.
🎉 2
Avatar
Paul Everitt 15/11/2022 21:41
Enjoy @tedpatrick ... do you want a little breakage or a lot? 🙂
Avatar
tedpatrick 15/11/2022 21:41
Make it unrecognizable!
21:42
And add in <pyscript async worker scope> attributes! (edited)
Avatar
Paul Everitt 15/11/2022 21:46
We'll reimplement the interpreter in CSS...hardware accelerated, of course
🤩 1
Avatar
Jeff Glass 15/11/2022 21:49
<py-script version=“2.7” curly_braces=“true”>
😂 1
Avatar
Paul Everitt 15/11/2022 21:53
Oooooh
Avatar
tedpatrick 15/11/2022 21:54
Actually we have python version 1.09 and PHP to turn into a PyScript runtimes for 4/1
Avatar
Paul Everitt 15/11/2022 23:42
Is it OT here to discuss some of my testing discoveries? Want me to move it out to chat channel?
Avatar
Paul Everitt 16/11/2022 02:14
I'm doing Pyodide restore_state instead of making a new interpreter in each test https://youtu.be/jSaWbMwpiGs
Avatar
Yesterday & Today BOT 16/11/2022 07:00
📆 Yesterday & Today - 11/16/2022 🧵
Avatar
Avatar
Paul Everitt
Is it OT here to discuss some of my testing discoveries? Want me to move it out to chat channel?
I think it's perfectly in topic
antocuni started a thread. 16/11/2022 09:45
Avatar
My more-plugins branch is finally ready: https://github.com/pyscript/pyscript/pull/938
✅ 1
Avatar
Avatar
antocuni
My more-plugins branch is finally ready: https://github.com/pyscript/pyscript/pull/938
FabioRosado 16/11/2022 14:49
Awesome!
Avatar
me -> 🎂
🎉 5
17:15
Catch you lovely folk tomorrow. 👋
Avatar
Are [integration] tests passing for you all? A bunch of tests are failing for me locally, but all seem like local flakiness (timeout)
Avatar
Yesterday & Today BOT 17/11/2022 07:00
📆 Yesterday & Today - 11/17/2022 🧵
Avatar
Avatar
Fabio
Are [integration] tests passing for you all? A bunch of tests are failing for me locally, but all seem like local flakiness (timeout)
which ones?
antocuni started a thread. 17/11/2022 08:54
Avatar
FabioRosado 17/11/2022 13:48
@madhurt or anyone else that knows. Looking at pyconfig we are iterating over each parameter and calling validateParamInConfig if the parameter isnt in the config we just ignore it, should we throw an exception instead? 🤔
Avatar
Not all parameters are required, thus we can ignore some. Or maybe we can throw an error on some specific ones. I am AFK right now but can check and reply when I am back.
Avatar
FabioRosado 17/11/2022 14:24
Gotcha that makes sense thanks 😄
Avatar
OK... I seem to have been in meetings all day. Catch you lovelies tomorrow. 👋
👋 2
Avatar
Avatar
FabioRosado
@madhurt or anyone else that knows. Looking at pyconfig we are iterating over each parameter and calling validateParamInConfig if the parameter isnt in the config we just ignore it, should we throw an exception instead? 🤔
I think we need to rethink the logic now that we have plugins. Basically, the end result which I would like is: 1. if the user put a config settings which is unexpected (e.g. a typo), we should throw an error (or at least a warning, we can debate) 2. each plugin can define what are the settings that it expects and it supports. Implementing it is a bit tricky because the list of plugins itself is in the config, so we cannot do the validation at the same time as the parsing (because we don't know yet what is the config expected by the plugins). I admit I didn't think too much about it, but a possible solution is to remember which config settings have been read at least once. So the logic would be the following: 1. we parse the config 2. we read (and mark) all the core settings 3. we load the plugins 4. we call the Plugin.configure hook 5. each plugin is responsible to read and mark all its settings in its .configure() 6. after the hook, we check whether there are still settings which have never been read. If there are, we emit an error/warning (edited)
Avatar
Paul Everitt 17/11/2022 22:19
FWIW, Pyramid has a configuration system that learned from building a big system of pluggable components. It has some ideas which could help, at the expense of simplicity.
Avatar
Avatar
antocuni
I think we need to rethink the logic now that we have plugins. Basically, the end result which I would like is: 1. if the user put a config settings which is unexpected (e.g. a typo), we should throw an error (or at least a warning, we can debate) 2. each plugin can define what are the settings that it expects and it supports. Implementing it is a bit tricky because the list of plugins itself is in the config, so we cannot do the validation at the same time as the parsing (because we don't know yet what is the config expected by the plugins). I admit I didn't think too much about it, but a possible solution is to remember which config settings have been read at least once. So the logic would be the following: 1. we parse the config 2. we read (and mark) all the core settings 3. we load the plugins 4. we call the Plugin.configure hook 5. each plugin is responsible to read and mark all its settings in its .configure() 6. after the hook, we check whether there are still settings which have never been read. If there are, we emit an error/warning (edited)
Jeff Glass 17/11/2022 22:55
What if we separate plugin parameters into their own tables? Something like: <py-config> packages = ['numpy'] [plugins.py-terminal] auto = true [plugins.splashscreen] autoclose = false </py-config> I think the process is essentially still the same as you outlined, but except list of top-level keys in py-config is fixed (and includes the 'plugins' table).
22:56
Also helps avoid namespace collisions down the road when two plugins want to have parameters with the same name
22:57
afk, gotta walk the dog, but wanted to toss this into the pot 🦮
Avatar
yes that's more or less what I was proposing, without the plugins. part. E.g. for the splashscreen I've used: [splashscreen] autoclose = true
Avatar
Jeff Glass 17/11/2022 23:28
Makes sense - was just thinking having the settings in a plugins table lets us distinguish misspelled settings from misspelled packages Like if we parse py-config and it has a top-level key futch, is that a misspelling of [[fetch]] or trying to identify settings for a plugin called futch (or fitch)?
23:30
so the acceptable top level keys are always "fetch", "runtimes", "packages", "plugins", "schema_version" etc etc (edited)
23:30
Oh I see "plugins" is currently the list of plugins to load, sorry I missed that
23:31
I guess my suggestion would have been [plugin-settings.py-terminal] auto = true etc (edited)
23:35
Anyway, would agree that rethinking the plug-in settings logic is good
Avatar
Yesterday & Today BOT 18/11/2022 07:00
📆 Yesterday & Today - 11/18/2022 🧵
Avatar
Avatar
antocuni
I think we need to rethink the logic now that we have plugins. Basically, the end result which I would like is: 1. if the user put a config settings which is unexpected (e.g. a typo), we should throw an error (or at least a warning, we can debate) 2. each plugin can define what are the settings that it expects and it supports. Implementing it is a bit tricky because the list of plugins itself is in the config, so we cannot do the validation at the same time as the parsing (because we don't know yet what is the config expected by the plugins). I admit I didn't think too much about it, but a possible solution is to remember which config settings have been read at least once. So the logic would be the following: 1. we parse the config 2. we read (and mark) all the core settings 3. we load the plugins 4. we call the Plugin.configure hook 5. each plugin is responsible to read and mark all its settings in its .configure() 6. after the hook, we check whether there are still settings which have never been read. If there are, we emit an error/warning (edited)
FabioRosado 18/11/2022 09:09
This is a great idea and shouldn't be too hard to implement (famous last words 😄 ) Agreed that we should either error or emit a warning, specifically in the "i have a typo" case were we expect things to work but they would be silently ignored and probably break further down the line when we try to do something
Avatar
Avatar
Jeff Glass
Makes sense - was just thinking having the settings in a plugins table lets us distinguish misspelled settings from misspelled packages Like if we parse py-config and it has a top-level key futch, is that a misspelling of [[fetch]] or trying to identify settings for a plugin called futch (or fitch)?
I'm not sure to understand what's the difference between [plugin.splashscreen] and [splashscreen], apart that the user has to type more: we can easily detect whether there is an "unexpected section" in both cases.
09:16
specifically in the "i have a typo" case were we expect things to work but they would be silently ignored
yes exactly, this is precisely the case which I want to prevent. Settings which are silently ignored because of typos are a nightmare because you essentially don't have any way to debug them. About error vs warning, I usually prefer "hard errors", but in this case a warning might be more appropriate: specifically, I'm thinking about one use case in which during development you want to temporarily disable a plugin: in that case, having a hard error it's annoying because you would need to disable the plugin and comment out the settings
antocuni started a thread. 18/11/2022 10:08
Avatar
the list of plugins itself is in the config
Does that need to be the case. Why can't the user "register" them in code, in some way..?
Avatar
well, maybe... but then it must be very early else the hooks will simply not be called
12:51
remember, plugins != custom elements
12:52
in my view it is totally possible to register custom elements at any point in time, including by plugins and by user code
12:55
but it seems that this confusion happens a lot. Am I the only one who thinks about plugins are "collections of hooks" and about custom elements as one very specific subset of them? If so I am happy to discuss another terminology
👍 1
Avatar
Paul Everitt 18/11/2022 12:58
It's a good distinction to consider
12:58
Platform hooks are important and needed, but probably a different audience than "here's my video uploader widget"
Avatar
Paul Everitt 18/11/2022 13:25
You're right, one can be a subset of other...but if everybody had to write their Python packages as C extensions, there would be fewer. 😀
Avatar
Paul Everitt 18/11/2022 13:34
@antocuni Suggested way to defer thinking about this: stay on track for the lower-level extensibility. A higher-level one comes later, as part of a named framework. A higher-level is intentional: there might be multiple. And you're plugging into that thing, not to PyScript. I think this is Ted's view.
13:34
Different topic...what's the current thinking on the CLI project?
Avatar
Avatar
antocuni
I'm not sure to understand what's the difference between [plugin.splashscreen] and [splashscreen], apart that the user has to type more: we can easily detect whether there is an "unexpected section" in both cases.
Jeff Glass 18/11/2022 13:37
Well they're different data structures right? packages = ['numpy'] [splashscreen] autoclose = true [py-terminal] auto = true { "packages": [ "numpy" ], "py-terminal": { "auto": true }, "splashscreen": { "autoclose": true } } VS: packages = ['numpy'] [plugin.splashscreen] autoclose = true [plugin.py-terminal] auto = true { "packages": [ "numpy" ], "plugin": { "py-terminal": { "auto": true }, "splashscreen": { "autoclose": true } } }
Avatar
Jeff Glass 18/11/2022 13:47
With the later, there's no need to track/mark which of config.keys() have been used or not, each plugin gets its own object of settings.
Avatar
Avatar
Paul Everitt
@antocuni Suggested way to defer thinking about this: stay on track for the lower-level extensibility. A higher-level one comes later, as part of a named framework. A higher-level is intentional: there might be multiple. And you're plugging into that thing, not to PyScript. I think this is Ted's view.
that's exactly my view as well
Avatar
Avatar
Jeff Glass
With the later, there's no need to track/mark which of config.keys() have been used or not, each plugin gets its own object of settings.
well yes, you still need to track plugins.* sections: if someone writes [plugins.py-treminal] I want to make sure to inform them about the typo
Avatar
Jeff Glass 18/11/2022 13:49
Oh agreed
Avatar
@Paul Everitt I think that basically we all agree about the same things, we just need to sync on the terminology 😅
👍 1
Avatar
@ntoll I'm texting with a friend who is using micropython for the first time on an actual MCU and he's complaining because it's too different than the normal python and it lacks too many features 😂
Avatar
lol, opened discord again to see that the timing of the discussion above is great. Was looking into that yesterday and had a chat a couple of colleagues about it this morning as well 🙂 There are 2 sides of the coin: how do we allow plugin authors to declare their config requirements and how we allow users to set these configs in their own apps.
Avatar
Avatar
Jeff Glass
Well they're different data structures right? packages = ['numpy'] [splashscreen] autoclose = true [py-terminal] auto = true { "packages": [ "numpy" ], "py-terminal": { "auto": true }, "splashscreen": { "autoclose": true } } VS: packages = ['numpy'] [plugin.splashscreen] autoclose = true [plugin.py-terminal] auto = true { "packages": [ "numpy" ], "plugin": { "py-terminal": { "auto": true }, "splashscreen": { "autoclose": true } } }
Not sure I understand though... in all the examples, how are we declaring where to fetch plugins from?
Avatar
Avatar
antocuni
@ntoll I'm texting with a friend who is using micropython for the first time on an actual MCU and he's complaining because it's too different than the normal python and it lacks too many features 😂
Really..? Would love to hear where the bumps in the road are... 😄
Avatar
well, it's not specified so far. My rough idea is something like this: <py-config> plugins = ["foo", "bar", "http://..../baz.js"] </py-config> where foo and bar are downloaded from some kind of Official PyScript Plugin Store, and baz is downloaded from a custom URL
Avatar
Plugins, shmugins... we need to be careful we're talking about the same things here. 😉
Avatar
Avatar
antocuni
well, it's not specified so far. My rough idea is something like this: <py-config> plugins = ["foo", "bar", "http://..../baz.js"] </py-config> where foo and bar are downloaded from some kind of Official PyScript Plugin Store, and baz is downloaded from a custom URL
That's how I have it in my branch
15:56
(that I actually got working yesterday)
Avatar
Avatar
Fabio
That's how I have it in my branch
so we agree? 🤔
Avatar
That's an easy one to agree lol
15:57
I don't think we'll agree on everything though. Pretty sure we are not 😄 😄
Avatar
Avatar
ntoll
Really..? Would love to hear where the bumps in the road are... 😄
for example he's complaining that collections.deque doesn't support indexing but only push and pop
Avatar
Hmmm.... 🤣 so why not just use a list..? It's all about tradeoffs right..?
15:59
But I guess this proves your (MicroPython isn't Python) point. 😛
Avatar
Avatar
ntoll
Hmmm.... 🤣 so why not just use a list..? It's all about tradeoffs right..?
He needs a circular buffer and the obvious solution of append/pop from a list fails because the memory becomes fragmented and he gets MemoryError. So he wanted to manually implement a deque using a fixed-size list, and I suggested using collection.deque which seemed perfect for his use case
Avatar
Hmmm... OK... but what exactly is he trying to achieve..?
Avatar
but yes, let's not dig inside that conversation again. I just found it funny/ironic that he wrote this to me now 😅
🤣 1
Avatar
(and on what board?)
16:02
Yeah, it is pretty funny.
Avatar
Avatar
ntoll
Hmmm... OK... but what exactly is he trying to achieve..?
no idea, but note that he's an experienced embedded developer with tons of experience with C. But I think that his boss wanted him to experiment with upython
Avatar
Avatar
antocuni
so we agree? 🤔
To be more specific on what we'll probably disagree is on Python plugins hooking into the lifecycle events. I've added support for that in branch as well. The events that happen after the interpreter is ready are easy... but we need to decide whether to not support the ones that happen before that. The 2 choices we have is to not support them at all (and maybe provide ways to lazy access the objets we'd be passing in these hooks) or to lazy fire then when the Plugin is ready.
Avatar
Avatar
ntoll
Hmmm... OK... but what exactly is he trying to achieve..?
quoting him:
The board is custom-designed, but the mcu is the very same of a supported board (I cannot recall which one). Not sure about how much I can disclose about the device details, but basically it is a wearable health monitor device.
Avatar
Avatar
Fabio
To be more specific on what we'll probably disagree is on Python plugins hooking into the lifecycle events. I've added support for that in branch as well. The events that happen after the interpreter is ready are easy... but we need to decide whether to not support the ones that happen before that. The 2 choices we have is to not support them at all (and maybe provide ways to lazy access the objets we'd be passing in these hooks) or to lazy fire then when the Plugin is ready.
my gut feeling is that we should not support them. If we do, the net result is that at the startup of the python plugin you fire 3-4 hooks immediately and at the same time. What's the point of firing the beforeSetup hook if you call it after the setup? 😅 It's just confusing IMHO
16:14
unrelated: I stumbled upon this tweet; the good news is that with the new py-terminal plugin this will be solved automatically https://twitter.com/bjkeefe/status/1589685266943422464
The new REPL from @pyscript_dev doesn't seem to work that well. Or maybe it's just me. See attached.
👍 1
Avatar
Avatar
antocuni
my gut feeling is that we should not support them. If we do, the net result is that at the startup of the python plugin you fire 3-4 hooks immediately and at the same time. What's the point of firing the beforeSetup hook if you call it after the setup? 😅 It's just confusing IMHO
Imho it'll be confusing either way. If we don't support it and clarify in the docs why, it'll be confusing because "why Python Plugins don't support this event?" "How can I have the result I need in a different way?" vs we support it and clarify in the docs that these events are fired as soon as they happen OR the interpreter that runs python is ready. It'll be confusing because "Why this event being fired late?" I'd prefer to treat Plugin authors as responsible adults and give something to them rather nothing.
Avatar
Avatar
antocuni
no idea, but note that he's an experienced embedded developer with tons of experience with C. But I think that his boss wanted him to experiment with upython
Well, generally the stages of a C developer moving to MicroPython are: 1. Dammit, this isn't C, everything is wrong and I don't like it. 2. Oh, that's cool. 3. Wow, that thing I was expecting to take a week over only took a couple of hours. 4. OK... I see how MicroPython can help. 🙂
16:28
But it's all about trade-offs 😉
Avatar
I still don't understand. The point of hooks/events is to run code at a certain point in time. If we fire 4 events all at the same time, they become indistinguishable: i.e. why would a python plugin use the hypotetical beforeAAA, beforeBBB and beforeCCC hooks instead of afterDDD since they will be fired all together anyway?
Avatar
Avatar
ntoll
Well, generally the stages of a C developer moving to MicroPython are: 1. Dammit, this isn't C, everything is wrong and I don't like it. 2. Oh, that's cool. 3. Wow, that thing I was expecting to take a week over only took a couple of hours. 4. OK... I see how MicroPython can help. 🙂
yes, I think he's at stage 1😂 (edited)
🤣 1
Avatar
Avatar
antocuni
I still don't understand. The point of hooks/events is to run code at a certain point in time. If we fire 4 events all at the same time, they become indistinguishable: i.e. why would a python plugin use the hypotetical beforeAAA, beforeBBB and beforeCCC hooks instead of afterDDD since they will be fired all together anyway?
I disagree with your definition... "at a certain point in time". Rather I'd say, when a "certain condition is met". In time, that may happen all at once, or separately... but I'm more interested in the status/condition that's being signalled (e.g. the interpreter is ready)
Avatar
Avatar
antocuni
yes, I think he's at stage 1😂 (edited)
Give him time. 😄
Avatar
Avatar
ntoll
I disagree with your definition... "at a certain point in time". Rather I'd say, when a "certain condition is met". In time, that may happen all at once, or separately... but I'm more interested in the status/condition that's being signalled (e.g. the interpreter is ready)
yes exactly. Basically, in my design I want certain invariant to be true: e.g. that when I call beforeExecute I am certain that all beforeSetup hooks were called, because that's the only way to ensure that the setup has been done. Else, we are just encouraging a mess
Avatar
Well, in MicroPyScript I use a Promise.all([list of awaiting events]).then( dispatch "SetupComplete") (pseudo code) to achieve this end.
Avatar
Avatar
ntoll
I disagree with your definition... "at a certain point in time". Rather I'd say, when a "certain condition is met". In time, that may happen all at once, or separately... but I'm more interested in the status/condition that's being signalled (e.g. the interpreter is ready)
Yeah, I agree with @ntoll . Hooks are there to notify a certain event/condition has happened. If I'm not ready to receive that notification I still want to receive it whenever I am ready.
Avatar
umm.... see the way I handle copying files onto the FS
Avatar
Avatar
ntoll
Well, in MicroPyScript I use a Promise.all([list of awaiting events]).then( dispatch "SetupComplete") (pseudo code) to achieve this end.
yes, exactly. And Fabio is proposing to call setupComplete even after that promise has been awaited, if I understand it correctly
Avatar
Avatar
Fabio
Yeah, I agree with @ntoll . Hooks are there to notify a certain event/condition has happened. If I'm not ready to receive that notification I still want to receive it whenever I am ready.
not in my design. Hooks are not events, are sync points
Avatar
Depending on the files to copy, who knows when they'll all be done. But the Promise.all(foo) ensures that a single event is dispatched when they all are finished.
Avatar
feel free to change the design 😅
Avatar
OK.... I need to get my head out of MicroPyScript and into PyScript proper. 😉
Avatar
Avatar
ntoll
Depending on the files to copy, who knows when they'll all be done. But the Promise.all(foo) ensures that a single event is dispatched when they all are finished.
I think that as usual we use too many words and too few code. I'm sure that if we looked at concrete code examples we would all agree very quickly 😅
➕ 1
Avatar
Avatar
antocuni
feel free to change the design 😅
Yeah, I think we mean different things. Fwiw, plugins are not sync'ing anything.. they are receiving objects during specific events during the lifecycle
16:40
With that said.. , yeah, it'll probably be better to have the discussion on GH (on a PR)
Avatar
Avatar
Fabio
Yeah, I think we mean different things. Fwiw, plugins are not sync'ing anything.. they are receiving objects during specific events during the lifecycle
of course they are syncing 😅. When I call the afterSetup hook/event it's because I'm sure that the virtualenv setup has been completed. It's a very explicit sync point
Avatar
I think it's a terminology problem. Help me understand. What do you mean with syncing In my mind, synchronization == 2 ways (either 2 things are aligned or communicating with each other). Events == 1 way (I am notified of an event). Plugins don't send anything back and don't synchronize with anything.. they just receive events in time (via hooks) and do something with it.
Avatar
by syncing I mean that when I fire the CCC hook I am sure that all the plugins have completed the BBB hook (i.e., basically the same logic which @ntoll mentioned in its Promise.all() code above) (edited)
16:50
and, to give a more concrete example: there is a beforeSetup hook which can be used e.g. to implement [[fetch]] files = [...] and packages = [...], i.e. to make sure that the python virtualenv is ready and complete. Then there is a beforeExecute hook which has the invariant that the setup phase has been completed, i.e. I'm sure that I can import all the python packages which I expect
Avatar
Exactly... this ⬆️
Avatar
You are deciding what a plugin author would do with that event and by doing so you are limiting what they can do. Let me give you an example. I want to write a plugin that is a debugging too that allows me to see if any other plugin borked the config object. So I want to subscribe to beforeSetup and afterSetup and do a diff and raise an error /warning if I see any weird stuff. There's no reason why I need to do this synchronously... if we store the config the moment we passed it to beforeSetup hooks and lazy fire the event when the Python Plugins are ready we allow the authors of plugins like this to do something. Rather than saying, you have no future, go write TypeScript
Avatar
There's no reason why I need to do this synchronously
I'm very confused. If you don't sync, then it might happen that a plugin1.afterSetup is called before plugin2.beforeSetup, and this completely breaks your use case.
Avatar
FabioRosado 18/11/2022 16:57
Not sure if I am missing something but the benefit (and the flaw) of creating custom events is the possibility to have these fire-and-forget although in this case we are gathering them and awaiting so they should behave in a similar way as the callbacks implemented by Antonio right? 🤔
16:58
Oh from what Fabio mentioned the idea is having these fire and forget events then
👆 1
Avatar
Avatar
antocuni
There's no reason why I need to do this synchronously
I'm very confused. If you don't sync, then it might happen that a plugin1.afterSetup is called before plugin2.beforeSetup, and this completely breaks your use case.
Lazy events would still be trigger in order.
Avatar
well, suppose to have a beforePythonIsReady event: you cannot call it in python because this is obviously happening after the interpreter is ready
Avatar
FabioRosado 18/11/2022 17:04
This will probably take the chat elsewhere so ignore it if it does. Would a notification system kind of thing help here? If we don’t use custom events
Avatar
Avatar
antocuni
well, suppose to have a beforePythonIsReady event: you cannot call it in python because this is obviously happening after the interpreter is ready
We are seeing it in 2 different ways. The way I see it, events capture the state of specific parts of PyScript during the lifecycle. Yes, if you goal is to modify the config beforePytonIsReady then, you have no luck in a Python plugin but if your goal is to just read the state of things at that point in time, then it's still useful to have that event be passed to a Python plugin, so you can know the state at that point in time anyway.
Avatar
OK... I need to push off for the weekend for dad taxi reasons. Catch you wonderful folk on Monday. These chats are always so stimulating.
👋 2
Avatar
Avatar
ntoll
OK... I need to push off for the weekend for dad taxi reasons. Catch you wonderful folk on Monday. These chats are always so stimulating.
Have the most amazing weekend! Also, turn up the volume up and be the cool taxi driver (or the most embarrassing dad! lol )
Avatar
FabioRosado 18/11/2022 17:06
Have a great weekend
Avatar
We've all been there. 😉
Avatar
Paul Everitt 20/11/2022 12:26
I think I brought this up before, forgot the answer: what naming convention for pyscript packages? I need a PyPI package name for the collective package. Do we encourage pyscript-collective ? If that's too long, ps-collective ?
Avatar
Paul Everitt 20/11/2022 14:33
We should be careful about publishing docs for non-stable versions IMO
👆 1
Avatar
Avatar
Paul Everitt
We should be careful about publishing docs for non-stable versions IMO
Jeff Glass 20/11/2022 14:43
Agreed - especially as we make breaking changes (which is good!), folks are trying to use new syntax that work yet/anymore, and getting confused
Avatar
FabioRosado 20/11/2022 14:46
Yeah agreed, I opened up https://github.com/pyscript/pyscript/issues/937 last week so we can tackle this 😄
👍 2
Avatar
tedpatrick 20/11/2022 14:56
Take vacation
🤿 6
❤️ 1
18:20
In case you didn&#39;t see it in the OPFS discussion, the next SQLite non-patch release will contain a browser implementation, and that will include an Origin Private File System VFS for persis...
18:25
Actually, I shall shut up: it's already out https://www.sqlite.org/draft/releaselog/current.html
👍 2
Avatar
Avatar
Paul Everitt
We should be careful about publishing docs for non-stable versions IMO
yes, and we should stop using /latest in all our docs and official examples: people will just copy&paste the <script> tag and the result is that we are involuntary encouraging to publish pyscript apps which will break after 30 days
Avatar
Avatar
tedpatrick
Take vacation
awesome 😍. Enjoy your vacation 🌊
Avatar
Paul Everitt 20/11/2022 18:29
@antocuni Agreed, people probably need to "pin" their pyscript version by us encouraging use of the version in the URL
Avatar
yes. AFAIK, we don't even mention anywhere that things like /releases/2022.09.1/.... exists. Personally, I wanted to use it at some point and I couldn't find the exact url in the docs 😅
18:32
also personally, I'd like to be even more extreme and kill /latest altogether. I cannot think of any reasonable use case in which you want to use it (unlike /unstable, which is useful if you want to use a feature which hasn't been released yet)
Avatar
Paul Everitt 20/11/2022 18:40
+1 on all of that. At some point latest will be feasible, but not soon.
Avatar
Jeff Glass 20/11/2022 22:58
Agreed. Since /latest been widespread for a couple versions since versioning was first announced, maybe need to find a way to deprecate it. A warning banner at the top of the page saying you should be linking to a pinned release? Not sure exactly how that would work from a deployment standpoint, but could even be something that gets done "manually" (changed, rebuilt, uploaded to /latest resource on AWS)
Avatar
Yesterday & Today BOT 21/11/2022 07:00
📆 Yesterday & Today - 11/21/2022 🧵
Avatar
Avatar
Jeff Glass
Agreed. Since /latest been widespread for a couple versions since versioning was first announced, maybe need to find a way to deprecate it. A warning banner at the top of the page saying you should be linking to a pinned release? Not sure exactly how that would work from a deployment standpoint, but could even be something that gets done "manually" (changed, rebuilt, uploaded to /latest resource on AWS)
or maybe even freeze /latest to the current release. IMHO it's better to keep apps working+warning than broken+warning
antocuni started a thread. 21/11/2022 08:54
Avatar
@Leonard Wolf could you add @Martin as a maintainer please?
11:05
(or anyone else who has the power to do so)
Avatar
for the people who are doing github work currently we need to add a backlog tag to our valid issues, otherwise they'll be automatically close by the bot! 🤖
Avatar
Avatar
antocuni
@Leonard Wolf could you add @Martin as a maintainer please?
Leonard Wolf 21/11/2022 12:44
Added
Avatar
Avatar
3l3ktr4
for the people who are doing github work currently we need to add a backlog tag to our valid issues, otherwise they'll be automatically close by the bot! 🤖
I'm confused. We have a bot which automatically closes all the issue which are not marked a backlog? 🤔
13:30
@Martin you should be able to write now! Thanks @Leonard Wolf
✨ 1
Avatar
@antocuni esattamente can't really link to the code cause idk where it is but this is what we agreed on a couple of weeks back if they're stale for n days(60?) they're closed
Avatar
Avatar
Leonard Wolf
Added
Thank you!
✨ 1
Avatar
Avatar
3l3ktr4
@antocuni esattamente can't really link to the code cause idk where it is but this is what we agreed on a couple of weeks back if they're stale for n days(60?) they're closed
so we have a bot which randomly closes issues and we don't know where it lives... excellent 😂 I don't remember that we discussed this but ok, good to know
Avatar
Avatar
antocuni
so we have a bot which randomly closes issues and we don't know where it lives... excellent 😂 I don't remember that we discussed this but ok, good to know
Jeff Glass 21/11/2022 15:53
🙏 2
Avatar
Avatar
Jeff Glass
Agreed. Since /latest been widespread for a couple versions since versioning was first announced, maybe need to find a way to deprecate it. A warning banner at the top of the page saying you should be linking to a pinned release? Not sure exactly how that would work from a deployment standpoint, but could even be something that gets done "manually" (changed, rebuilt, uploaded to /latest resource on AWS)
+1 on that. Also, there's a lot of people still using alpha . (Just adding that as a data point)
Avatar
Btw, forgot to mention. Was in a call with Brett Cannon this morning and some folks from the VS code team and they demoed debugging working in VS Code in the browser (with their WASI implementation) /cc @antocuni @ntoll (edited)
Avatar
Avatar
Fabio
Btw, forgot to mention. Was in a call with Brett Cannon this morning and some folks from the VS code team and they demoed debugging working in VS Code in the browser (with their WASI implementation) /cc @antocuni @ntoll (edited)
do you know whether they run python in a webworker or in the mainthread?
Avatar
Avatar
antocuni
do you know whether they run python in a webworker or in the mainthread?
yes yes, webworker (edited)
Avatar
ok 👍
Avatar
I wonder if they're doing the same trick Katie used in her talk.
Avatar
it's very likely that they are doing a similar trick
21:35
the point is that you want to emulate a blocking syscall: Katie used the trick to emulate a blocking sys.stdin.read(). I didn't see the VS code thing, but I guess that their debugging work by putting some blocking call inside a trace function installed using sys.settrace
Avatar
An extension allows to run Python code in a Web browser using WebAssembly technology - vscode-python-web-wasm/pythonWasmWorker.ts at main · microsoft/vscode-python-web-wasm
Avatar
oh my god, this is a terrible hack 😅. They are driving pdb by faking user input. I'm a bit surprised, I assumed they would use bdb which is made exactly for this (basically: bdb implements the core functionality, and pdb adds a terminal-based UI on top of it)
22:33
according to the code above, the pdb stdin is read from /$debug/input, which seems to be implemented here: https://github.com/microsoft/vscode-python-web-wasm/blob/78bd69365bbf53957ca16f9b1ab87fba5dfe34b3/src/common/debugFileSystem.ts#L186-L188 but then it forwards to apiClient.byteSource.read(), which is most likely the blocking call
22:34
but then I can't easily go further because apiClient is imported from another package, so I don't know how it's implemented
Avatar
Yesterday & Today BOT 22/11/2022 07:00
📆 Yesterday & Today - 11/22/2022 🧵
Avatar
Pondering Points Pertaining to PyScript Platform Plugins G'day folks! I realise that this is a little late to the party, but in another universe I worked with both the NetBeans and Eclipse plugin frameworks, and then built a simple one called Envisage. Anyhoo... I thought I'd jot down anything that might be useful. As usual, apologies if this has already been covered!!! 🙂 I'll just get things down as bullet-points for now... this is a brain dump so it might be a bit scattered....
  • Plugins are the vehicle by which we build extensible applications. That may sound obvious but helped me to understand the bigger picture 🙂
  • In Envisage, Plugins have a very simple job
a) React to lifecycle events b) Advertise the ways in which they can be extended (we called them "extension points" c) Contribute to other plugin's extension points d) Advertise any objects/functions that might be useful to others. (we called these "services" before the web world stole the name 🙂 )
  • Envisage (the platform) was simply a combination of Plugin Manager, an Extension Point Registry and a Service Registry. It had nothing else... no application-specific code. The platform was tiny and apps were truly just a collection of plugins.
  • We even had a core plugin hat offered extension points for service offers (that might have been a step-too-far 🙂 )
  • Plugins don't contribute to the platform - just to other plugins. This is the key idea - this is what I mean by extensible applications. It is not limited by the platform writer.
  • Lifecycle events always had "-ing" and "-ed" versions... e.g. "starting", "started" (or as we have, "before" and "after").
  • Lazy loading was paramount... everything was loaded on demand... Plugins only ever directly imported from envisage (and traits).
  • The platform allowed dynamic addition and removal of plugins and allowed plugins to react to the associated contributions appearing and disappearing.
(edited)
🙏 2
09:15
Ok, that's all I can think of for now... I just wanted to get it written down 🙂
Avatar
Avatar
antocuni
according to the code above, the pdb stdin is read from /$debug/input, which seems to be implemented here: https://github.com/microsoft/vscode-python-web-wasm/blob/78bd69365bbf53957ca16f9b1ab87fba5dfe34b3/src/common/debugFileSystem.ts#L186-L188 but then it forwards to apiClient.byteSource.read(), which is most likely the blocking call
So, apiClient.byteSource.read() returns a promise (see: https://github.com/microsoft/vscode-python-web-wasm/blob/78bd69365bbf53957ca16f9b1ab87fba5dfe34b3/src/common/debugCharacterDeviceDriver.ts#L45) I'm not at all clear what the const disposable does to cause waiting for user input. I have no idea what the .dispose() method does, for instance (it's not something in the "standard" Promises API AFAICT)
An extension allows to run Python code in a Web browser using WebAssembly technology - vscode-python-web-wasm/debugCharacterDeviceDriver.ts at 78bd69365bbf53957ca16f9b1ab87fba5dfe34b3 · microsoft/v...
Avatar
note this line: import { CharacterDeviceDriver, FileDescriptorDescription, RAL as SyncRal } from '@vscode/sync-api-service'; I don't know exactly how it's implemented, but it seems to be explicitly a sync api
Avatar
Yeah.... the clue is in the name. 😄
09:39
This all feels a bit mysterious, magic and hacky... and that makes me feel uncomfortable.
Avatar
well, often the distinction between magic and complex is just that we don't know the topic deep enough
Avatar
Quite... it's a matter of perspective.
Avatar
obligatory quote
Avatar
Yeah, but I'd add... if that technology becomes ubiquitous, then folks find it boring (rather than magical). 😛
09:56
(it just becomes part of the fabric of our culture)
09:57
Anyway... brb... need to drop a friend at the local train station. 🚆
antocuni started a thread. 22/11/2022 11:15
Avatar
[[runtimes]] for our docs
@FabioRosado I think that in the last meeting we decided to rename runtime into interpreter. Probably at some point we should do the renaming, although probably it's better to wait for the next release. (And personally, I'd also like to make it a single entry and not a list... we support only a single interpreter anyway).
11:38
MicroPython chats on their discord server WRT the webassembly port
@ntoll is the discord server public?
Avatar
Yup... it's called "micropython".
Avatar
Avatar
antocuni
[[runtimes]] for our docs
@FabioRosado I think that in the last meeting we decided to rename runtime into interpreter. Probably at some point we should do the renaming, although probably it's better to wait for the next release. (And personally, I'd also like to make it a single entry and not a list... we support only a single interpreter anyway).
+1 on interpreter not runtime.
Avatar
Avatar
antocuni
[[runtimes]] for our docs
@FabioRosado I think that in the last meeting we decided to rename runtime into interpreter. Probably at some point we should do the renaming, although probably it's better to wait for the next release. (And personally, I'd also like to make it a single entry and not a list... we support only a single interpreter anyway).
FabioRosado 22/11/2022 12:10
Oh yeah that's a great idea 😄 I'm happy to tackle that once the release is out 😄
Avatar
Avatar
ntoll
Oh yeah... here's the recording of the live stream from the podcast: https://www.youtube.com/watch?v=ABVn6uMG1OI
FabioRosado 22/11/2022 12:33
Oh dang I forgot that Talk Python to Me is being recorded live! Otherwise I would be there yesterday, but thanks for sharing will watch 😄
👍 1
Avatar
Avatar
ntoll
Oh yeah... here's the recording of the live stream from the podcast: https://www.youtube.com/watch?v=ABVn6uMG1OI
this is so coool
12:42
seems like a chill nice podcast 🙂
Avatar
It is. 🙂
Avatar
Paul Everitt 22/11/2022 12:45
I wasn't able to make it either, recording a "what's new" video and running behind
Avatar
TIL: when doing a PR review, you can attach a comment to a range of lines, instead of just one. You can click on the first line of the diff, shift-click on the last, end then click on the + icon as you usually do to insert a comment
Avatar
Avatar
antocuni
TIL: when doing a PR review, you can attach a comment to a range of lines, instead of just one. You can click on the first line of the diff, shift-click on the last, end then click on the + icon as you usually do to insert a comment
Yeah, love that feature. 🙂
15:44
Ciao folks! I'll be adding test and context to the initial plugin PR (https://github.com/pyscript/pyscript/pull/961) but I think it's ok enough for early comments. Keep in mind that it's very simple and designed this way on purpose (the common ground from @Jeff Glass comments that also made @antocuni and I agree on something 😄 ), in order a small API to learn a bit more in this iteration and add more in the following release.
Goal of this PR is to add support for a very simple [and small] Python Plugins API so that PyScript users can implement Plugins in pure Python. The topic of Python Plugins opens up for a lot of que...
🙌 1
✅ 1
Avatar
I'll be adding test
this is scary 😅
😂 1
Avatar
tedpatrick 22/11/2022 17:52
Achievement unlocked. A 7ft reef shark got close, so I touched its tail, startled it. 🦈 🤿 (edited)
😲 5
Avatar
Avatar
tedpatrick
Achievement unlocked. A 7ft reef shark got close, so I touched its tail, startled it. 🦈 🤿 (edited)
😀 2
Avatar
@Fabio I reviewed you PR. 15 comments, now it's time to run away 😂😂
😂 2
🫠 1
Avatar
Avatar
antocuni
@Fabio I reviewed you PR. 15 comments, now it's time to run away 😂😂
FabioRosado 22/11/2022 21:19
Question is… what pizza toppings are you using for Fabio’s pizza? 😛
Avatar
Avatar
FabioRosado
Question is… what pizza toppings are you using for Fabio’s pizza? 😛
🍍
😂 3
antocuni started a thread. 22/11/2022 22:47
Avatar
Yesterday & Today BOT 23/11/2022 07:00
📆 Yesterday & Today - 11/23/2022 🧵
antocuni started a thread. 23/11/2022 08:56
Avatar
FabioRosado 23/11/2022 17:28
Interesting, running the tests with pytest and running them with make tests parallel throw different failures (Fabio noticed this last week (was it last week or this one?)) (edited)
👆 1
Avatar
FabioRosado 23/11/2022 19:23
Just discovered that CI doesn't run on changes made outside pyscriptjs (should it), and my PR to restyle the examples broke some tests, this PR fixes them https://github.com/pyscript/pyscript/pull/978 sorry y'all
Avatar
Jeff Glass 23/11/2022 20:52
For those who are off for American Thanksgiving this weekend - I hope you all have a wonderful warm weekend full of Turkey and cheer! 🦃 (For those who aren't celebrating that particular holiday - Turkey and cheer for y'all too!)
🦃 4
❤️ 2
Avatar
Avatar
FabioRosado
Interesting, running the tests with pytest and running them with make tests parallel throw different failures (Fabio noticed this last week (was it last week or this one?)) (edited)
make tests-parallel just run pytest -n under the hood. -n activates the pytest-xdist plugin, which is responsible for the actual parallelization So, it's not pytest vs make, it's pytest vs pytest+xdist. According to my experience, it's very likely that it's a bug in our testsuite (e.g., a common mistake is to have multiple tests trying to write/read to the same file in parallel, so you have a race condition). What is the exact error?
Avatar
Avatar
FabioRosado
Just discovered that CI doesn't run on changes made outside pyscriptjs (should it), and my PR to restyle the examples broke some tests, this PR fixes them https://github.com/pyscript/pyscript/pull/978 sorry y'all
I hate those rules; it's always like this, they seem very sensible at the beginning and then you inevitably end up in cases like this. My personal opinion: let's kill the rule and make sure that the tests runs on every commit
Avatar
Paul Everitt 23/11/2022 22:54
For Thanksgiving I'm going to wake up and push the "Get PyScript team to embrace more joyful testing" boulder up the hill.
22:56
I know, I know, it's getting kind of creepy. But I can't stop myself.
22:56
"I mean this with love" said every stalker ever.
Avatar
I already write my tests with joy, but very happy to be even more joyful 🙂
😀 1
Avatar
tedpatrick 24/11/2022 01:36
🦃++
Avatar
Happy Thanksgiving to everyone who celebrates! Just a heads up, I've addressed many comments in the PR and will be address last ones + adding docstrings and a few more tests tomorrow morning.
🦃 5
Avatar
Yesterday & Today BOT 24/11/2022 07:00
📆 Yesterday & Today - 11/24/2022 🧵
Avatar
Avatar
Fabio
Happy Thanksgiving to everyone who celebrates! Just a heads up, I've addressed many comments in the PR and will be address last ones + adding docstrings and a few more tests tomorrow morning.
FabioRosado 24/11/2022 10:09
Great, I think that's the only thing left before we can merge the PR right? If I am not mistake we are just waiting for this PR to get in to do a release
FabioRosado started a thread. 24/11/2022 10:16
Avatar
thank to @pmp-p I just discovered that there is an entire discord dedicated to WASM, with a dedicated python channel: https://discord.gg/webassembly
Invite to join a server
✨ 1
Avatar
Paul Everitt 24/11/2022 14:57
Woah
14:58
The python channel has a LOT
Avatar
I thought you all knew...!
15:09
There's also a webassembly channel on the MicroPython discord server: https://discord.gg/zfXYVTJQ
👀 1
Avatar
when will the next Community call be?
Avatar
Good question. That's a Ted thing? I thought it was every two weeks (i.e. it'll be next Wednesday)
Avatar
I can't see it scheduled in our calendar
Avatar
Me neither.
15:49
The last one was created by Ted. We also mentioned we may use discord and so on to host the meeting, rather than Anaconda's Zoom subscription.
Avatar
tedpatrick 24/11/2022 17:39
Goal is Monthly so mid December
Avatar
Avatar
FabioRosado
Great, I think that's the only thing left before we can merge the PR right? If I am not mistake we are just waiting for this PR to get in to do a release
@FabioRosado I'm wrapping up the PR and about to set it for real review. I'll be out for the rest of the days and will be in and out tomorrow. I've addressed the PR comments I think are critical, everything else, imho, can be fixed in follow up PR and are not critical to release but that will depend on the comments on the PR. If there are comments it'd be great if you or someone else could address the last comments (if any).
Avatar
FabioRosado 24/11/2022 18:24
Sounds good I can address them if no one else will and then release tomorrow 😄
👍 2
🎉 2
Avatar
Hey, welcome back @tedpatrick - now go eat lots of turkey 🦃
😂 1
✅ 1
Avatar
Avatar
FabioRosado
Sounds good I can address them if no one else will and then release tomorrow 😄
Sounds great! I just asked for another round of reviews. Tests seem to be breaking on CI, not sure if it's related to my changes (doesn't seem so but honestly I'm rushing while cooking lol). Could you take a look at that as well? Thank you!!
Avatar
FabioRosado 24/11/2022 19:52
Seems like it’s complaining about naming when importing I’ll take a look first thing in the morning tomorrow 😄
Avatar
Jeff Glass 24/11/2022 20:14
@FabioRosado I have a little time this afternoon, I can take a quick look as well if it's helpful?
Avatar
Avatar
Jeff Glass
@FabioRosado I have a little time this afternoon, I can take a quick look as well if it's helpful?
FabioRosado 24/11/2022 20:29
Sure thing but feel free to enjoy your turkey day 😄
Avatar
One sec.. Just fixed it locally and pushed.
20:33
Glad the bread is taking longer to cook than expected LOL
20:38
Ok, think I fixed everything locally (py tests and linter) and just pushed 🤞
✅ 1
Avatar
Jeff Glass 24/11/2022 20:47
Something goofy is happening with the integration tests, possibly something's async that should be blocking? Fetching isn't consistently completing before the tests start (edited)
Avatar
Mmmm... right. grrr I don't think I change anything related the tests that are failing.
20:54
At least not related to fetch.
Avatar
Jeff Glass 24/11/2022 20:54
Agreed, but there's 23 failing integration tests in CI 😶
20:55
For example, locally paths_from_pacakges fails with this (as written) as the pyscript: import js from pkg.a import x js.console.log(x) but this passes import os import js from pkg.a import x js.console.log(x)
20:55
Or other variants of "do a little something before importing pkg" (edited)
Avatar
Yeah, odd Will try check when I'm back later. In the meantime I'm out for now
Avatar
Jeff Glass 24/11/2022 20:56
No sweat! Sure it's something we can get sorted. Thanks for banging out the py-unit fix!
Avatar
FabioRosado 24/11/2022 20:56
Maybe some weird thing with xdist like Antonio mentioned
Avatar
Jeff Glass 24/11/2022 21:03
Oh it's (at least partly) a deprecation issue with pyodide (edited)
21:04
pyodide.create_proxy is now pyodide.ffi.create_proxy in v21, and the presence of Pyodide's deprecation warning is throwing off the tests
21:07
Just pushed that small change, let's see where the CI lands
Avatar
Jeff Glass 24/11/2022 21:17
Ah, well that broke Fabio P's new mock(), since pyodide needs to be mocked as a package so pyodide.ffi can be imported... pushed that change too
21:18
And now I'm out 🦃 - sorry if I'm stepping on any toes here, just excited to see this getting merged for the impending release
Avatar
Avatar
Jeff Glass
And now I'm out 🦃 - sorry if I'm stepping on any toes here, just excited to see this getting merged for the impending release
FabioRosado 24/11/2022 21:23
Thank you so much for the awesome work Jeff! Enjoy your afternoon/evening!
Avatar
Yesterday & Today BOT 25/11/2022 07:00
📆 Yesterday & Today - 11/25/2022 🧵
Avatar
Avatar
FabioRosado
Maybe some weird thing with xdist like Antonio mentioned
it seems to be related to some missing synchronization in JS (i.e., we are missing an await somewhere), I would be surprised if it has anything to do with xdist. If you see that the single test passes with xdist fails, it is very likely that running in parallel makes each test slightly slower, meaning that JS has more time to complete some fetch.
08:42
but this is scary honestly. I would suggest to avoid releasing until we fully understand what's going on, else it's just a recipe for a flaky pyscript
08:44
what is the failing test?
antocuni started a thread. 25/11/2022 09:01
Avatar
Avatar
antocuni
it seems to be related to some missing synchronization in JS (i.e., we are missing an await somewhere), I would be surprised if it has anything to do with xdist. If you see that the single test passes with xdist fails, it is very likely that running in parallel makes each test slightly slower, meaning that JS has more time to complete some fetch.
FabioRosado 25/11/2022 09:25
I am just walking home from dropping my son in the nursery I’ll look a bit more but from what Jeff mentioned the issue seemed to be caused by the deprecation warning from pyodide and some imports in the mock folder 🤔
Avatar
I'm confused. You were talking about integration tests, but now I see that only typescript tests are failing. And the mock folder surely cannot affect the integration tests (well, hopefully at least: if we are using mocks in integration tests, something is very wrong 😅)
Avatar
FabioRosado 25/11/2022 10:02
Right sorry I was having dinner and on my phone so I didn’t follow closely what was failing, I mentioned the xdist thing in case it helped
Avatar
ah ok sure, no problem
Avatar
@FabioRosado I was looking at the new "view source" feature of examples: if I understand correctly, currently you just did a copy&paste of the source code, which means that they could become out of sync. Is it correct? I wonder whether this could be a good use case for a plugin which intercepts <py-script> tag before execution and save the sources in a different div
Avatar
Avatar
antocuni
@FabioRosado I was looking at the new "view source" feature of examples: if I understand correctly, currently you just did a copy&paste of the source code, which means that they could become out of sync. Is it correct? I wonder whether this could be a good use case for a plugin which intercepts <py-script> tag before execution and save the sources in a different div
FabioRosado 25/11/2022 13:27
Yeah that is correct, for now its all done manually Ohhh I like that idea!
13:28
Also, I was thinking that it could be intersting to add a py-plot plugin that would use matplotlib under the hood to create things (but havent thought much about how it would work haha)
Avatar
could be a good idea actually. I can imagine that you could put the data directly inside the tag (in csv format maybe?) or programmatically from python. Probably it doesn't belong to the core (but we could have it in the core temporarily, as for the py-md plugin)
Avatar
FabioRosado 25/11/2022 13:32
Thats a good idea 😄
13:32
I guess the next step on plugins is to allow users to download the from source?
Avatar
yes, although we need to determine what is the right format: e.g. for python plugins I can imagine that I want to split it into multiple files
Avatar
FabioRosado 25/11/2022 13:46
Oh yeah that makes sense 🤔 Maybe a similar thing to what we have on the fetch in py-config?
Avatar
well no; ideally I would like people to be able to write plugins = ["py-plot"] and we automatically know where and what to download. When you do pip install foo you don't have to tell pip the complete lists of files to download 😅
14:11
btw, I think I found a release blocker 😢 . Writing the issue right now
Avatar
Avatar
antocuni
btw, I think I found a release blocker 😢 . Writing the issue right now
FabioRosado 25/11/2022 14:14
Oh no! But thank you for looking into it 😄 I would also want the docs PR (the one that updates the examples) and the deprecation of output in for this release if possible 😄
Avatar
Avatar
antocuni
well no; ideally I would like people to be able to write plugins = ["py-plot"] and we automatically know where and what to download. When you do pip install foo you don't have to tell pip the complete lists of files to download 😅
FabioRosado 25/11/2022 14:15
Good point, so if I have a foo-plugin folder that has a bunch of python files, we would do plugins = ['foo-plugin'] and would import the whole folder? I like that 😄
Avatar
Avatar
FabioRosado
Oh no! But thank you for looking into it 😄 I would also want the docs PR (the one that updates the examples) and the deprecation of output in for this release if possible 😄
yes, the doc PR is what triggered me to find this mess: https://github.com/pyscript/pyscript/issues/986
There is a lot of confusion about using pyscript.XXX vs PyScript.XXX. Related PR #982 . Let&#39;s start from the current state in github main. We have this: pyscript/pyscriptjs/src/python/pyscr...
Avatar
Avatar
FabioRosado
Good point, so if I have a foo-plugin folder that has a bunch of python files, we would do plugins = ['foo-plugin'] and would import the whole folder? I like that 😄
yes, apart that you cannot because you cannot list all the files inside a folder with HTTP. We really need to think about a proper plan for plugins, surely not something that we can and should to in a rush
14:25
afk for ~1hr
Avatar
@antocuni well you got my attention with [RELEASE BLOCKER] 🙂
Avatar
Avatar
ntoll
@antocuni well you got my attention with [RELEASE BLOCKER] 🙂
this was my plan😂
🤿 1
Avatar
Just answering...
Avatar
the good news is that it's easy to fix
Avatar
Avatar
antocuni
yes, the doc PR is what triggered me to find this mess: https://github.com/pyscript/pyscript/issues/986
FabioRosado 25/11/2022 14:32
Thank you for the write up! Not sure if I would block on this, but we are in no rush for release I think so maybe we can address these issues. Unless I misunderstood, I think we don't really want people to do pyscript.write and do Element().write or display right? 🤔
Avatar
Jeff Glass 25/11/2022 15:10
Two separate issues have gotten confused here
15:12
The issue in #982 that fabio and I were discussing is about the naming of the exported javascript module ("pyscript"), which in writing the docs for #868, I had erroneously written as PyScript (edited)
15:12
As in pyscript.runtime.interpreter.runPython("1+2")
15:13
The other is the very real issue of pyscript the instance vs PyScript the class in pyscript.py
Avatar
FabioRosado 25/11/2022 15:19
Going to be afk for a while picking my son from the nursery
Avatar
Avatar
Jeff Glass
The issue in #982 that fabio and I were discussing is about the naming of the exported javascript module ("pyscript"), which in writing the docs for #868, I had erroneously written as PyScript (edited)
ah ok, sorry for the confusion. I thought you were talking about the python side
Avatar
Avatar
FabioRosado
Thank you for the write up! Not sure if I would block on this, but we are in no rush for release I think so maybe we can address these issues. Unless I misunderstood, I think we don't really want people to do pyscript.write and do Element().write or display right? 🤔
Not sure if I would block on this,
well, it's debatable but IMHO the fact alone that pyscript and import pyscript are two different things is enough to block. We should try to slowly clean the mess, not introducing new one 🙂
Avatar
Jeff Glass 25/11/2022 15:37
well, import pyscript isn't possible at all until #961 is merged; that PR is now doing several things at once
Avatar
Avatar
antocuni
Not sure if I would block on this,
well, it's debatable but IMHO the fact alone that pyscript and import pyscript are two different things is enough to block. We should try to slowly clean the mess, not introducing new one 🙂
FabioRosado 25/11/2022 15:42
Yeah agreed that’s why I said that since we aren’t in a rush we should try to fix it before 😄
Avatar
Avatar
Jeff Glass
well, import pyscript isn't possible at all until #961 is merged; that PR is now doing several things at once
yes exactly, the point of issue 986 is to describe what will happen when PR 961 is merged -- which we plan to do berfore the release. Sorry if it was unclear
Avatar
Jeff Glass 25/11/2022 16:01
Ah gotcha, yes I misunderstood
Avatar
@FabioRosado I'm reviewing PR 959 again: did you by chance use rebase?
Avatar
Avatar
antocuni
@FabioRosado I'm reviewing PR 959 again: did you by chance use rebase?
FabioRosado 25/11/2022 16:12
Yeah I rebased main to make the tests pass after my fix for ci, there’s 3 follow ups the ones I didn’t resolve in GitHub:
  • figure out whatsup with the fake server
  • the call to create alert banner
  • that util that’s handling different error messages
Avatar
I think it's fine to solve them in follow-up PRs
16:14
but my point was on rebase instead of merge: I think that github is buggy here: if you do rebase, it shows me all the commits as new, and it's hard to know which ones are the new commits since the last review
16:15
I think that with git merge it works out of the box, and it doesn't make much different at the end because we do squash&merge anyway
Avatar
FabioRosado 25/11/2022 16:24
Right I prefer to do git merge but our readme used to say that we want folks to rebase that’s why I was doing it haha I’ll start using merge ( I prefer it too 😄) I need to check what’s up with the error codes I remember changing then 🤔 (maybe I forgot to push 😬)
Avatar
Avatar
FabioRosado
Right I prefer to do git merge but our readme used to say that we want folks to rebase that’s why I was doing it haha I’ll start using merge ( I prefer it too 😄) I need to check what’s up with the error codes I remember changing then 🤔 (maybe I forgot to push 😬)
ah ok I wasn't aware of the README 🙂
Avatar
FabioRosado 25/11/2022 16:39
Maybe when it was written we didnt used to squash merge? I'll start doing merge instead of rebase 😄
Avatar
FabioRosado 25/11/2022 17:09
@antocuni thank you for all the reviews 😄
Avatar
@FabioRosado the failing tests are fixed locally... hope CI is happy. Then we'd just need to fix the conflics
Avatar
Avatar
Fabio
@FabioRosado the failing tests are fixed locally... hope CI is happy. Then we'd just need to fix the conflics
FabioRosado 25/11/2022 18:14
You should be enjoying your turkey 😛 But thanks! I'll fix the conflicts
Avatar
Avatar
FabioRosado
You should be enjoying your turkey 😛 But thanks! I'll fix the conflicts
lol... but I'm almost done with it. 😄
18:26
Actually, if my daughter would come every minute to ask if she should add sugar to her watery sugar scrub (because she doesn't like my answer), I'd have finished already lol
18:27
(Pushed)
Avatar
FabioRosado 25/11/2022 18:39
haha you are too quick 😄
Avatar
Avatar
FabioRosado
haha you are too quick 😄
Well... my first push was totally borked so I'm not sure it's a good thing lol. Good news is that TS test passed in CI. Hope that's the one !
Avatar
FabioRosado 25/11/2022 18:49
Want me to address the integration tests failure? Seems to be mostly related to the extra console warnings (which made me realise that this is a fragile way to test things)
Avatar
That'd be great, thank you. Starting to be short on time... 🙏
Avatar
FabioRosado 25/11/2022 18:50
sounds good 😄
🍻 1
Avatar
Paul Everitt 26/11/2022 15:01
A useful resource for ESM and library authors, with repo containing lots of examples: https://gils-blog.tayar.org/posts/using-jsm-esm-in-nodejs-a-practical-guide-part-1/ For example, I learned in ESM, you can use a top-level await outside async I'm also learning all the knobs in package.json
ESM is ready for use in Node.js. This guide shows you how, and how to avoid all the small gotchas. The guide covers the basics, but also discusses how to write packages that can be dual-mode (ESM and CJS), how to configure ESLint, Mocha, and Testdouble, and how to use TypeScript with ESM.
Avatar
Avatar
Paul Everitt
A useful resource for ESM and library authors, with repo containing lots of examples: https://gils-blog.tayar.org/posts/using-jsm-esm-in-nodejs-a-practical-guide-part-1/ For example, I learned in ESM, you can use a top-level await outside async I'm also learning all the knobs in package.json
is this only for node or it applies also to the browser?
Avatar
Paul Everitt 27/11/2022 13:46
Node (because browser doesn't care about package.json) but since it drives a bundler....kind of browser too
Avatar
Yesterday & Today BOT 28/11/2022 16:05
📆 Yesterday & Today - 11/28/2022 🧵
Avatar
tedpatrick 28/11/2022 16:18
Ok Yesterday and Today bot is all fixed up. Swapped out py-discord for py-cord libs in bot to create threads. All deployed and working. Repo is here https://github.com/pyscript/misc/tree/main/todaybot
🤩 1
Avatar
Goal of this PR is to add support for a very simple [and small] Python Plugins API so that PyScript users can implement Plugins in pure Python. The topic of Python Plugins opens up for a lot of que...
🥳 4
Avatar
Jeff Glass 28/11/2022 20:32
Still sadly seeing intermittent failures of loading Plugin files in time for pyimport to find them... will post an issue with a minimal reproduction and some notes. Edit: it's possible it's just an odd interaction with the live-refresh dev server... hopefully a false alarm (edited)
Avatar
Jeff Glass 28/11/2022 20:51
Further edit - not just the dev server, will post issue. It is... odd. I get a "No module named 'myFirstPlugin'" error about 1 time out of 3....
Avatar
Jeff Glass 28/11/2022 21:24
Posted - tried on both a linux and windows system with same results, hope others can reproduce. Currently plugin files fail to load roughly 1 out of every 3 times the page is loaded...
21:26
Also, forgive me if I'm just out of the loop here, but the integration tests on 961 are still failing https://github.com/pyscript/pyscript/actions/runs/3567666239, so that merge hasn't been pushed to /unstable (edited)
21:27
Or perhaps... they're failing intermittently, I see that run failed on importing plugin files, which is the behavior I see failing intermittently in #989
21:30
Afk for awhile, sorry for the stream of consciousness. Hope someone else can reproduce.
Avatar
FabioRosado 28/11/2022 22:08
I looked that your issue and this seems like the issue I saw last Friday, today I ran the tests locally and they seem to pass with the exception of the todo example which after reading your messages seems to be caused by the intermittent failures 🤔 I’ll try to take a look tomorrow in the morning
Avatar
tedpatrick 29/11/2022 02:22
Team Day and 1:1s are on for tomorrow!
Avatar
Yesterday & Today BOT 29/11/2022 07:00
📆 Yesterday & Today - 11/29/2022 🧵
Avatar
Avatar
madhurt
Failing tests... 😦
😭 1
Avatar
Avatar
tedpatrick
Team Day and 1:1s are on for tomorrow!
Tuesday..? 😉 From a Euro perspective your today is our tomorrow (and I have a small brain, so did a double take before realising what was going on). 😛
🦜 1
Avatar
Avatar
ntoll
Tuesday..? 😉 From a Euro perspective your today is our tomorrow (and I have a small brain, so did a double take before realising what was going on). 😛
tedpatrick 29/11/2022 11:09
Too much time across time-zones!
😝 1
Avatar
tedpatrick 29/11/2022 12:01
Adding 404 support to Fake Server https://github.com/pyscript/pyscript/pull/994
Return a 404 when a file does not exist in local disk
Avatar
Avatar
Jeff Glass
Further edit - not just the dev server, will post issue. It is... odd. I get a "No module named 'myFirstPlugin'" error about 1 time out of 3....
Yeah, @antocuni and I were looking at that last week and we think it's related to how fetch is implemented.
Avatar
FabioRosado 29/11/2022 16:12
Madhur's PR seems to fix most issues we are seeing on CI, but locally I still see failures with the plugins test
Avatar
Avatar
Fabio
Yeah, @antocuni and I were looking at that last week and we think it's related to how fetch is implemented.
yes but it doesn't explain why tests became so flaky suddenly. They have been very stable and reliable for months
Avatar
Avatar
FabioRosado
Madhur's PR seems to fix most issues we are seeing on CI, but locally I still see failures with the plugins test
Jeff Glass 29/11/2022 16:17
Building that PR locally, still seeing failures to load plugin files. Still roughly one out of 3 times.
Avatar
it's clearly missing a synchronization point
Avatar
Jeff Glass 29/11/2022 16:17
Agreed
Avatar
the hard part is to find which one
16:18
can we try to git bisect and find the PR which introduced the flakyness? Although I suspect it's #961 (python plugins)
Avatar
Jeff Glass 29/11/2022 16:20
I don't think it's an issue in the tests; I think it's an issue in the codebase itself. If you build currently and try to load a plugin file, roughly 1 time in 3, it fails
👆 1
16:21
The tests are catching that failure when it happens... intermitantly
Avatar
FabioRosado 29/11/2022 16:21
I checked out the previous merged one and CI passed. Although I was poking at the python plugins but couldn't figure out exactly which bit was causing the failure 🤔 For the module import, I did noticed that while on the chrome debugger everything worked fine once pyodide finished loading and even on the failing test doing pyscript.runtime.interpreter.FS.open("pkg/a.py") worked
🤔 1
Avatar
Jeff Glass 29/11/2022 16:21
I'd love to be wrong about that though
Avatar
FabioRosado 29/11/2022 16:22
For context I was using test_paths_from_packages as my guinea pig 😄
Avatar
but it seems to be not just the plugins: e.g. I have seen failures due to ImportError in test_zz_examples
Avatar
Jeff Glass 29/11/2022 16:22
Hmmm a very fair point
Avatar
FabioRosado 29/11/2022 16:23
Madhurs PR seem to fix the issue because (I suspect) we are trying to write the files twice, so even if the first time fails the second time succeeds
Avatar
that's why I wanted to know what is the PR which caused the regression in tests which used to pass reliably; if it's PR 961, we might need to revert it temporarily, else it becomes impossible to do "normal" development
Avatar
Avatar
FabioRosado
Madhurs PR seem to fix the issue because (I suspect) we are trying to write the files twice, so even if the first time fails the second time succeeds
I'm reviewing it right now
Avatar
Avatar
FabioRosado
Madhurs PR seem to fix the issue because (I suspect) we are trying to write the files twice, so even if the first time fails the second time succeeds
Jeff Glass 29/11/2022 16:24
I'm building off that PR now Fabio, and sadly, seeing the same behavior as before (failed imports ~1 time in 3)
Avatar
Avatar
Jeff Glass
I'm building off that PR now Fabio, and sadly, seeing the same behavior as before (failed imports ~1 time in 3)
FabioRosado 29/11/2022 16:24
on the plugins tests?
Avatar
Jeff Glass 29/11/2022 16:27
Just building it and trying to load a plugin; here's a screencap showing some source, and me just refreshing the page over and over:
16:28
16:29
(So sorry for the shakycam - video screen capture is broken on my system somehow 😅 )
16:29
That error message is: ModuleNotFoundError: No module named 'first_plugin'
16:30
Makes no difference if serving from python3 -m http.server, VS Code Live server....
Avatar
Jeff Glass 29/11/2022 16:38
You'll notice 961 passed its tests on your final fixes on Friday... but failed them during the merge proper. Similar intermitant behavior.
Avatar
Symour Papert: Mindstorms (https://www.amazon.com/Mindstorms-Children-Computers-Powerful-Ideas/dp/1541675126) Also Alan Kay (for example, this, but much more on his website: https://www.youtube.com/watch?v=YyIQKBzIuBY) and Bret Victor too (http://worrydream.com/)
Mindstorms: Children, Computers, And Powerful Ideas
Bret Victor has been provided by the management for your protection.
Avatar
A long but detailed article about the roots of Python, by GvR's mentor. It starts from the origin of ABC, and it does an incredibly good job at explaining the underlying philosophy and design choices. https://inference-review.com/article/the-origins-of-python
Python is arguably the most popular programming language worldwide. Since its debut in 1991, Python’s accessibility and rich functionality has helped it gather a huge userbase. Its design was influenced by creator Guido van Rossum’s involvement with an earlier language, ABC. Lambert Meertens, one of ABC’s developers, recounts Python’s origins an...
Avatar
Jeff Glass 29/11/2022 17:38
@FabioRosado @antocuni I believe the issue we were discussing has to do with sys.meta_path cache invalidation; going to open a WIP PR to test against CI, but passing locally 10 times in a row
🙌 1
Avatar
Avatar
Jeff Glass
@FabioRosado @antocuni I believe the issue we were discussing has to do with sys.meta_path cache invalidation; going to open a WIP PR to test against CI, but passing locally 10 times in a row
Jeff Glass 29/11/2022 17:52
Following the merge of #961, there have been intermittent issues with loading modules via [[fetch]] and the plugin loading mechanism. I believe the issue is that importlib is (sometimes) using an i...
17:52
🤞
Avatar
FabioRosado 29/11/2022 18:04
🧙 you are a wizard CI seems happy
🪄 1
Avatar
Avatar
FabioRosado
🧙 you are a wizard CI seems happy
Jeff Glass 29/11/2022 18:10
Woohoo! Let me take one more look (I worry I've missed an invalidation, or that of the three there may be redundencies), and it'll be ready for review
Avatar
https://github.com/pyscript/pyscript/pull/997 up for a quick approval owing to discussions from the meeting
Avatar
Also, Alan Kay at TED (conference, not Patrick 🤣 ): https://www.ted.com/talks/alan_kay_a_powerful_idea_about_ideas
With all the intensity and brilliance for which he is known, Alan Kay envisions better techniques for teaching kids by using computers to illustrate experience in ways -– mathematically and scientifically -- that only computers can.
Avatar
Jeff Glass 29/11/2022 18:51
@FabioRosado Still passing and ready for review 🤘
18:52
Once 996 is merged, rebasing should hopefully cure the failing CI tests @madhurt
Avatar
This is great, thanks a lot @Jeff Glass 🎉
18:57
@Jeff Glass do you think we could use runtime.run instead?
Avatar
Avatar
madhurt
@Jeff Glass do you think we could use runtime.run instead?
Jeff Glass 29/11/2022 19:03
That does seem better yeah... I'll make the change
Avatar
Yeah, I think we should avoid using interpreter unless absolutely necessary
👍 1
Avatar
Jeff Glass 29/11/2022 19:06
Fabio had a good thought about encapsulating the invalidation into a function like runtime.invalidate_import_cache() so it's not 4 copy-pastes of the same thing; I think both are a nice idea
Avatar
yes +1
Avatar
Jeff Glass 29/11/2022 21:26
Done; apologies for the delay
✅ 2
Avatar
Jeff Glass 29/11/2022 21:36
🛳
Avatar
@Jeff Glass @FabioRosado just to make sure I'm not misunderstanding, does this seem to fix all the flakiness of tests/imports/plugins?
Avatar
Avatar
Fabio
@Jeff Glass @FabioRosado just to make sure I'm not misunderstanding, does this seem to fix all the flakiness of tests/imports/plugins?
FabioRosado 29/11/2022 22:28
Yeah looks like it 😄 Jeff mentioned that he ran the failing tests multiple times and they all passed. CI seems happy too 😄
Avatar
That's awesome!
22:48
Maybe we can still release in November after all 😄
Avatar
Avatar
Fabio
@Jeff Glass @FabioRosado just to make sure I'm not misunderstanding, does this seem to fix all the flakiness of tests/imports/plugins?
Jeff Glass 29/11/2022 23:17
I believe so! I can't say for certain why the importlib pathcache was only invalid some of the time and not every time... but forcing a cache invalidation after we fetch modules to the FS is the solution (edited)
🎉 1
Avatar
That's great
Avatar
Jeff Glass 30/11/2022 00:09
Might be worth revisiting py_markdown.py - self.element.source seems to be underfined
Avatar
Avatar
Jeff Glass
Might be worth revisiting py_markdown.py - self.element.source seems to be underfined
Thanks! Will check it out
Avatar
I can't say for certain why the importlib pathcache was only invalid some of the time and not every time
I haven't had the chance to look at the PR yet, but I think this is the real question. Without understanding exactly what is happening and why, we can't be sure that the bug is "gone". In particular, we need to understand why importlib's cache is dirty, because AFAIK our code tries to save all the files to the FS before executing the first line of python. But it's evident that it's not the case. It might be caused by things like micropip.install, if they are executed before we finish to write things to the FS
00:23
but anyway, finding that it was caused by importlib's cache was brilliant 🤩
00:23
/me zzzz (edited)
Avatar
Yesterday & Today BOT 30/11/2022 07:00
📆 Yesterday & Today - 11/30/2022 🧵
Avatar
https://github.com/pyscript/pyscript/pull/991 is up for grabs for a quick approval 😄
✅ 1
Avatar
Started writing docs for Element and found some small bugs
related to this, at some point we need to sit down and decide whether we want to keep/support Element long term, or if we want something better
Avatar
Avatar
antocuni
Started writing docs for Element and found some small bugs
related to this, at some point we need to sit down and decide whether we want to keep/support Element long term, or if we want something better
FabioRosado 30/11/2022 10:08
I find the Element to be a nice way to interact with the elements in the page, do you have any ideas of alternatives?
Avatar
we talked several times about providing a pythonic API to access the DOM, and this pythonic API will probably have many functionalities in common with Element. Or, said in a different but more or less equivalent way: we could tweak/change/expand Element to be more complete
Avatar
FabioRosado 30/11/2022 10:12
That makes sense! Yeah I was wondering if I should add support for other things when I was fixing some minor things on it
Avatar
the very first thing to decide is how to access to elmenets by ID. Random ideas:
  • Element("foo") current API
  • page.foo
  • pydom.page.foo
  • pydocument.foo
  • app.foo
  • app.elements.foo
  • app.elements.get('foo')
  • ...
(edited)
Avatar
FabioRosado 30/11/2022 10:13
Btw I'm thinking to add another class LocalStorage to interact with the browser's local storage in a python way, what do you think?
10:14
The Element("foo") is nice and short 😄
Avatar
Avatar
ntoll
Symour Papert: Mindstorms (https://www.amazon.com/Mindstorms-Children-Computers-Powerful-Ideas/dp/1541675126) Also Alan Kay (for example, this, but much more on his website: https://www.youtube.com/watch?v=YyIQKBzIuBY) and Bret Victor too (http://worrydream.com/)
I got the mindstorms one yesterday! seems really interesting thanks Nick 😉
👍 1
Avatar
Avatar
FabioRosado
The Element("foo") is nice and short 😄
I'm not saying it's bad. I'm saying that it might be a good idea to explore alternatives and do a proper design phase
10:15
and maybe we will end up saying that Element("foo") is the best
10:17
to start with, a global Element interacts badly with iframes, because it assumes you want to access the global document. This might or might not be enough to change it, but we need to think
Avatar
FabioRosado 30/11/2022 10:19
Oh yeah that's a good point!
Avatar
Avatar
antocuni
the very first thing to decide is how to access to elmenets by ID. Random ideas:
  • Element("foo") current API
  • page.foo
  • pydom.page.foo
  • pydocument.foo
  • app.foo
  • app.elements.foo
  • app.elements.get('foo')
  • ...
(edited)
This is exactly what I'm working on right now.
Avatar
Avatar
ntoll
This is exactly what I'm working on right now.
another of your secret projects 😉
Avatar
Hah... nope. Pretty much every day for the past 2 weeks I've said in the daily "standup": working on DOM<->Python bridge or something similar.
Avatar
do you have a repo somewhere? Now I'm curious 🙂
Avatar
But for that to work we need:
  • DOM serialization ☑
  • DOM mutate ☑
  • Referencing elements in the DOM (what we've just been talking about)
  • Registering/coordinating event handling.
  • Message passing.
All the above have "experiments" that have allowed me to playfully explore the problem space. I'm currently putting together "PolyPlug" to bring these different aspects together in a small, simple, interpreter agnostic way. First two are done, currently working on referencing (should be done by today)... then onwards to the other stuff.
Avatar
Avatar
antocuni
do you have a repo somewhere? Now I'm curious 🙂
Yes... but not pushed to GitHub, it's still a work in progress, but happy to share.
Avatar
please share 🙂
Avatar
2mins
Avatar
if I understand it correctly, you are developing this with micropython in mind, but it seems that we could reuse it also for pyodide-on-webworkers, couldn't we?
Avatar
Exactly
Avatar
why do you need to serialize things? is that... related to how we want to pass objs to the webworker?
Avatar
Serialization is how we create the messages across the main-thread/web-worker boundary. Remember the worker doesn't have access to the DOM. So serializing a representation of the DOM is necessary.
👍 1
10:51
VERY MUCH A WORK IN PROGRESS and unfinished.
10:52
But it is small, has tests, and that's about it.
Avatar
what is jasmine @ntoll ? just curious 😅 (edited)
Avatar
It's a JS based test framework.
10:53
Used by react IIRC.
👍🏼 1
Avatar
aah okay
Avatar
It's a node/npm free zone (trying to avoid all that complexity).
10:53
Simple = good. 🙂
Avatar
Avatar
ntoll
It's a node/npm free zone (trying to avoid all that complexity).
yeah, makes sense
Avatar
The actual tests are in the spec folder. They're BDD style.
10:54
Also, you only need a browser and type 'make test' to run the test suite.
10:54
"it just works" ™️
Avatar
Avatar
ntoll
Serialization is how we create the messages across the main-thread/web-worker boundary. Remember the worker doesn't have access to the DOM. So serializing a representation of the DOM is necessary.
FabioRosado 30/11/2022 10:59
Nice thanks! I’m very curious about this 👀
➕ 1
Avatar
TL;DR we serialize the DOM (fragment) to a JSON string, and deserialize to "something Pythonic" over in the interpreter.
Avatar
PS -- Next PR / Issue is gonna be #1000
Avatar
Avatar
madhurt
PS -- Next PR / Issue is gonna be #1000
The end of the world is nigh..!
🤣 3
Avatar
we should have a bell
Avatar
here you go: 🔔
13:14
Also, @3l3ktr4 here's your no-bell prize for emoji usage: 🔕
13:14
😛
Avatar
hehehe
13:14
🪦
13:15
i died out of bad pun
Avatar
tedpatrick 30/11/2022 13:40
I see PolyPlug 🙂
13:41
What should we do with Element? Deprecate and externalize it as a plugin.
Avatar
Avatar
3l3ktr4
i died out of bad pun
Dad jokes FTW!
Avatar
Avatar
tedpatrick
I see PolyPlug 🙂
set as private atm - it's a WiP. happy to collaborate.
Avatar
tedpatrick 30/11/2022 14:08
New WASM Runtime.. https://lunatic.solutions/
Lunatic is an open-source WebAssembly runtime and platform for running server-side applications
Avatar
That was pretty cool.
Avatar
sweet meeting! 🙂 I'm excited
👏 1
14:42
yeah, wholesome
14:44
I have to leave in 20min so I'll just be able to take a real look on this tonight but will start setting up to run some demos + I'll read further on pgpio
Avatar
So we need a PyChristmasTree module: import pyxmastree pyxmastree.on()
14:44
etc...
Avatar
<py-xmas>
❤️ 1
Avatar
Perfect.
Avatar
should we maybe create a separate pyscript-rpi channel for this sub-project?
Avatar
tedpatrick 30/11/2022 14:48
Well I feel we need to define the sub-project. Then allocate hours to it. Then proceed.
✅ 1
Avatar
pyscript-gpio
Avatar
we can either that or pyscript-gpio or pyscript-ic
Avatar
This is more a generic IoT thing than RPi specific.
Avatar
Avatar
tedpatrick
Well I feel we need to define the sub-project. Then allocate hours to it. Then proceed.
...and a Jira instance too.
Avatar
Avatar
tedpatrick
Well I feel we need to define the sub-project. Then allocate hours to it. Then proceed.
so you mean I shouldn't tackle it rn? I should focus on the webworker stuff first?
Avatar
Avatar
3l3ktr4
so you mean I shouldn't tackle it rn? I should focus on the webworker stuff first?
tedpatrick 30/11/2022 14:52
I think we just need to plan it out... What are we going to build? Why? ==> We need a written proposal Allocate a set of hours towards it... 10-20 hrs? Go and review results.
14:53
There are some big items ahead for pyscript ( sync/async, workers, scope). 🎯
Avatar
alright lmk how specific you want this proposal to be and if I need to answer anything other than that (is a gh issue fine?) and what's a reasonable amount of hours
Avatar
tedpatrick 30/11/2022 15:02
Github issue is fine. Just detail the problem and proposed solution/exploration.
Avatar
coolio so I do it tonight 🙂 I'm off for a few hours for german class
Avatar
Avatar
tedpatrick
New WASM Runtime.. https://lunatic.solutions/
wow, lunatic is interesting. To take full advantage of it, we would need a python subset which is compiled to WASM 😉 (as opposed to being interpreted as cpython/pyodide do)
😃 1
Avatar
I just learned a quick trick to test flaky tests; just add a parametrized n to run it multiple times: @pytest.mark.parametrize('n', range(20)) def test_paths_from_packages(self, n): ... And then use pytest -v --tb=no for a nice summary:
👍 1
Avatar
Ahhh... that's pretty cool.
Avatar
FabioRosado 30/11/2022 16:02
I've been using pytest-repeat that does a similar thing, you can use --count to run the same test n times
16:02
also ^ from main?
Avatar
Aaaah... I'm a total idiot. Forgot we could do that. We are doing that for some internal products as well 🤦
Avatar
Avatar
FabioRosado
also ^ from main?
no, this was commit 3e408b7
Avatar
FabioRosado 30/11/2022 16:03
ah cool pew! thought it was broken again haha
Avatar
I'm still not convinced it's fixed to be honest
16:03
until someone explains me why we need to call importlib.invalidate_cache 😅
Avatar
Avatar
antocuni
wow, lunatic is interesting. To take full advantage of it, we would need a python subset which is compiled to WASM 😉 (as opposed to being interpreted as cpython/pyodide do)
tedpatrick 30/11/2022 16:04
spy-lunatic 🙂
Avatar
FabioRosado 30/11/2022 16:04
did you start reading/looking into this? was thinking to look into it as well. from what I gathered it seems an issue when trying to import things in a running python session (kind of?)
Avatar
for example, consider these two tests: def test_importlib1(self): self.pyscript_run( """ <py-script> with open('bar.py', 'w') as f: f.write("x = 42") import bar print(bar.x) </py-script> """ ) def test_importlib2(self): self.pyscript_run( """ <script> function onClick() { pyscript.runtime.interpreter.FS.writeFile('bar.py', "x = 42"); printBar(); } </script> <py-script> import js def printBar(): print("hello from Python") import bar print(bar.x) js.printBar = printBar </py-script> <button onclick="onClick()">click me</button> """ ) They both "work", in the sense that you can immediately do import bar after having written the file to the FS
Avatar
tedpatrick 30/11/2022 16:05
ATTN: There is never a rush to ship. We ship when ready, not before.
Avatar
what is ATTN?
Avatar
tedpatrick 30/11/2022 16:05
ATTN == ATTENTION 🙂
👍 1
Avatar
FabioRosado 30/11/2022 16:06
are they flaky tho? Or they always pass?
Avatar
Avatar
FabioRosado
are they flaky tho? Or they always pass?
good point, I didn't try 😅
Avatar
FabioRosado 30/11/2022 16:06
I think what you suggest yesterday is still a good idea, to create a huge file and try to import it with just pyodide and see if it fails
Avatar
+1 on adding these tests
Avatar
Avatar
Fabio
+1 on adding these tests
well, I'm using them just to try stuff; it's unclear what they test
Avatar
Avatar
antocuni
until someone explains me why we need to call importlib.invalidate_cache 😅
Jeff Glass 30/11/2022 16:11
Re: your thuoght about yesterday @antocuni about us not running Python until all files are loaded - possibly worth noting that loadPyodide calls runPython internally: https://github.com/pyodide/pyodide/blob/e002c19af8906fd3b9199aa4bad6fe727d0b0451/src/js/pyodide.ts#L374
Avatar
right, that's a good point. But it still doesn't explain why we need to manually invalidate the cache. Python is normally capable of noticing that a new file exists and import it without problems. Why it cannot here?
16:13
basically, I suspect that importlib.invalidate_caches doesn't actually solve the problem, but it just adds enough delay that the problem is hidden
Avatar
Avatar
antocuni
well, I'm using them just to try stuff; it's unclear what they test
They test different scenarios. Maybe not necessarily different from a importlib perspective.. We should definitely add the big file one though (edited)
Avatar
FWIW, test_importlib2 passes reliably on my machine, it doesn't seem flaky. Which seems to confirm that `pyodide.FS.writeFile() followed by a python import should just work
Avatar
Jeff Glass 30/11/2022 16:17
Interesting, and agreed that it should - but as we can see by building that commit and trying to use it... it doesn't just work, it fails quite often (edited)
16:18
But I'd agree that the it's possible issue is timing related, and that my "clever fix" is a "too-clever delay" (edited)
Avatar
or maybe not; I've tried to replace the importlib.invalidate_caches() with a busy-wait, and it becomes flaky again
Avatar
Jeff Glass 30/11/2022 16:20
I tried to investigate whether there's a chance the FS.writefile is somehow not-really-synchronous... but the Emscripten API claims the MEMFS (the default filesystem Pyodide uses) is fully synchronous https://emscripten.org/docs/api_reference/Filesystem-API.html
Avatar
but then it means that we have two conflicting pieces of evidence, which makes me even more worrying. That's why I want to undertstand what's going int
Avatar
Avatar
Jeff Glass
I tried to investigate whether there's a chance the FS.writefile is somehow not-really-synchronous... but the Emscripten API claims the MEMFS (the default filesystem Pyodide uses) is fully synchronous https://emscripten.org/docs/api_reference/Filesystem-API.html
yes, this is also my suspicion
16:21
do you know where we can find the emscripten source code which corresponds exactly to the one we are running?
Avatar
Jeff Glass 30/11/2022 16:22
I was just pulling that back up 😁
Avatar
brilliant
Avatar
FWIW, I'm trying with this: invalidate_module_path_cache(): void { function busyWait(ms) { console.log("busy wait start", ms); let start = new Date().valueOf(); while( (new Date()).valueOf() - start < ms) ; console.log("busy wait end"); } busyWait(100); // const importlib = this.interpreter.pyimport("importlib") // importlib.invalidate_caches() } i.e., a busy loop instead of actual calling invalidate_caches(). With busyWait(1000) test_paths_from_packages passes reliably. With busyWait(100) it's still flaky
Avatar
Jeff Glass 30/11/2022 16:56
Huh! Well that's.... troubling
Avatar
Jeff Glass 30/11/2022 17:16
Are you testing with pytest or by building and trying it "by hand" in a browser? I would love to understand what parts of this behavior are the same and different when running tests
Avatar
I'm testing with pytest, but I would be very surprised if it were different than running it "by hand"
Avatar
In my opinion the evidence here (same code works fine in native Python) strongly suggests that this is due to another bug in the Emscripten MEMFS.
18:24
One tip I have for debugging the file system code is that if you use the debug Pyodide pyodide.asm.js has been prettier'd so you can modify the JavaScript code in place to add extra console.warn s and other debug stuff without rebuilding Pyodide.
18:27
if the problem is the time stamps, perhaps we could record the time stamps in a native Python session and then overwrite the global Date object with a mock object that replays the time stamps from the native session and see how the behavior changes. Though this would be a bit complicated to get right (edited)
18:28
anyways I'm very glad you all are looking into this!
🙌 2
👍 1
Avatar
tedpatrick 30/11/2022 19:08
Glad you are here @hood
Avatar
What happened to the output option in <py-repl>?
21:09
I'm so confused... How do I get the <py-repl> to behave like before (output contextual to the cell I execute)?
Avatar
Avatar
hood
if the problem is the time stamps, perhaps we could record the time stamps in a native Python session and then overwrite the global Date object with a mock object that replays the time stamps from the native session and see how the behavior changes. Though this would be a bit complicated to get right (edited)
I suppose we can add some logging also to importlib, even if this means that we need to rebuild pyodide
Avatar
And... the antigravity example is also broken (at least for me). Can someone else confirm that they are experiencing the same?
Avatar
Avatar
Fabio
I'm so confused... How do I get the <py-repl> to behave like before (output contextual to the cell I execute)?
Output is temporally gone, i think that the plan was to rethink/refactor it, in coordination with py-script. But the default target for display () is the element sibling to py-repl
Avatar
Avatar
antocuni
Output is temporally gone, i think that the plan was to rethink/refactor it, in coordination with py-script. But the default target for display () is the element sibling to py-repl
That's a major issue. We should pause any plan to release until we fix this.
21:16
The whole <py-repl> flow is so weird
Avatar
Avatar
antocuni
Output is temporally gone, i think that the plan was to rethink/refactor it, in coordination with py-script. But the default target for display () is the element sibling to py-repl
Jeff Glass 30/11/2022 21:16
output is gone for py-script tags... is it also gone for repl?
Avatar
That's not what we agreed (at least iirc)
Avatar
Basically... How can I recreate a notebook like experience? or the output experience?
Avatar
Saw that. For some reason it's just not working. Trying to figure out what's going on
Avatar
For some reason the output is sent to PyTerminal and not the output element I specify
Avatar
Jeff Glass 30/11/2022 21:29
Ah, anything that writes to stdout goes to pyterminal; expressions returned from the repl are displayed
21:29
Regardless of whether the output attribute is used or not
Avatar
Avatar
Fabio
Basically... How can I recreate a notebook like experience? or the output experience?
I don't get it our current default behaviour is the notebook behaviour, no?
Avatar
Avatar
3l3ktr4
I don't get it our current default behaviour is the notebook behaviour, no?
No. I actually cannot replicate the notebook behavior for my life 😦
Avatar
hum, well can you be more specific with what you mean, please? I'm confused
Avatar
(I don't exclude it's an user error)
21:32
Is that what you're seeing @Fabio ?
Avatar
wow
21:32
that's not happening in my branch
Avatar
+ output just not working at all
Avatar
Hello, This is an approach on removing ids. Comments are appreciated! (I was building on top of Antonio's fix, will rebase later =)
21:33
I've never saw this beahviour
21:33
think it might have been introduced between yesterday when I finished this PR and now
Avatar
Wait, but that PR is not merged yet
Avatar
it's not
21:34
that's what I mean
Avatar
Avatar
Fabio
+ output just not working at all
Jeff Glass 30/11/2022 21:34
@Fabio output now only affects the values returned from expressions; it has no affect on where your stdout goes
Avatar
I was trying things yesterday... like super fresh pulled from main and didn't see this kind of stuff happening
21:35
must be something new
Avatar
Jeff Glass 30/11/2022 21:35
That I believe is true as of #917
Avatar
Avatar
Jeff Glass
@Fabio output now only affects the values returned from expressions; it has no affect on where your stdout goes
Not sure I understand
Avatar
Jeff Glass 30/11/2022 21:35
😅 Lemee try again
Avatar
You mean it doesn't affect print for instance?
21:36
I'm simply doing import this and I'd like it to output on a div of choice.
Avatar
Avatar
Fabio
You mean it doesn't affect print for instance?
Jeff Glass 30/11/2022 21:38
Exactly - if you have: <py-repl id="my-repl" auto-generate="true" output="my-output"> </py-repl> <div style="background-color: #f0ab3c; height: 12rem;" id="my-output"></div> Then putting the following in the repl should put "42" into the orange div: >>> x = 42 >>> x But this will put it in a <py-terminal> >>> x = 42 >>> print(x)
Avatar
I'm pretty sure we decided that'd not change the behavior to display the last cell/repl object... that's why I was expecting it to output to my div
21:39
Yeah, the above is fine (although I still want to get back to this in the future because ) it is not the expected behavior from someone used to notebooks, we should give an option
Avatar
Avatar
Fabio
I'm simply doing import this and I'd like it to output on a div of choice.
Jeff Glass 30/11/2022 21:41
I suppose in answer to your question - there is no way to put the output of import this in a div of your choice
21:41
Currently
Avatar
yeah, I remember this discussion this is not reproducible on my branch... I think this is a regression it also breaks several tests, I don't understand how this is happening honestly
Avatar
Jeff Glass 30/11/2022 21:42
Well, you could wrap it with a context manager that redirects stdout or something I suppose
Avatar
aahh
21:42
wait
21:42
sorry maybe it does
Avatar
@3l3ktr4 is antigravity working on your branch?
Avatar
let me test... hum
21:45
AttributeError: module 'antigravity' has no attribute 'fly'
Avatar
mmm.... here's what I see Traceback (most recent call last): File "/lib/python3.10/site-packages/_pyodide/_base.py", line 435, in eval_code .run(globals, locals) File "/lib/python3.10/site-packages/_pyodide/_base.py", line 304, in run coroutine = eval(self.code, globals, locals) File "<exec>", line 1, in <module> File "/home/pyodide/antigravity.py", line 44, in <module> _auto = Antigravity(append=True) File "/home/pyodide/antigravity.py", line 14, in __init__ target = target or sys.stdout._out AttributeError: '_io.TextIOWrapper' object has no attribute '_out'
Avatar
alright...
Avatar
Jeff Glass 30/11/2022 21:47
I see what @3l3ktr4 sees. AttributeError
21:47
on main
Avatar
well we don't have a test for antigravity anyways
21:47
so as how Antonio likes to put it "what's not tested is broken" I guess :p
21:48
but sorry I just jumped in the discussion without understanding the context, now I do
Avatar
Jeff Glass 30/11/2022 21:49
Ah, sorry y'all, I had a faulty build, I'm not seeing the _io.Textwrapper error that @Fabio sees
Avatar
idk if my inputs were relevant just the one thing I'm still confused about is that you don't really need the output attr. to be able to have notebook behaviour that happens by default with auto-generate enabled
Avatar
Jeff Glass 30/11/2022 21:50
I think the confusing thing is that that's currently true if you just do x = 42; x.... but if you do print(x) it goes somewhere else entirely (a <py-terminal>)
Avatar
The output attr is because I was already using it for one example. Since it doesn't work, I wanted to use the notebook behaviour... none of them work atm so I have 0 options really
Avatar
@Jeff Glass me too! I just re-ran with npm run build for some reason, it didn't work on my ongoing npm run dev these two behave differently and I think they shouldn't? (but not sure what are the typescript norms)
Avatar
Jeff Glass 30/11/2022 21:52
Did you by chance checkout another commit while npm run dev was running? That's I think where mine threw up... I had to kill and restart the build. Not sure if that was the culprit...
Avatar
no but anyways that usually works usually the dev picks up on the different branches... I'm not sure what's up
Avatar
Jeff Glass 30/11/2022 21:53
🤔 Hmmmmm
Avatar
I still don't get what you mean with the notebook behaviour doesn't work 😅 sorry Fabio maybe it's late for me lmk if I can help smh!
Avatar
Jeff Glass 30/11/2022 22:03
I'm out for awhile as well - Fabio from what you've described, what's wanted is, for py-repls, stdout should go to the same location as the results of expressions, which are placed according to display() rules (next-sibling of current element) Which seems reasonable - it means either bypassing or rethinking the stdiomultiplixer from @antocuni 's #917. Apologies if this got too in-the-weeds too fast - I've spent a lot of time in the commit history prepping the release blog post (5300 words and counting)
🔥 1
❤️ 1
Avatar
wow 😮 wild! thanks Jeff
Avatar
No worries.. Thanks Jeff and good luck with that!
Avatar
Avatar
Jeff Glass
I'm out for awhile as well - Fabio from what you've described, what's wanted is, for py-repls, stdout should go to the same location as the results of expressions, which are placed according to display() rules (next-sibling of current element) Which seems reasonable - it means either bypassing or rethinking the stdiomultiplixer from @antocuni 's #917. Apologies if this got too in-the-weeds too fast - I've spent a lot of time in the commit history prepping the release blog post (5300 words and counting)
@Jeff Glass do you have a draft of the post? I think I could use some of that to add a "what's new" slide to my talk tomorrow..
Avatar
Avatar
Fabio
@Jeff Glass do you have a draft of the post? I think I could use some of that to add a "what's new" slide to my talk tomorrow..
Jeff Glass 30/11/2022 23:52
Sure! I can share a copy later tonight when i’m back near a computer
🙏 1
Avatar
And, if you also have your rich examples running anywhere, I'd love to show them live tomorrow as well 🙂
Avatar
Avatar
madhurt
PS -- Next PR / Issue is gonna be #1000
Congrats @FabioRosado
🎉 2
Avatar
Avatar
Fabio
@Jeff Glass do you have a draft of the post? I think I could use some of that to add a "what's new" slide to my talk tomorrow..
Jeff Glass 01/12/2022 03:42
Draft of the next release writeup is here: https://dev.jeff.glass/whats-new-pyscript-2022-11-1-draft-11-30/index.html The chunks in red are my to-be-updated sections I seem to have lost a little reformatting, possibly forgot to push from my primary computer. Will check and update in the morning 🤷‍♂️ (edited)
The big changes in PyScript version 2022.11.1
03:44
The rich demos are live at https://jeff.glass/rich; the howto and background post is at https://jeff.glass/post/pyscript-rich/ Those both run on 2022.06.1... I haven't tried, but I suspect they'd work on 2022.09.1, but the current build (with display() and rethought stdout) would break them 😅 (edited)
😂 1
Avatar
Avatar
Jeff Glass
The rich demos are live at https://jeff.glass/rich; the howto and background post is at https://jeff.glass/post/pyscript-rich/ Those both run on 2022.06.1... I haven't tried, but I suspect they'd work on 2022.09.1, but the current build (with display() and rethought stdout) would break them 😅 (edited)
Thank you so much Jeff! The rich demo is fantastic! 😍 I'll also see what I can inlcude in my talk. TY!
Avatar
Avatar
Jeff Glass
Draft of the next release writeup is here: https://dev.jeff.glass/whats-new-pyscript-2022-11-1-draft-11-30/index.html The chunks in red are my to-be-updated sections I seem to have lost a little reformatting, possibly forgot to push from my primary computer. Will check and update in the morning 🤷‍♂️ (edited)
Wow! The release write up is absolutely magical!! Jeff, you are amazing!!! 😍😍
Avatar
Yesterday & Today BOT 01/12/2022 07:00
📆 Yesterday & Today - 12/01/2022 🧵
Avatar
I stumbled upon this page, about debugging WASM into chrome (it's from 2020, so it might be outdated): https://developer.chrome.com/blog/wasm-debugging-2020/ This excerpt is interesting: if it's true, it means that our code will run slower when dev tools are open. This is another reason for preferring "DOM-based dev tools" such as py-terminal and our custom error/warning systems instead of using dev tools
Avatar
This is definitely the case. When timing MicroPython/Pyodide to get to "print('hello world')" they were significantly slower when dev tools were active.
Avatar
tedpatrick 01/12/2022 13:36
The Yesterday and Today bot looks to be working well. Any feedback?
Avatar
The Yesterday and Today bot looks to be working well. Any feedback?
this is how they look like in my sidebar. Would be nice if I could actually see the date (and bonus point if the date is in a sane not american format). Something like 2022-12-01 Y&T or 01 Dec Status Update, or something like that
👍 1
Avatar
+1 for 01 Dec Status Update
Avatar
tedpatrick 01/12/2022 13:41
Note: Add pretty EU dates
Avatar
that's why I proposed 01 Dec, so it's not biased towards any particular continent
Avatar
tedpatrick 01/12/2022 13:42
I am offended ⛷🙂
Avatar
I'm also fine with using the Latin Calendar instead: Kalendis Decembribus MMXXII A.D.
🤩 2
Avatar
ahahaha
13:45
that's very playful I like it
13:45
we should start with the day tho
13:47
strong italian bias but ok for me since about 30% of the team is either italian or very italian
Avatar
@FabioRosado approved https://github.com/pyscript/pyscript/pull/1000 but there are some comments which can be removed
🔔 1
Avatar
@tedpatrick is the source code of the bot online?
Avatar
@Jeff Glass a quick glance at the [[fetch]] section in the draft blog post, the snippet for Multiple Fetch Configs has with open('data.csv', 'rb') as fp: while it should be sensordata.csv (edited)
👍 1
Avatar
Jeff Glass 01/12/2022 14:03
Thanks!
Avatar
Avatar
Jeff Glass
Draft of the next release writeup is here: https://dev.jeff.glass/whats-new-pyscript-2022-11-1-draft-11-30/index.html The chunks in red are my to-be-updated sections I seem to have lost a little reformatting, possibly forgot to push from my primary computer. Will check and update in the morning 🤷‍♂️ (edited)
wow, very nice writeup. Some notes:
  • so display(<br>) prints the literal characters: it's missing quotes around <br>, should be display("<br>")
  • in the "no implicit coroutines" section, the "2022.11.1 equivalent" code has wrong intendation inside the for loop
Avatar
Avatar
antocuni
wow, very nice writeup. Some notes:
  • so display(<br>) prints the literal characters: it's missing quotes around <br>, should be display("<br>")
  • in the "no implicit coroutines" section, the "2022.11.1 equivalent" code has wrong intendation inside the for loop
Jeff Glass 01/12/2022 16:23
Thank you!
Avatar
Avatar
Jeff Glass
Draft of the next release writeup is here: https://dev.jeff.glass/whats-new-pyscript-2022-11-1-draft-11-30/index.html The chunks in red are my to-be-updated sections I seem to have lost a little reformatting, possibly forgot to push from my primary computer. Will check and update in the morning 🤷‍♂️ (edited)
Btw, this blog post is gold mine of info that we definitely should add to the docs. I keep repeating myself but I love it 😍
Avatar
getting somewhere with the importlib problem; the following snippets always file on node on my machine: const { loadPyodide } = require("pyodide"); function busyWait(ms) { let start = new Date().valueOf(); while( (new Date()).valueOf() - start < ms) ; } async function main() { let pyodide = await loadPyodide({ indexURL: "./node_modules/pyodide", }); console.log("Pyodide version: ", pyodide.version); try { pyodide.FS.writeFile('bar0.py', 'x = 0'); pyodide.runPython('import bar0; print(bar0.x)'); // if you uncomment EITHER line, it works //pyodide.runPython('import importlib; importlib.invalidate_caches()'); //busyWait(1000); pyodide.FS.writeFile('bar1.py', 'x = 1'); pyodide.runPython('import bar1; print(bar1.x)'); } catch(e) { console.log(e); } } main(); (edited)
17:54
it seems to be an upstream pyodide/emscripten bug, but I'm investigating more
17:56
what's very weird is that with busyWait(1000) it works; with busyWait(100) is fails
17:59
it might be a problem of emiscripten; e.g., maybe for some reason they are using a clock which has only a resolution of 1s, which means that bar1.py has the same timestamp as bar0.py and the parent directory, meaning that importlib thinks it doesn't need to invalidate the cache. But a resolution of 1s is too bad to be believed
Avatar
Avatar
antocuni
getting somewhere with the importlib problem; the following snippets always file on node on my machine: const { loadPyodide } = require("pyodide"); function busyWait(ms) { let start = new Date().valueOf(); while( (new Date()).valueOf() - start < ms) ; } async function main() { let pyodide = await loadPyodide({ indexURL: "./node_modules/pyodide", }); console.log("Pyodide version: ", pyodide.version); try { pyodide.FS.writeFile('bar0.py', 'x = 0'); pyodide.runPython('import bar0; print(bar0.x)'); // if you uncomment EITHER line, it works //pyodide.runPython('import importlib; importlib.invalidate_caches()'); //busyWait(1000); pyodide.FS.writeFile('bar1.py', 'x = 1'); pyodide.runPython('import bar1; print(bar1.x)'); } catch(e) { console.log(e); } } main(); (edited)
file or fail?
Avatar
fail
18:11
I'm writing more details on a pyodide issue, wait for it
👍 1
Avatar
Avatar
antocuni
it might be a problem of emiscripten; e.g., maybe for some reason they are using a clock which has only a resolution of 1s, which means that bar1.py has the same timestamp as bar0.py and the parent directory, meaning that importlib thinks it doesn't need to invalidate the cache. But a resolution of 1s is too bad to be believed
yeah, 1s is quite bad
Avatar
it seems very likely a 1s timestamp "somewhere". Look at my experiment here: https://github.com/pyodide/pyodide/issues/3311
🐛 Bug This might be a duplicate of #737, but I&#39;m opening a new issue because I&#39;m seeing something very weird. I&#39;m using Pyodide 0.21.3. To Reproduce Consider the following s...
18:23
anyway, if it turns out that this is actually the problem, now I'm much more relaxed and convinced that @Jeff Glass 's runtime.invalidate_module_path_cache() is a proper and reliable workaround 🙂
18:23
/me ==> dinner
Avatar
tedpatrick 01/12/2022 18:54
eventually consistent in 1s 🤦‍♂️
Avatar
Avatar
tedpatrick
eventually consistent in 1s 🤦‍♂️
Haha, never thought a term used for databases will be used in this context, Love it 💯
Avatar
Avatar
madhurt
Haha, never thought a term used for databases will be used in this context, Love it 💯
tedpatrick 01/12/2022 19:04
Wait, you are not a database?
😅 1
Avatar
Avatar
tedpatrick
Fabio is live at PyData NYC https://www.youtube.com/watch?v=gVqshlX4aW0
wat people are saying pyscript is like php weeeird
Avatar
Avatar
3l3ktr4
wat people are saying pyscript is like php weeeird
tedpatrick 01/12/2022 19:12
Well, inlining code in html is very php. 🙂 <!DOCTYPE html> <html> <body> <?php $x = "Hello world!"; echo $x; ?> </body> </html>
Avatar
I think it's really valuable to reinforce the idea that we're not here to substitute js/ts I still have friends coming up to me saying that's what we're gonna do 😅
19:13
I think php look so ugly haha doesn't process as the same thing in my head
Avatar
Avatar
3l3ktr4
I think php look so ugly haha doesn't process as the same thing in my head
tedpatrick 01/12/2022 19:34
PHP is lovely. I spent time with Rasmus (creator) while working with Yahoo. Yahoo and Facebook are 80% php. The php stack yahoo had was next level at the time, it was a custom version of BSD+Apache and YPHP was a compiler that generated C from PHP.
🙈 1
Avatar
Avatar
3l3ktr4
wat people are saying pyscript is like php weeeird
@3l3ktr4 where did you see this? In the comments or somewhere else? I had a couple of slides about it in the talk... I think the comparison is really natural given the similar interface but we shouldn't be afraid of it and teach the differences.
Avatar
FabioRosado 01/12/2022 19:55
Okay after this release we are going to make it so you need to use $ for every python line. Every single one! 😄
😂 1
Avatar
@Fabio no I'm saying that as a positive comment I listened to the talk and think you emphasized it quite well this comment comes literally from my IRL friends 🙈
Avatar
Avatar
3l3ktr4
@Fabio no I'm saying that as a positive comment I listened to the talk and think you emphasized it quite well this comment comes literally from my IRL friends 🙈
Ah, gotcha 🙂
Avatar
Avatar
FabioRosado
Okay after this release we are going to make it so you need to use $ for every python line. Every single one! 😄
tedpatrick 01/12/2022 21:11
Said no PHP dev ever.... is this a variable? $$$
Avatar
FabioRosado 01/12/2022 21:20
Haha true but it’s awkward to type
Avatar
our code will run slower when dev tools are open.
Also, when there are bugs in the optimizer, we can get crashes that only occur when devtools are closed for instance the Chrome 89 bug that broke numpy: https://github.com/pyodide/pyodide/issues/1384
🙈 1
Avatar
Yesterday & Today BOT 02/12/2022 07:00
📆 Yesterday & Today - 12/02/2022 🧵
Avatar
tedpatrick 02/12/2022 13:04
We are having a Pyscript Retrospective at 10AM CST. Here is our last retrospective.
13:06
The same model holds, just add notes into the START, STOP, CONTINUE columns.
Avatar
You want us to pre-fill that retro board..? Or are you just saying that's what we're going to do..?
Avatar
tedpatrick 02/12/2022 13:26
We will make it live in the meeting. If you post something, we will have to speak to it.
13:31
I am going to require special hats are worn during the retrospective. 🤠
Avatar
OK... I'll get my Jean Paul Sartre beret ready...
14:06
...dammit... except one of the kids has walked off with it. 😕
Avatar
FabioRosado 02/12/2022 14:14
My calandar declined the meeting, because I have slotted 2 hours to pickup my son from the nursery, but I am joining while walking home 😄
Avatar
Avatar
FabioRosado
My calandar declined the meeting, because I have slotted 2 hours to pickup my son from the nursery, but I am joining while walking home 😄
tedpatrick 02/12/2022 14:20
Feel free to add items early to the board.
Avatar
Avatar
antocuni
getting somewhere with the importlib problem; the following snippets always file on node on my machine: const { loadPyodide } = require("pyodide"); function busyWait(ms) { let start = new Date().valueOf(); while( (new Date()).valueOf() - start < ms) ; } async function main() { let pyodide = await loadPyodide({ indexURL: "./node_modules/pyodide", }); console.log("Pyodide version: ", pyodide.version); try { pyodide.FS.writeFile('bar0.py', 'x = 0'); pyodide.runPython('import bar0; print(bar0.x)'); // if you uncomment EITHER line, it works //pyodide.runPython('import importlib; importlib.invalidate_caches()'); //busyWait(1000); pyodide.FS.writeFile('bar1.py', 'x = 1'); pyodide.runPython('import bar1; print(bar1.x)'); } catch(e) { console.log(e); } } main(); (edited)
Paul Everitt 02/12/2022 15:23
Sorry, just seeing this. I had it too in my series. It's a bug in the FS mtime stuff I believe. I have to do an importlib clear cache line just after writing to FS.
15:25
FYI, Nicholas and I wrapped up PyCon talk proposal for "Build Yourself a PyScript" and I'm giving a version of it Dec 14 at PyRVA
Avatar
tedpatrick 02/12/2022 17:08
PyScript Retrospective Board...
❤️ 6
Avatar
OK folks... I'm outta here for the weekend. Catch you Monday.
👋 4
🦜 1
Avatar
Paul Everitt 03/12/2022 18:05
I previously learned that Vitest+NodeJS+Happy DOM let me do Pyodide WASM testing. TIL Happy DOM can also handle custom elements. It's a little fiddly, but I can do connectedCallback and friends, without a browser. Shockingly fast, easy to debug.
Avatar
Avatar
Paul Everitt
I previously learned that Vitest+NodeJS+Happy DOM let me do Pyodide WASM testing. TIL Happy DOM can also handle custom elements. It's a little fiddly, but I can do connectedCallback and friends, without a browser. Shockingly fast, easy to debug.
FabioRosado 03/12/2022 18:20
This reminded me, the trick to mKe pyodide not load all the time by using context(I think it was?) was that in playwright or using vitest?
Avatar
Paul Everitt 03/12/2022 18:34
Vitest
Avatar
Paul Everitt 04/12/2022 17:59
@3l3ktr4 Here's an updated tutorial: https://pyodide-components.readthedocs.io/en/latest/project_init.html
  • Sorry, it's about a lot more than just workers.
  • I still need to get the last 7 or so parts moved over.
  • Still needs two more re-writes. At least. 😀
  • Need to do the videos later.
  • Still need to do @antocuni idea about linking to commits per section.
(edited)
❤️ 1
Avatar
Yesterday & Today BOT 05/12/2022 07:00
📆 Yesterday & Today - 12/05/2022 🧵
Avatar
Avatar
Paul Everitt
@3l3ktr4 Here's an updated tutorial: https://pyodide-components.readthedocs.io/en/latest/project_init.html
  • Sorry, it's about a lot more than just workers.
  • I still need to get the last 7 or so parts moved over.
  • Still needs two more re-writes. At least. 😀
  • Need to do the videos later.
  • Still need to do @antocuni idea about linking to commits per section.
(edited)
that's so cool Paul! thank you! it will be my morning read 😄
Avatar
wooh it's so much!
Avatar
Avatar
Paul Everitt
I previously learned that Vitest+NodeJS+Happy DOM let me do Pyodide WASM testing. TIL Happy DOM can also handle custom elements. It's a little fiddly, but I can do connectedCallback and friends, without a browser. Shockingly fast, easy to debug.
faster tests are always good of course. However, keep in mind that we cannot renounce to integration tests: they are needed to guarantee that the final product works as expected inside a browser. So, depending on the detail you might end up having to write the same test twice (one with happy DOM + the "proper" integration test)
12:53
Is the implication in your final sentence: don't worry about unit tests, as you might overlap w/ E2E?
12:55
(I think you mean E2E, not integration) IMO: E2E tests are miserable. Slow, impossible to debug. Not "joyful".
Avatar
tedpatrick 05/12/2022 13:16
More not slow tests... Approved ✅
Avatar
Avatar
Paul Everitt
(I think you mean E2E, not integration) IMO: E2E tests are miserable. Slow, impossible to debug. Not "joyful".
right, I think that E2E is probably a better name for what we currently call "integration" tests.
Avatar
Avatar
Paul Everitt
Is the implication in your final sentence: don't worry about unit tests, as you might overlap w/ E2E?
no sorry, I didn't want to imply that. There are things for which unit tests are more appropriate and things for which E2E tests are more appropriate
Avatar
tedpatrick 05/12/2022 13:30
5 days into doing Advent of Code in PyScript. Observations. 1. 95% Python - The 5% that isn't Python is PyScript boilerplate. 2. Slower but not much, no effect on the challenges 3. Using python -m http server locally requires two refreshes to load code changes. 4. requests in pyscript(via pyfetch/open_url)
Avatar
Paul Everitt 05/12/2022 13:30
FTR: My writeup's workflow was...browser-based test at the close of work.
Avatar
that said, I'm pretty happy with my current E2E tests workflow. Apart from the speed, what is that makes you feeling miserable? This is a genuine question, always looking for ways to improve
Avatar
Paul Everitt 05/12/2022 13:31
When your test breaks, how do you debug it?
13:31
Can you set a break point and step through the test, into the code? (edited)
Avatar
are you talking about Python code or JS code?
Avatar
Paul Everitt 05/12/2022 13:32
With E2E, it's the same (alas) (edited)
Avatar
well no. Debugging JS code is very easy using chrome dev tools
13:33
debugging Python code is hard/impossible given the current state of affairs, but I think you have the same problem even if you run pyodide in node, haven't you?
Avatar
Paul Everitt 05/12/2022 13:33
You can put a debugger line in a Jest test and stop there in dev tools?
Avatar
I'm talking about tests/integration/*.py, they don't use jest. I agree that jest is horrible 😅
Avatar
Avatar
antocuni
well no. Debugging JS code is very easy using chrome dev tools
Paul Everitt 05/12/2022 13:34
I meant on this comment
Avatar
Avatar
antocuni
debugging Python code is hard/impossible given the current state of affairs, but I think you have the same problem even if you run pyodide in node, haven't you?
Paul Everitt 05/12/2022 13:36
Part of my writeup was about building an architecture where you can test Pyodide-based Python, without JS
13:36
I'm doing so in the Collective, for example, using mocks
Avatar
anyway, yes, debugger works. I run tests individually using a command like this: py.test test_01_basic.py -k test_pyscript_hello -s --dev
13:38
and this is the result: the terminal shows nice messages, chrome is automatically launched, dev tools automatically opened and the code stops at the debugger line
Avatar
Avatar
Paul Everitt
Part of my writeup was about building an architecture where you can test Pyodide-based Python, without JS
ah ok, I understand now. But then yes, they serve different purposes. And being able to unit test python custom elements without JS is awesome 😍
Avatar
Paul Everitt 05/12/2022 13:42
That workflow -- editor, terminal, browser, devtools -- is for me a lot of context switching. I'm advocating a "stay in the flow" idea, but I realize, it's a tough pitch to get folks to change.
13:45
The speed is nice too. 😀
Avatar
I'm confused. Are you saying you don't jump from the editor to the browser?
Avatar
Paul Everitt 05/12/2022 13:50
More than that...I don't use the browser
13:50
Until the end, that is, as a sanity check
13:51
Saturday I went for hours without looking at a browser
Avatar
ok, but then I remain convinced that they serve a very different purpose, and that both are needed
Avatar
Paul Everitt 05/12/2022 13:52
Yes, I think some projects have a unit/integration/E2E split...e.g. big Django projects
13:53
One of the things React taught the frontend world (via VDOM, React Native)....the "browser" is an implementation detail, not the exclusive target (edited)
13:55
I'm happy with my "test runs in under a second" workflow, plus my "I can import Python without Pyodide and use regular pytest" workflows. I'll keep polishing, try to see if there's an audience.
👍 1
Avatar
new fetch docs copied inspired from @Jeff Glass here: https://github.com/pyscript/pyscript/pull/1019 😅 (edited)
Avatar
Just to double check with everyone here.... Anything else we need to get in besides https://github.com/pyscript/pyscript/pull/1014 before we are ready to release?
This PR fixes #986. In particular: remove the from pyscript import * into the globals. Instead, import only few carefully selected names preserve backwards compatibility by re-exposing the missing...
Avatar
Avatar
Fabio
Just to double check with everyone here.... Anything else we need to get in besides https://github.com/pyscript/pyscript/pull/1014 before we are ready to release?
FabioRosado 05/12/2022 19:56
My docs PR 😄
👍 2
Avatar
tedpatrick 05/12/2022 20:45
PRs -> Merged -> Test -> Tag Release -> 🙌 🎆 🕙
Avatar
Avatar
madhurt
yes, a few more, let me list them:
Jeff Glass 06/12/2022 03:26
#1017 (fix antigravity example) is ready for review #1006 (py-config location) I dug into a bit more and left some details there. <py-config> should stay in <body,> even if it's not a customElement, due to behavior of non-typical tags in <head> (edited)
✅ 1
Avatar
list of things to be merged before the release, 2 of them require reviews (edited)
Avatar
Avatar
Jeff Glass
#1017 (fix antigravity example) is ready for review #1006 (py-config location) I dug into a bit more and left some details there. <py-config> should stay in <body,> even if it's not a customElement, due to behavior of non-typical tags in <head> (edited)
cool, I didn't touch that then, CCing @Fabio here
👍 1
Avatar
Yesterday & Today BOT 06/12/2022 07:00
📆 Yesterday & Today - 12/06/2022 🧵
Avatar
hey all are we all in favor of creating a changelog system?
Avatar
FabioRosado 06/12/2022 11:03
+1 from me sounds like a good idea 😄
Avatar
Avatar
3l3ktr4
hey all are we all in favor of creating a changelog system?
Jeff Glass 06/12/2022 11:32
Yes please!
Avatar
Paul Everitt 06/12/2022 12:35
FYI: I'm giving a preview of the @ntoll / me PyCon talk "Build Yourself a PyScript" at next week's online PyRVA meetup. Also been invited to Data Science DC meetup in Jan. Big meetup, 14k members.
👍 1
Avatar
@Jeff Glass do you recommend the tool you used on your blogpost for automating it?
Avatar
tedpatrick 06/12/2022 13:27
OK it is go time. Get the PRs in and merged! We are close so lets go. 🙂
Avatar
Avatar
tedpatrick
OK it is go time. Get the PRs in and merged! We are close so lets go. 🙂
Yesss, so a few pending items, gonna tag appropriate people: ^^ if you feel they are ready, please merge, since we follow the rule of the owner of the PR gets to merge it (edited)
🤩 2
Avatar
I'm afk for the whole day. Feel free to proceed and merge my PR
Avatar
Avatar
antocuni
I'm afk for the whole day. Feel free to proceed and merge my PR
aye aye captain, done! (edited)
Avatar
FabioRosado 06/12/2022 13:32
There's also the quickstart PR https://github.com/pyscript/pyscript/pull/985 😄
Avatar
Avatar
FabioRosado
There's also the quickstart PR https://github.com/pyscript/pyscript/pull/985 😄
ok, let me review this one 😅
Avatar
@madhurt I've reviewed it seems fine I just wanted antonio's ok since he gave it I think you can merge it @FabioRosado
Avatar
FabioRosado 06/12/2022 13:38
Its not approved so I cant merge 😛
Avatar
Avatar
FabioRosado
Its not approved so I cant merge 😛
I might override the section headers, so yours should be merged first
Avatar
sorry
Avatar
I have merged @Jeff Glass's antigravity fix 😅
Avatar
done @FabioRosado
Avatar
Avatar
madhurt
I have merged @Jeff Glass's antigravity fix 😅
Jeff Glass 06/12/2022 14:13
Thank you! Sorry I’m a bit off the radar this morning
👍🏼 1
Jeff Glass started a thread. 06/12/2022 14:25
Avatar
Maybe https://github.com/pyscript/pyscript/pull/1008 can also be merged before the release
Avatar
^^We are kinda ready, all items checked, maybe the above PR can be merged too, CCing @Fabio to decide
Avatar
@tedpatrick @FabioRosado @Fabio team meeting..?
17:16
that was sudden
Avatar
join the same link again?
Avatar
tedpatrick 06/12/2022 17:16
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solution used around the world in board, conference, huddle, and training rooms, as well as ex...
Avatar
Can you DM me that in Slack please..?
17:17
(Discord is on the wrong computer for me 😉 )
Avatar
@Jeff Glass added your reference here: https://github.com/pyscript/pyscript/pull/1024
Avatar
Avatar
madhurt
@Jeff Glass added your reference here: https://github.com/pyscript/pyscript/pull/1024
Jeff Glass 06/12/2022 17:35
Thanks! Made one comment... I had a typo in my own dang url 😅
Avatar
Avatar
Jeff Glass
Thanks! Made one comment... I had a typo in my own dang url 😅
hahaha, just fixed 😅
Avatar
Jeff Glass 06/12/2022 17:37
Approved! Thanks for the shout-out
❤️ 1
Avatar
tedpatrick 06/12/2022 18:35
Ok downloaded 'main'... loaded up the examples... 1. Broken - Simple D3 Visualization -> D3 not found? 2. Broken - WebGL Icosahedron Example -> No render call? 3. Broken - Toga Freedom Units -> Has been broken. Can we remove?
Avatar
Avatar
tedpatrick
Ok downloaded 'main'... loaded up the examples... 1. Broken - Simple D3 Visualization -> D3 not found? 2. Broken - WebGL Icosahedron Example -> No render call? 3. Broken - Toga Freedom Units -> Has been broken. Can we remove?
3rd is also mentioned in an issue here: https://github.com/pyscript/pyscript/issues/1009
Avatar
FabioRosado 06/12/2022 18:37
The D3 was broken in the past and then fixed, I think we can point to the .js directly and it works (at least that was the fix in the past) 🤔
18:37
I'll take a look at these
Avatar
tedpatrick 06/12/2022 18:43
I have a fix for D3.
18:44
Avatar
FabioRosado 06/12/2022 19:10
Approved 😄
Avatar
tedpatrick 06/12/2022 19:36
Merged 🧑🌾
Avatar
tedpatrick 06/12/2022 19:51
Locally I am seeing some timing issues. External module loading seems sporatic
Avatar
Yesterday & Today BOT 07/12/2022 07:00
📆 Yesterday & Today - 12/07/2022 🧵
Avatar
D3 is broken because importmap support is broken. There is an issue for that but i can't recall it
Avatar
I just rebuilt my tests and I noticed the "template"-like additions (15 days ago PR) It looks really pretty (thanks Fabio!), but IMO makes the examples less approachable, specially for python coders before in a very minimum stripped down HTML file we had pyscript doing things, it was very direct now we have so much stuff in the file, it looks very convoluted IMO I was thinking a better idea would be to inject this code afterwards, just to have a pretty interface on the web for the users and for the actual examples we have on the repo for running tests etc, we just leave things as they were?
Avatar
FabioRosado 07/12/2022 17:41
The main reason why I thought about changing the examples is because they felt a bit disconnected and it forced people to look at the source code to see what's happening. Now you have that button that you can click to see the minimal code that is being run in the example
Avatar
FabioRosado 07/12/2022 18:11
But if the idea is users look at the repo then yeah it makes things more complicated 😄 doing this once things are loading is a good idea
Avatar
hum yeah I see may be enough! and this is just me overthinking my specific way of using it
Avatar
Yesterday & Today BOT 08/12/2022 07:00
📆 Yesterday & Today - 12/08/2022 🧵
Avatar
It turns out that patching plt.show and using AGG underneath isn't really needed so I have closed the associated PR i.e. https://github.com/pyscript/pyscript/pull/1023 I have commented on the original issue i.e. https://github.com/pyscript/pyscript/issues/983 on how to use display correctly. If someone else can confirm that my proposed way works, we can close https://github.com/pyscript/pyscript/issues/983 CCing @FabioRosado since he reviewed https://github.com/pyscript/pyscript/pull/1023 originally
11:05
^^but in any case, if we need to patch plt.show, I can re-open the PR but I support using display for all purposes. Hence, I closed the PR for the patch
Avatar
tedpatrick 08/12/2022 11:09
@madhurt Just tested it, working great.
Avatar
Avatar
tedpatrick
@madhurt Just tested it, working great.
okay great, we can close the issue then, and probably document somewhere on how to use display correctly with matplotlib
Avatar
tedpatrick 08/12/2022 11:10
👍🏼 1
Avatar
great, so there was no issue to begin with 😅
Avatar
tedpatrick 08/12/2022 11:12
Best kind of issue
🤣 1
11:12
Release Readiness??
Avatar
I guess I can add this display thing to the docs and then we should be good to go?
Avatar
tedpatrick 08/12/2022 11:13
Add it to docs now. What else?
Avatar
yes, adding, one sec, otherwise https://github.com/pyscript/pyscript/pull/1008 is optional I guess
Avatar
tedpatrick 08/12/2022 11:17
Let's check with @Fabio in a bit. What else?
Avatar
nothing else IMO
Avatar
tedpatrick 08/12/2022 11:17
It feels like we are close here
11:18
Lets prep things, we might go today if things align.
11:18
Let's focus on closing issues til then.
Avatar
okay, just gonna submit a PR on how to use display with matplotlib in the meanwhile.
✅ 1
Avatar
tedpatrick 08/12/2022 11:20
But we should all spend some time testing things today. Take a deep look at the examples and issues.
👍🏼 1
🔬 1
Avatar
https://github.com/pyscript/pyscript/pull/1029 is up for a quick approval (edited)
✅ 1
Avatar
tedpatrick 08/12/2022 13:11
@madhurt Yours to merge
Avatar
tedpatrick 08/12/2022 13:39
TIME FOR 2022.12.1.RC1
13:40
As soon as tests build and version is updated to 2022.12.1.RC1, I will publish a snapshot
Avatar
tedpatrick 08/12/2022 13:49
RC1 Merged
✅ 1
13:53
Once RC1 deploys (running now), I will build a snapshot as https://pyscript.net/snapshots/2022.12.1.RC1/ (edited)
Avatar
tedpatrick 08/12/2022 14:01
RC1 is now on /unstable
14:03
Building RC1 Snapshot
14:07
Avatar
Woop woop
Avatar
Avatar
tedpatrick
Let's check with @Fabio in a bit. What else?
On release readiness?
Avatar
Avatar
Fabio
On release readiness?
tedpatrick 08/12/2022 14:25
On the PR for plugins still outstanding.
👍 1
14:32
We are feature complete for a release of PyScript this week. We need your help testing 2022.12.1. How to test 2022.12.1.RC1 &lt;link rel=&quot;stylesheet&quot; href=&quot;https://py...
👍🏼 2
Avatar
^^we can mention about fetch too
✅ 1
Avatar
tedpatrick 08/12/2022 14:35
Are there docs on fetch?
Avatar
yeah, it's available within py-config
Avatar
@Jeff Glass -- reminder to publish the blog on the production URL -- which is linked in the above docs, currently its 404, we should do it after the release though
Avatar
Avatar
madhurt
@Jeff Glass -- reminder to publish the blog on the production URL -- which is linked in the above docs, currently its 404, we should do it after the release though
Jeff Glass 08/12/2022 15:01
Thank you! It’s ready and waiting as soon as the release goes live
🎉 1
Avatar
tedpatrick 08/12/2022 15:26
TEST, TEST, TEST
15:31
🤣 1
Avatar
lol
Avatar
tedpatrick 08/12/2022 16:32
In local running make test-integration, I get a consistent failure in TestConfig.test_runtime_config FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/c1/br776hbd0llfk_l01ckngqvm0000gp/T/tmp92ipi5ml/pyodide-build-0.20.0.tar.bz2'
Avatar
Avatar
tedpatrick
In local running make test-integration, I get a consistent failure in TestConfig.test_runtime_config FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/c1/br776hbd0llfk_l01ckngqvm0000gp/T/tmp92ipi5ml/pyodide-build-0.20.0.tar.bz2'
Jeff Glass 08/12/2022 16:40
I have gotten that for a couple months, testing on Ubuntu 22.04 LTS locally. Seems to be some missing dependency?
Avatar
Avatar
Jeff Glass
I have gotten that for a couple months, testing on Ubuntu 22.04 LTS locally. Seems to be some missing dependency?
tedpatrick 08/12/2022 16:41
I recall this is related to runtime work by @madhurt
Avatar
Jeff Glass 08/12/2022 17:06
Simple panel example pops up a py-terminal with the message: /lib/python3.10/site-packages/pyodide/__init__.py:74: FutureWarning: pyodide.to_js has been moved to pyodide.ffi.to_js Accessing it through the pyodide module is deprecated. warn(
17:06
Think it's just a version bump needed on panel, investigating now
Avatar
Avatar
tedpatrick
In local running make test-integration, I get a consistent failure in TestConfig.test_runtime_config FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/c1/br776hbd0llfk_l01ckngqvm0000gp/T/tmp92ipi5ml/pyodide-build-0.20.0.tar.bz2'
sorry for late reply, you can just clear the pytest cache
17:09
basically, we cache pyodide 0.20 for subsequent runs, so that it's not downloaded each time for that test
17:09
the test fails because cache is trying to look for the folder where it downloaded it, but that temporary directory doesn't exist anymore
Avatar
Avatar
madhurt
the test fails because cache is trying to look for the folder where it downloaded it, but that temporary directory doesn't exist anymore
tedpatrick 08/12/2022 17:11
Ah... So running tests in parallel might break that test?
Avatar
so the first time it's run, it will download and cache it, the next subsequent runs will avoid re-downloading so in theory, parallel or not parallel shouldn't make a difference
17:12
because it's running just once in either way
Avatar
Avatar
madhurt
because it's running just once in either way
tedpatrick 08/12/2022 17:13
I am seeing it fail everytime locally.
Avatar
have you cleared the cache ?
17:14
do rm -rf .pytest_cache/ inside pyscriptjs directory
✅ 1
17:15
and then re-run the test again (edited)
✅ 1
Avatar
tedpatrick 08/12/2022 17:15
running
Avatar
this doesn't fail on CI (and will never in theory) because each CI invocation is a new instance aka for the test, it's a new machine --> download each time it's basically just to speed up local development
Avatar
OK... I'm off in a moment. But before I leave... it's been a long time coming... lots of different parts to arrange and gather together... but here's some PolyPlug message passing working in the browser with MicroPython. Still lots to do, but this is the first time bits have all been plugged together. So far so good and more to come... 👍
🤯 2
17:19
TL;DR stdout from MicroPython emits JSON, and polyplug is listening.
Avatar
Avatar
ntoll
OK... I'm off in a moment. But before I leave... it's been a long time coming... lots of different parts to arrange and gather together... but here's some PolyPlug message passing working in the browser with MicroPython. Still lots to do, but this is the first time bits have all been plugged together. So far so good and more to come... 👍
demos and walkthrough soon 🤩
Avatar
Need to make it work the other way around by plugging in DOM events to MicroPython... but that's "only" a plumbing problem to connect things together so functions in MicroPython get called when stuff happens in the DOM. That's already in polyplug but need to integrate it into the work I did in MicroPyScript.
Avatar
tedpatrick 08/12/2022 17:21
@madhurt Cleared cache and all tests passing.
17:21
Thanks
Avatar
Avatar
tedpatrick
@madhurt Cleared cache and all tests passing.
great, I should document this somewhere I think
Avatar
tedpatrick 08/12/2022 17:22
@FabioRosado Was toga_freedom removed?
Avatar
FabioRosado 08/12/2022 17:23
it was removed from the examples site but its still there and working
Avatar
Current state of the MicroPython end of things: import json def output(content): print(json.dumps({"type": "stdout", "content": content})) As you can see, it's very simple. But this will soon get built out and improved to cater to all the message types polyplug understands (updating DOM elements, registering events etc...)
17:28
Anyway.... catch you lovely folk tomorrow. 👋
👋🏼 2
Avatar
sorry, I totally got distracted in the past few days and forgot to wrap up the plugins PR. It should be mostly done...
Avatar
Avatar
Jeff Glass
Think it's just a version bump needed on panel, investigating now
Jeff Glass 08/12/2022 17:35
#1032 (Bump version of panel from 13.1 -> 14.1) is up for a quick review: https://github.com/pyscript/pyscript/pull/1032
Avatar
Avatar
Jeff Glass
#1032 (Bump version of panel from 13.1 -> 14.1) is up for a quick review: https://github.com/pyscript/pyscript/pull/1032
approved!
🤘 1
Avatar
Ok, https://github.com/pyscript/pyscript/pull/1008 is done. If y'all are happy with it (@FabioR already approved and I added a few test) we can merge
Unescape the tag content before actually running markdown and actually explicitly import console since we now are importing pyscript as a module
Avatar
merged
Avatar
tedpatrick 08/12/2022 19:59
Ok if I simply do another snapshot to RC1?
👍 3
✅ 1
Avatar
tedpatrick 08/12/2022 23:19
Ok I have run all the examples and seeing no issues, no failed tests local or in CI. We are looking very good for release
23:19
If there are no issues in testing tomorrow, I vote we go.
👍🏼 1
Avatar
Yesterday & Today BOT 09/12/2022 07:00
📆 Yesterday & Today - 12/09/2022 🧵
09:46
(based on pyodide, so we can probably re-use it)
Avatar
That's pretty damn awesome.
Avatar
FabioRosado 09/12/2022 11:41
Ah I loooove pythontutor (didn't know they had a module!), it helped me a bunch when I was trying to get my head around basics and then algos 😄 https://pythontutor.com
Avatar
From what I understood the basthon developer took pythontutor and packaged it in such a way to make it usable by pyodide
Avatar
tedpatrick 09/12/2022 14:26
When we talk about Frameworks over PyScript... There is a notebook paradigm to be built.
☝️ 1
Avatar
Yes. This.
Avatar
Avatar
tedpatrick
When we talk about Frameworks over PyScript... There is a notebook paradigm to be built.
something loosely related is the approach we take regarding matplotlib in pyscript vs jupyterlite and consequences of merging these two approaches. And this also touches on switching to AGG (this discussion will come up when we start talking about web-workers) : https://github.com/pyscript/pyscript/issues/983#issuecomment-1343948823 just mentioning here 😅
Avatar
tedpatrick 09/12/2022 15:29
I would love to see one focused on the notebook and not designed like windows 95. 🙂
Avatar
tedpatrick 09/12/2022 15:31
Kids these days!
Avatar
Jeff Glass 09/12/2022 15:55
You laugh… I’m currently troubleshooting a room full of XP machines 😬
😫 1
Avatar
Avatar
Jeff Glass
You laugh… I’m currently troubleshooting a room full of XP machines 😬
tedpatrick 09/12/2022 15:55
Vintage Cluster! 🙂
Avatar
This is so common... XP is still found in many UK schools.
Avatar
I once, in 2013, a project to revamp [pharma] industrial machines controlled by one of the first Windows 3.1 betas (BETA!) to whatever Windows was the pro version in 2013. One of the most 💩 jobs I've ever had to do... 😄
Avatar
Question here before I open a discussion issue on GH. If you had to design a dom manipulation/interaction API, what tools/libraries/APIs would you take inspiration from? I.e., I think playwright api to navigate and access elements is pretty nice...
Avatar
A good question... please do tell... something I'm (literally right now) thinking about / spiking.
Avatar
Oh lordy lord... just had an update about the Brazil/Croatia game...
17:02
(from my son)
17:02
😬
Avatar
It was SOOOOOOOO hard to keep my face straight during meetings with my TV on lol
17:23
You have no idea of my reaction to the goal (yes, that is a side of my brazilian half that is VERY MUCH imprented in my soul 🙂 )
Avatar
GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
17:24
iamiright?
17:25
(I can hear Will downstairs, watching the game)
Avatar
eheehhehe yes, plus a few cursing/celebration words and expressions... and jumping and shaking my wife 😄 😄 😄 😄
Avatar
It's not over yet... 😛
Avatar
Don't even...
17:27
btw, @ntoll want to pair on Monday on crazy ideas about that dom/web API discussion? Had a little session with @FabioRosado yesterday and I think it was good
Avatar
Happy to... I'm just trying to finish up some Python code related to this for PolyPlug (DOM/Python bridge). Would be good to explain it to you/get feedback/pair on cleaning up my mess. 😉
Avatar
Sounds great! Now I just need to figure out a way to move one of the bricks in my meetings wall 🙂
Avatar
FabioRosado 09/12/2022 17:30
Dont hve to worry about meetings, if you decline all meetings! https://tenor.com/view/feel-me-think-about-it-meme-gif-7715402 (edited)
Avatar
OMG @ntoll .... you jinxed it! I totally blame you!
17:31
Croatia scored! 😦
Avatar
Hahaha... don't look at me..! It's the fellers in the yellow shirts on the pitch.
17:32
Penalties is just the worst.
Avatar
Now I remember why I haven't been following soccer for the past 8 years
Avatar
OK... now I have the match up... those damn unit tests can wait. 😄
😅 1
17:35
Anthony. 😬
17:37
Oh my. Penalties.
Avatar
OK... the BBC live stream on the web is about a minute lagged. Watching this downstairs on the TV with Will.
17:47
ZOMFG
Avatar
and there you go 😐 Let's focus on PyScript 😄
Avatar
Heh... amen. Back to those unit tests for me... they won't write themselves. Commiserations to Brazil... definitely the better team, but those jammy Croats. 🇧🇷 😢
Avatar
Kudos to them... we had it in the bag but lost because of ourselves.
Avatar
Oh man... you wait for England v France. I won't be able to watch.
😅 1
Avatar
Jeff Glass 09/12/2022 19:14
How are we feeling about a release? Any burning fires still to be put out?
Avatar
Avatar
Jeff Glass
How are we feeling about a release? Any burning fires still to be put out?
I guess we are waiting for RC1 to settle
Avatar
@Fabio here you go: https://github.com/pyscript/polyplug see polyplug.py for my initial thoughts... with tests too. https://github.com/pyscript/polyplug/blob/main/polyplug.py Still very much a work in progress... but it's sort of Pythonic DOM API that's built from a JSON representation created in the JS end of things (see polyscript.js and associated tests)
Avatar
Avatar
madhurt
Jeff Glass 09/12/2022 19:33
Approved!
Avatar
With that... Mary's home and it's now the weekend. Gotta cook her dinner... Catch you lovely folks on Monday. 👋
👋 1
🦜 1
Avatar
Avatar
ntoll
With that... Mary's home and it's now the weekend. Gotta cook her dinner... Catch you lovely folks on Monday. 👋
Happy Weekend Nick!
Avatar
You too!
🙌🏼 1
Avatar
Avatar
Fabio
Question here before I open a discussion issue on GH. If you had to design a dom manipulation/interaction API, what tools/libraries/APIs would you take inspiration from? I.e., I think playwright api to navigate and access elements is pretty nice...
I'm not an expert, but I'd take a look at lxml's elementtree API. It's likely more pythonic than all the JS counterparts
Avatar
Avatar
Fabio
Question here before I open a discussion issue on GH. If you had to design a dom manipulation/interaction API, what tools/libraries/APIs would you take inspiration from? I.e., I think playwright api to navigate and access elements is pretty nice...
tedpatrick 09/12/2022 22:00
The first widely adopted dom api was jquery. It benefited from chainability and a plugin model.
Avatar
Avatar
Fabio
Question here before I open a discussion issue on GH. If you had to design a dom manipulation/interaction API, what tools/libraries/APIs would you take inspiration from? I.e., I think playwright api to navigate and access elements is pretty nice...
tedpatrick 09/12/2022 22:02
As far as keys for our use, it needs to support multiple backends for main/worker use.
Avatar
Avatar
tedpatrick
As far as keys for our use, it needs to support multiple backends for main/worker use.
Yeah, I've used lxml in the past quite a bit. Some aspects are 👍 but most of it definitely does not feel very Pythonic.
Avatar
The problem here (as I've encountered so far this week), is also "small" things (i.e. "big" things) like naming... nodeType (in the world of the web) vs. node_type if we use the Pythonic naming conventions... or element.attributes.class (i.e. <div class="myCssClass"> in HTML) vs. element.attributes.class (causing a SyntaxError because of the use of the keyword "class") in Python. (edited)
10:20
My rule of thumb is: name things as they are in the web (for familiarity reasons), but the data structures and operations related to them try to follow "Pythonic" conventions, as well as the "old chestnut"... keep easy things easy, make difficult things easier. @tedpatrick I like the mention of jQuery. I remain a fan of that "framework", but that's probably because I'm old and don't care for new fangled JS (damn kids... get off my lawn, etc...)
✅ 1
10:22
FWIW - PolyScript = no dependencies, vanilla JS, comments, lots of tests, simple and obvious. Built for change. Still a work in progress.
10:23
Also, 👋 @antocuni over on the Python discord. Composing an answer right now. Brett and I have been talking about PEP-11 and getting CPython (Christian's work) to tier 2.
✅ 1
Avatar
Ciao belli! (For transparency: @antocuni and I are part of the PyScript team at Anaconda - I’m mostly working with MicroPython in a WASM context at the moment, although this will likely change in the new year.) Some random, high level thoughts that could probably do with refining: 👍 on web-assembly as basically just another CPU target. OS - ...
Avatar
tedpatrick 10/12/2022 17:07
This cowasm is pretty interesting, includes python 3.11 and lua. https://cowasm.sh/
👀 1
17:11
Esp this element... If you have node 16+ npx python-wasm@latest
17:11
Avatar
FYI, working on a tutorial proposal for PyCon. If others are planning on submitting something, if possible, let's collaborate rather than having multiple proposals on the same thing and end up excluding each other. 😉
Avatar
Cowasm is/was zython.
Avatar
Yesterday & Today BOT 12/12/2022 07:00
📆 Yesterday & Today - 12/12/2022 🧵
Avatar
tedpatrick 12/12/2022 12:59
TEST,TEST,TEST - Focus on testing and bugs.
Avatar
tedpatrick 12/12/2022 13:07
Batch limit 🧵
Avatar
@tedpatrick @FabioRosado (and anyone who wants to be around), Nicholas and I are pairing on higher level Python web APIS, web workers, etc..
Avatar
I'm interested
16:10
@Fabio what's the link?
Avatar
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solution used around the world in board, conference, huddle, and training rooms, as well as ex...
16:10
Let's hope your connection holds 😄
Avatar
I moved my modem on the terrace (in the snow 😂)
😅 2
Avatar
OK... that was a fun chat. Thanks for all the input and feedback..! 👍
Avatar
Thank you both! It was definitely good
Avatar
This is my poor 4g modem doing its best to give me a stable connection ❄️
⛷️ 2
Avatar
ahaahahahahahahahaah
Avatar
No wonder you're having problems @antocuni - it looks more like a chair than a modem..!
🤣 2
Avatar
the modem is on top of chair, I didn't want to see what happens if I put it directly in the snow 😂
Avatar
He's using the chair as an antena
Avatar
It's a (mostly) wooden chair... best of luck with that... 😄
Avatar
..... but is it? lol
Avatar
tedpatrick 12/12/2022 17:52
Is that Starlink 0.3?
🤣 2
Avatar
Avatar
tedpatrick
Is that Starlink 0.3?
that's actually a good suggestion. I will investigate whether starlink is a solution 🙂
Avatar
@tedpatrick @hood just told me that apparently he doesn't have the right permissions to post on this channel. He wanted to share his ideas on the Batch limit thread
✅ 1
18:39
could you please fix his permissions?
Avatar
tedpatrick 12/12/2022 18:58
Solved. @hood should be able to post here now. (edited)
🙏 1
19:03
Get Starlink, Move to mountains, Profit. Let's go.
Avatar
https://github.com/pyscript/pyscript/pull/1041 can be merged too before the release ready for review ✅ (edited)
Avatar
Avatar
madhurt
https://github.com/pyscript/pyscript/pull/1041 can be merged too before the release ready for review ✅ (edited)
@tedpatrick
Avatar
^^merged!
Avatar
tedpatrick 12/12/2022 21:29
Excellent.
21:29
We will be deploying 2022.12.1 tomorrow AM. 🙂
🚀 2
🎉 3
Avatar
Avatar
Fabio
FYI, working on a tutorial proposal for PyCon. If others are planning on submitting something, if possible, let's collaborate rather than having multiple proposals on the same thing and end up excluding each other. 😉
Paul Everitt 12/12/2022 22:34
If you need worker bee minions during tutorial, let me know
👍 2
😍 1
Avatar
Yesterday & Today BOT 13/12/2022 07:00
📆 Yesterday & Today - 12/13/2022 🧵
Avatar
welcome @hood! sorry for the workshop not working 😦 such a bummer
Avatar
uh, I have 46 unread pyscript github notifications 😱 (edited)
Avatar
TIL: if you set your discord language to "English/UK" instead of "English/US", it shows sane european dates
Avatar
heh? you mean the thread dates?
Avatar
the dates shown next to the author of messages
14:32
k that's useful 🙂
Avatar
Yeah... sensible dates. It's a thing. 😉
14:47
US format = dates from Yoda's home planet. ("mmMMMmmm.... From home planet Yoda's dates") 😛
🤣 2
Avatar
tedpatrick 13/12/2022 15:14
Release 2022.12.1 starts at 9:30am...
Avatar
tedpatrick 13/12/2022 15:42
Release is building
Avatar
tedpatrick 13/12/2022 16:01
During the release we encountered a permission error in writing to S3 for /examples and docs. We have informed Infra team and awaiting a permission change. Once the permission changes, we will rerun these failed jobs. /latest looks to be on 2022.12.1
Avatar
Avatar
tedpatrick
During the release we encountered a permission error in writing to S3 for /examples and docs. We have informed Infra team and awaiting a permission change. Once the permission changes, we will rerun these failed jobs. /latest looks to be on 2022.12.1
Paul Everitt 13/12/2022 16:08
That's rough. These things are really hard, so many niggling things.
Avatar
Avatar
Paul Everitt
That's rough. These things are really hard, so many niggling things.
tedpatrick 13/12/2022 16:09
So everything worked perfect, less examples + docs. We have isolated it as purely permissions on S3. Easy fix. We are going slow. (edited)
🥳 1
16:10
This is NOT BORING. I cannot like it.
16:14
Once Peter Wilson is in we will address permission and rerun the failed jobs
16:14
Release looks good
16:15
NO PUSHING code or PRs Until we are done with release
👍🏼 2
Avatar
tedpatrick 13/12/2022 17:02
We modified the permissions and re-ran examples and docs. We are good! ✅
🥳 2
17:02
Version 2022.12.1 This release adds <py-repl> editor upgrade <py-env> removed upgrade pre-commit deps directory listing in releases hide py-{element} in css til defined cache, fetch, r...
Avatar
Jeff Glass 13/12/2022 17:04
Excellent!
Avatar
@Jeff Glass You should publish the blog too, if its not live already 😅
Avatar
Jeff Glass 13/12/2022 17:05
Doing final link testing now that the release is live; will push it soon!
👍🏼 1
17:24
Another turn of the seasons, another big release for @pyscript_dev! 2022.12.1 is out today. Several great new features, a handful of breaking changes, and some great new #PyScript community features. Let’s take a look🧵 https://t.co/hlVN5eUKP1
Avatar
tedpatrick 13/12/2022 17:37
Amazing work on the 2022.12.1 release by everyone here. I am pretty sure every line of code was touched and there are 3x the number of integration tests. Thanks 🙏
17:43
And in preparing a PR to return to 2022.12.1.dev, I discovered that admins can push to main. Just enabled branch protections for all users.
17:43
Fixed.
Avatar
Thank you all and thank you @tedpatrick . What a release! ❤️
🔥 1
🎄 2
Avatar
FabioRosado 13/12/2022 22:30
Just seen this on twitter https://github.com/widgetti/reacton A react way to make python based components with ipywidgets
A pure Python port of React for ipywidgets. Contribute to widgetti/reacton development by creating an account on GitHub.
Avatar
Yesterday & Today BOT 14/12/2022 07:00
📆 Yesterday & Today - 12/14/2022 🧵
Avatar
Avatar
FabioRosado
Just seen this on twitter https://github.com/widgetti/reacton A react way to make python based components with ipywidgets
I like the idea of reactive apps, but the syntax/API they use is very ugly IMHO 😅. For comparison, have a look at kivy, and in particular its Pong example: here, you define a PongBall widget with a property pos and you use this property in the UI file. When you update pos in the code, the UI is automatically updated https://kivy.org/doc/stable/tutorials/pong.html#pongball-class
Avatar
also, it's worth mentioning that jupyterlite and thus ipywidget run in a webworker: we should investigate how they manage the DOM interaction
Avatar
Avatar
antocuni
I like the idea of reactive apps, but the syntax/API they use is very ugly IMHO 😅. For comparison, have a look at kivy, and in particular its Pong example: here, you define a PongBall widget with a property pos and you use this property in the UI file. When you update pos in the code, the UI is automatically updated https://kivy.org/doc/stable/tutorials/pong.html#pongball-class
tedpatrick 14/12/2022 14:18
In Flex we had 2 languages. AS(ES4 dialect) was imperative and MXML(xml) was declarative but compiled to AS. The declarative language allowed you to define UI state and bindings(reactive). And this declarative format appears in React as JSX/TSX and within .vue files in Vue. I feel we lack a declarative language/markup over python to properly build reactive applications. 🐰🕳 (edited)
Avatar
Avatar
tedpatrick
In Flex we had 2 languages. AS(ES4 dialect) was imperative and MXML(xml) was declarative but compiled to AS. The declarative language allowed you to define UI state and bindings(reactive). And this declarative format appears in React as JSX/TSX and within .vue files in Vue. I feel we lack a declarative language/markup over python to properly build reactive applications. 🐰🕳 (edited)
+1 for having a declarative language
Avatar
More WASM/packaging discussions on the CPython discourse forum, if you are interested: https://discuss.python.org/t/support-wasm-wheels-on-pypi/21924
👍 2
Avatar
Stepping away early for dad-taxi reasons. Catch you lovely folk tomorrow. 👋
👋🏼 1
🦜 1
Avatar
Yesterday & Today BOT 15/12/2022 07:00
📆 Yesterday & Today - 12/15/2022 🧵
Avatar
Paul Everitt 15/12/2022 21:36
The wa-sqlite build produces ES6 modules, which is nice for development. But most applications should put time-consuming operations in a Worker, and support for ES6 modules in a Worker isn&#39;...
Avatar
Yesterday & Today BOT 16/12/2022 07:00
📆 Yesterday & Today - 12/16/2022 🧵
Avatar
Given: <form id="inputForm"> <label for="english">Translate English 🇬 🇧 to Pirate speak 🏴<200d>☠️:</label> <input type="text" name="english" id="english" placeholder="Type English here..." /> <input type="submit" value="Translate"/> <div id="output"></div> </form> <py-script> import arrr from polyplug import plug, update, receive @plug("#inputForm", "submit") def handle_form(event): """ Take the English input from the form, turn it into Pirate talk and update the DOM with the result. """ english = event.target.find("#english").value pirate_text = arrr.translate(english) output = event.target.find("#output") output.innerHTML = f"<p>{pirate_text}</p>" update("#output", output) </py-script> <div id="arrr"/> We get....
🤯 1
15:10
Note the simple Python based DOM API (found at event.target)
15:10
Uses jQuery like shortcuts for #id, .classes and other cool things.
Avatar
wow pretty cool!
Avatar
Next steps (post Xmas - put it on a web-worker)
15:32
By the way... it also works with Pyodide. 😉
15:37
Here's a screenie of this in action.
Avatar
Here's what it's like an a mobile phone:
15:49
Direct link to the app: https://ntoll.org/static/pirate/
Avatar
That's great @ntoll !!! 👏
Avatar
Thank you.
Avatar
tedpatrick 16/12/2022 16:36
This is too good. I need to start my weekend early.
Avatar
On the topic of micropython, I have some work towards building the pyodide FFI as a static library. Does micropython accept normal C extensions? Presumably once I get libpyodide set up correctly we could just link it into micropython and get the Pyodide FFI working there.
Avatar
Ah but it looks like the micropython C API is completely different so maybe this is a total nonstarter
Avatar
yes exactly, AFAIK the C API is completely different (and I don't know how powerful/mature it is)\
20:36
but it might be possible to reuse parts of it
20:36
for sure the whole hiwire, which IIRC it is not CPython-specific
Avatar
Yesterday & Today BOT 19/12/2022 07:00
📆 Yesterday & Today - 12/19/2022 🧵
Avatar
Ok... I'm trying to wrap up the PR around the new PyTutor plugin that basically automates the "show code" feature we have in our examples.. I'm trying to check but we didn't have any tests for that feature, did we?
17:28
If so, I can't find them...
Avatar
Avatar
Fabio
Ok... I'm trying to wrap up the PR around the new PyTutor plugin that basically automates the "show code" feature we have in our examples.. I'm trying to check but we didn't have any tests for that feature, did we?
Jeff Glass 19/12/2022 17:59
I don't believe we did, no - if memory serves, Fabio R basically made each one by hand, nothing centralized to test
Avatar
Ok. Yeah, that's what I've seen as well. I want to at least have some minimal tests but there are some extra complications to sort out to have decent testing for this. Thanks @Jeff Glass
Avatar
Avatar
hood
Ah but it looks like the micropython C API is completely different so maybe this is a total nonstarter
Correct, and for good reason. Damien (with the help of the wider community) has thought a lot about the design decisions - but please remember they're decisions made for the context of microcontrollers, which might as well be an alien planet when contrasted with where "real" Python usually runs.
🎄 1
20:12
(returning to holiday mode) 🙂
👏 1
Avatar
I have been playing with pyodide zipimport2 branch, which distribute the stdlib as .pyc files instead of .py. IIRC, when I tried to use it under node.js in Paris, it showed a 2x speedup on startup time
23:08
but using it inside pyscript doesn't seem to give the same good results
23:09
if you are curious, the files are hosted here: https://github.com/antocuni/files/tree/gh-pages/pyodide
Misc files which I want to host on gh pages. Contribute to antocuni/files development by creating an account on GitHub.
👍 1
23:10
and I'm using these three tests as a benchmark: def test_default(self): self.pyscript_run( """ <py-script> print('hello pyscript') </py-script> """ ) def test_gh_pages_0_21_3(self): self.pyscript_run( """ <py-config> [[runtimes]] name = "pyodide-0.21.3" src = "https://antocuni.github.io/files/pyodide/0.21.3/pyodide.js" lang = "python" </py-config> <py-script> print('hello pyscript') </py-script> """ ) def test_gh_pages_zipimport2(self): self.pyscript_run( """ <py-config> [[runtimes]] name = "pyodide-0.22.0.dev0-zipimport2" src = "https://antocuni.github.io/files/pyodide/0.22.0.dev0/zipimport2/pyodide.js" lang = "python" </py-config> <py-script> print('hello pyscript') </py-script> """ )
23:12
I use this command line to run the tests, and look at how much time it takes to display hello pyscript on the console: $ py.test tests/integration/test_01_basic.py -k test_default -s --no-fake-server [...] [ 7.12 console.log ] hello pyscript
23:14
--no-fake-server is needed, else the fake server caches the requests (and part of the speedup should come by the fact that .pyc are smaller)
23:16
I get the following results on my machine: test_default: 5.29 seconds test_gh_pages_0_21_3: 6.40 seconds test_gh_pages_zipimport2: 4.30 seconds But I have a very unstable 4g connection, so I don't know how real these numbers are
23:17
it would be nice if anybody could try to run them and share their results
23:18
I realize only now that this should have been a thread 🧵 🤦‍♂️ . Too late, sorry for that. Time to go sleeping 💤
Avatar
FabioRosado 19/12/2022 23:58
This is interesting I’ll run the tests tomorrow and share the results here 😄
Avatar
Yesterday & Today BOT 20/12/2022 07:00
📆 Yesterday & Today - 12/20/2022 🧵
Avatar
>But I have a very unstable 4g connection, so I don't know how real these numbers are this sounds like something that would make the numbers very unreal actually
Avatar
FabioRosado 20/12/2022 11:46
today I learned. If you add a path to plugins to fetch a python plugin, they get loaded correctly because we are using the same fetch logic as py-config 😄
Avatar
Avatar
antocuni
I get the following results on my machine: test_default: 5.29 seconds test_gh_pages_0_21_3: 6.40 seconds test_gh_pages_zipimport2: 4.30 seconds But I have a very unstable 4g connection, so I don't know how real these numbers are
FabioRosado 20/12/2022 11:52
timings for me: test_default: 2.52s (without --no-fake-server between 3-4s) test_gh_pages_0_21_3: 2.51 ( without --no-fake-server 3.9-4s) test_gh_pages_zipimport2: 2-3s (without --no-fake-server 2.88s)
Avatar
Avatar
FabioRosado
timings for me: test_default: 2.52s (without --no-fake-server between 3-4s) test_gh_pages_0_21_3: 2.51 ( without --no-fake-server 3.9-4s) test_gh_pages_zipimport2: 2-3s (without --no-fake-server 2.88s)
So, no speedup at all with zipimport? This is unexpected 😦
Avatar
FabioRosado 20/12/2022 12:11
Yeah looks like it 🤔
12:13
Although... the speed difference seems to occur when we don't use the --no-fake-server
Avatar
I start to wonder whether I built the wrong branch 😅
Avatar
Avatar
FabioRosado
Although... the speed difference seems to occur when we don't use the --no-fake-server
Are your results consistent? Like, you get the ~same numbers every time you run them?
Avatar
FabioRosado 20/12/2022 13:27
there's a slight difference in milliseconds but yeah they have been quite consistent
Avatar
tedpatrick 20/12/2022 14:43
Nothing like pressing the "Getting Started" button on Github Discussions and having it set discussions to enabled.
Avatar
@FabioRosado you want to take a last look at https://github.com/pyscript/pyscript/pull/1040 before we merge or you feel good about it?
Close #1039 It's ready for a first review... It's missing tests, that I'll add tomorrow though.
Avatar
Avatar
Fabio
@FabioRosado you want to take a last look at https://github.com/pyscript/pyscript/pull/1040 before we merge or you feel good about it?
FabioRosado 20/12/2022 15:42
Just had a quick look I think we are good to merge 😄
Avatar
Avatar
FabioRosado
Just had a quick look I think we are good to merge 😄
Perfect. Thank you! For everyone else, if we mess up the examples it "Fabio" 's fault 😄 😄 😄
Avatar
FabioRosado 20/12/2022 15:44
haha
Avatar
Avatar
Fabio
@FabioRosado you want to take a last look at https://github.com/pyscript/pyscript/pull/1040 before we merge or you feel good about it?
it lacks tests 😦 (the checks done inside test_zz_example are by far not enough, IMHO) (edited)
Avatar
hey folks is meeting now?
16:32
or am I lost
16:33
is it an hour from now? 🤔
Avatar
Avatar
3l3ktr4
hey folks is meeting now?
we just finished the meeting
Avatar
what!
17:25
haha wow I'm sorry
Avatar
timezone confusion I guess 😅
17:25
I was "there"
17:25
I think I might have joined
17:26
the ipywidgets meeting
17:26
that's always at the same time
17:26
idk what happened honestly
17:26
I'm tired
Avatar
have a good rest 🙂
Avatar
thanks :)!
Avatar
for the people who were in the meeting: this is the discussion which I mentioned about webworkers and synchronous communication channels: https://github.com/pyodide/pyodide/issues/1503#issuecomment-1354568229
Tons of existing APIs for IO are synchronous. For instance, the http.server API #140. Also, basic things like input() and any tool that expects to do CLI interaction are based around synchronous IO...
Avatar
Avatar
antocuni
it lacks tests 😦 (the checks done inside test_zz_example are by far not enough, IMHO) (edited)
Yes, I added comments about it. We need to do some work to add better plugins unit tests Tbh, the tests in the PR are by far better/more than before (None). So I'd rather merge it as is and add later (anyone can do it) than keep a PR stale for days/weeks
Avatar
Avatar
Fabio
Yes, I added comments about it. We need to do some work to add better plugins unit tests Tbh, the tests in the PR are by far better/more than before (None). So I'd rather merge it as is and add later (anyone can do it) than keep a PR stale for days/weeks
My personal idea is that "write code now, add tests later" never works. TDD is a much better approach not because "someone wrote it in a book" but because it ensures that all the behaviors that you care about is actually tested, so it leads to a better code quality in the long run. But it seems that I'm losing this battle inside the pyscript team 😅 🤷‍♂️
Avatar
Avatar
antocuni
My personal idea is that "write code now, add tests later" never works. TDD is a much better approach not because "someone wrote it in a book" but because it ensures that all the behaviors that you care about is actually tested, so it leads to a better code quality in the long run. But it seems that I'm losing this battle inside the pyscript team 😅 🤷‍♂️
Yeah, we'll have to agree to disagree on this one. I really don't like absolutes. I agree with you on tests but that code in the repo didn't have tests at all in first place. Now it has. I'd much rather add tests in a gradual way that adds quality every merge rather that go to waiting for endless and heavy PRs that need to be merge weeks later.
Avatar
Avatar
Fabio
Yeah, we'll have to agree to disagree on this one. I really don't like absolutes. I agree with you on tests but that code in the repo didn't have tests at all in first place. Now it has. I'd much rather add tests in a gradual way that adds quality every merge rather that go to waiting for endless and heavy PRs that need to be merge weeks later.
that code in the repo didn't have tests at all in first place
I'm confused. Aren't we talking about the <py-tutor> plugin? What is the code which was untested before? Now we have a lot of new code which is basically untested, and I'm sure it's just a matter of time before someone will break it without noticing
Avatar
Avatar
antocuni
that code in the repo didn't have tests at all in first place
I'm confused. Aren't we talking about the <py-tutor> plugin? What is the code which was untested before? Now we have a lot of new code which is basically untested, and I'm sure it's just a matter of time before someone will break it without noticing
All the code that was doing the same functionality in the exames (showing the source code) wasn't tested at all. It someone changes the pytutor code and breaks functionality at a higher level, the relationship example tests will break. Yes there's more to be tested on the examples (i.e. that we are showing the source correctly, etc) but there's a part of it that is actually being checked. Now, what's missing really is the tests for the plugin itself but it'd needs some thinking because of how we register CE plugins and use the pyodide create proxy (that is a mock in unit tests and that is kinda of in the way)
Avatar
Avatar
Fabio
All the code that was doing the same functionality in the exames (showing the source code) wasn't tested at all. It someone changes the pytutor code and breaks functionality at a higher level, the relationship example tests will break. Yes there's more to be tested on the examples (i.e. that we are showing the source correctly, etc) but there's a part of it that is actually being checked. Now, what's missing really is the tests for the plugin itself but it'd needs some thinking because of how we register CE plugins and use the pyodide create proxy (that is a mock in unit tests and that is kinda of in the way)
what's missing really is the tests for the plugin itself
yes, that's exactly my point. I'm not sure to understand what are the technical problems which prevents to write tests for this specific plugins, but if there are they should be solved first, ideally
(edited)
18:36
but that's just my personal view on code quality. We are talking about opinions here, and I have the feeling that we are not going to converge 😅
Avatar
Avatar
antocuni
but that's just my personal view on code quality. We are talking about opinions here, and I have the feeling that we are not going to converge 😅
Yeah, we are not. That's one of the reasons I'm leaving the warning ⚠️ about the plugins stability. This is experimental work for now. I'm still figuring out a ton of things and don't want to spend more time on readapting tests then on the logic and design itself. Once we figure a nice way to actually test ALL python plugins and some other design choices around plugins we add tests. That should come before the next release.
👍 1
Avatar
FabioRosado 21/12/2022 00:14
I've been fighting with fetching a JS plugin the whole day, but finally cracked the code 😄 Alex also helped me with the async import which solved a lot of problems. The javascript plugin will have to look like any Plugin and contain the same shape, but currently only afterSetup is being called. We also can't do extend Plugin since the module has no notion of pyscript.plugin.Plugin. There's a lot of rough edges, but at least the code that fetches the plugin isn't too ugly 😄 Hopefully by tomorrow I'll have a PR up
🤩 1
Avatar
Yesterday & Today BOT 21/12/2022 07:00
📆 Yesterday & Today - 12/21/2022 🧵
Avatar
Jeff Glass 21/12/2022 14:17
@FabioRosado I see in the thread that you're working on plugin docs - does that include documenting the existing lifecycle methods, or just general use?
14:17
No worries either way, but I've got a draft PR up that introduces two new methods - if you're doing lifecycle method docs, I can way to merge till after you and add the new ones.
Avatar
FabioRosado 21/12/2022 14:30
I haven't started writing them yet, but I was thinking to add the lifecyle. Let's merge your own and I can build ontop of it if needed 😄
👍 1
14:30
Im currently working on handling fetch errors better
Avatar
Avatar
FabioRosado
I haven't started writing them yet, but I was thinking to add the lifecyle. Let's merge your own and I can build ontop of it if needed 😄
Jeff Glass 21/12/2022 16:05
Sounds good! We'll see who's ready to merge first 😅
Avatar
so, more news on the pyodide startup. I wrote a non-pyscript benchmark which loads pyodide and executes a print('hello world'): https://antocuni.github.io/files/pyodide/misc/benchmark_pyodide_startup.html
👏 1
Avatar
Avatar
FabioRosado
I've been fighting with fetching a JS plugin the whole day, but finally cracked the code 😄 Alex also helped me with the async import which solved a lot of problems. The javascript plugin will have to look like any Plugin and contain the same shape, but currently only afterSetup is being called. We also can't do extend Plugin since the module has no notion of pyscript.plugin.Plugin. There's a lot of rough edges, but at least the code that fetches the plugin isn't too ugly 😄 Hopefully by tomorrow I'll have a PR up
@FabioRosado Are you talking about JS plugins of Python plugins? I'm not sure I understand the entanglement there...
Avatar
FabioRosado 21/12/2022 18:01
Sorry this was for JS plugins
Avatar
Avatar
FabioRosado
Sorry this was for JS plugins
Ok ok, no worries. You actually mentioned 😄 but the pyscript.plugin.Plugin above got me confused (not sure why because we don't have that on the Python namespace anyway lol
Avatar
FabioRosado 21/12/2022 18:04
haha yeah that was a bad way to say it, I guess I should have said pyscriptjs/plugin.Plugin
👍🏼 1
Avatar
Btw... I'm planning on soft working on some of the [Python] plugins rough edges. Especially in terms of supporting testing them. Had a couple of ideas that I want to explore...
Avatar
FabioRosado 21/12/2022 18:07
Ah nice, I have some small changes on how we load plugins but shouldn't be too bad. Let me know if you want me to show you
Avatar
FabioRosado 21/12/2022 19:07
This is still a draft PR, need to write docs on how to fetch plugins, but you can have a look at the changes https://github.com/pyscript/pyscript/pull/1065
Avatar
tedpatrick 22/12/2022 00:23
See you all in 2023! Happy Holidays 🎄🎄🦜 🚢 (edited)
🎄 2
🎆 1
Avatar
Yesterday & Today BOT 22/12/2022 07:00
📆 Yesterday & Today - 12/22/2022 🧵
Avatar
FabioRosado 22/12/2022 20:21
Just marked the fetch plugin PR ready for review. I've only added a guide on how to write js/py plugins for the docs. Might do a follow up PR on creating a specific plugin that is a bit more complex than just adding 'hello world' to the page haha
Avatar
Yesterday & Today BOT 23/12/2022 07:00
📆 Yesterday & Today - 12/23/2022 🧵
Avatar
Yesterday & Today - 12/24/2002 Tomorrow
  • Celebrate Christmas 🎄
Happy holidays to all pyscripters 🙂
(edited)
Avatar
FabioRosado 24/12/2022 14:21
Happy holidays!
Avatar
Yesterday & Today BOT 26/12/2022 07:00
📆 Yesterday & Today - 12/26/2022 🧵
Avatar
Yesterday & Today BOT 27/12/2022 07:00
📆 Yesterday & Today - 12/27/2022 🧵
Avatar
Yesterday & Today BOT 28/12/2022 07:00
📆 Yesterday & Today - 12/28/2022 🧵
Avatar
Yesterday & Today BOT 29/12/2022 07:00
📆 Yesterday & Today - 12/29/2022 🧵
07:01
📆 Yesterday & Today - 12/29/2022 🧵
Avatar
FabioRosado 29/12/2022 21:53
Just wondering, is there a reason why pyscript version is under runtimes.ts? I'm renaming 'runtimes' to 'interpreter' and I wonder if perhaps it should move to main instead?
Avatar
Yesterday & Today BOT 30/12/2022 07:00
📆 Yesterday & Today - 12/30/2022 🧵
Avatar
Yesterday & Today BOT 02/01/2023 07:00
📆 Yesterday & Today - 01/02/2023 🧵
Avatar
Avatar
FabioRosado
Just wondering, is there a reason why pyscript version is under runtimes.ts? I'm renaming 'runtimes' to 'interpreter' and I wonder if perhaps it should move to main instead?
Jeff Glass 03/01/2023 05:02
Sorry this is so late - it was to avoid a circular dependency issue between main and runtime, but if there’s a means around that (or if it’s no longer an issue) main makes a lot more sense
Avatar
Yesterday & Today BOT 03/01/2023 07:00
📆 Yesterday & Today - 01/03/2023 🧵
Avatar
Avatar
Jeff Glass
Sorry this is so late - it was to avoid a circular dependency issue between main and runtime, but if there’s a means around that (or if it’s no longer an issue) main makes a lot more sense
FabioRosado 03/01/2023 08:34
Ohh okay that makes sense! I haven’t tried to move it around yet just wondered 😄
Avatar
Maybe just pull it into version.ts?
👍 1
Avatar
FabioRosado 03/01/2023 12:20
Yeah that's a great idea 😄
Avatar
Happy (late) New year folks! 🙂
🎉 5
Avatar
FabioRosado 03/01/2023 18:53
I've moved the 'Higher level Pythonic DOM interface' issue to github discussion board and added my proposal. It's mostly just expanding what we have currently and see what folks think. Let me know what you think, I would like to work on this if we all agree with an approach 😄 https://github.com/pyscript/pyscript/discussions/1091 (edited)
❤️ 1
Avatar
tedpatrick 03/01/2023 20:37
+10 for use of Github Discussions by @Fabio and @FabioRosado
Avatar
Yup. Thank you @tedpatrick and @FabioRosado !
Avatar
tedpatrick 03/01/2023 20:56
Let's plan to double down on Github Discussions. It looks like a clean way to get Questions and Proposals out of Issues. I want issues to represent bugs/todos only.
Avatar
FabioRosado 03/01/2023 21:07
We currently have 3 proposals in the discussion board 😄
Avatar
tedpatrick 03/01/2023 21:08
MOR!
Avatar
Yesterday & Today BOT 04/01/2023 07:00
📆 Yesterday & Today - 01/04/2023 🧵
16:27
Still lots to do.
🦜 4
😲 3
Avatar
Jeff Glass 04/01/2023 20:05
Hey Y'all, just a heads up - it looks like my little PR 1094 that was merged a couple hours ago failed its integration tests on merge, though they passed locally and within the PR itself. Looks like it's breaking due to a pyodide create_proxy deprecation warning. Will investigate and get a follow-up PR in.
✅ 3
Avatar
Thinking out loud here before I actually open an issue or something... Given https://peps.python.org/pep-0621/ as a bit of source of inspiration... Should our config actually have a [project] , where we move all the configs that we allow on root now? Or we are happy with the current status? I personally feel like it'd be a positive change that would be more aligned with the standard in Python-land and also keep things more organized... but don't have a super strong opinion about it. Thoughts?
Avatar
with root you mean the default?
Avatar
Avatar
3l3ktr4
with root you mean the default?
No. I mean at the root level of the config. Basically name = "Bla" instead of [project] name = "Bla
Avatar
Avatar
Fabio
Thinking out loud here before I actually open an issue or something... Given https://peps.python.org/pep-0621/ as a bit of source of inspiration... Should our config actually have a [project] , where we move all the configs that we allow on root now? Or we are happy with the current status? I personally feel like it'd be a positive change that would be more aligned with the standard in Python-land and also keep things more organized... but don't have a super strong opinion about it. Thoughts?
Otoh, playing devil's advocate, it'd be a breaking change and I'm not convinced it's worth the effort. That's why I want to prefetch the chat here...
Avatar
Avatar
Jeff Glass
Hey Y'all, just a heads up - it looks like my little PR 1094 that was merged a couple hours ago failed its integration tests on merge, though they passed locally and within the PR itself. Looks like it's breaking due to a pyodide create_proxy deprecation warning. Will investigate and get a follow-up PR in.
Jeff Glass 05/01/2023 02:34
Found a solution to the flaky REPL test - #1097 up for review https://github.com/pyscript/pyscript/pull/1097
✅ 1
Avatar
Yesterday & Today BOT 05/01/2023 07:00
📆 Yesterday & Today - 01/05/2023 🧵
Avatar
cool to see the stuff everyone created ❤️
Avatar
FabioRosado 05/01/2023 18:07
Yeah was awesome 😄
18:08
Sorry was hard to made bad jokes with a loud kiddo haha
Avatar
+1, it was really great! @FabioRosado please, let's make Daniel a solid presence! Not only he's super cute but also save us some bad jokes! 😄 😄
😆 3
Avatar
tedpatrick 05/01/2023 20:46
A course to take your TypeScript skills to the next level!
Avatar
tedpatrick 06/01/2023 01:57
The software ecosystem has a lot of useful but unsafe code, and the easier it is to sandbox that code, the moreoften that’ll happen. If it were as simple as ...
Avatar
Yesterday & Today BOT 06/01/2023 07:00
📆 Yesterday & Today - 01/06/2023 🧵
Avatar
Yesterday & Today BOT 09/01/2023 07:00
📆 Yesterday & Today - 01/09/2023 🧵
Avatar
good morning pyscripters. I'm back to my non-mountains home, so I should be available at full capacity for a while now 🙂
✨ 1
Avatar
Avatar
antocuni
good morning pyscripters. I'm back to my non-mountains home, so I should be available at full capacity for a while now 🙂
Welcome back.
Avatar
Avatar
antocuni
good morning pyscripters. I'm back to my non-mountains home, so I should be available at full capacity for a while now 🙂
FabioRosado 09/01/2023 11:37
Welcome back
Avatar
Yesterday & Today BOT 10/01/2023 07:00
📆 Yesterday & Today - 01/10/2023 🧵
tedpatrick started a thread. 10/01/2023 18:24
Avatar
Yesterday & Today BOT 11/01/2023 07:00
📆 Yesterday & Today - 01/11/2023 🧵
Avatar
FWIW, on next monday I will be interviewed about pyscript for the Gitbar podcast. Gitbar is a podcast in italian about general sw development (but I had to admit that I didn't know it before they contacted me 😅) https://www.gitbar.it/
👏 4
🎉 1
Avatar
Avatar
antocuni
FWIW, on next monday I will be interviewed about pyscript for the Gitbar podcast. Gitbar is a podcast in italian about general sw development (but I had to admit that I didn't know it before they contacted me 😅) https://www.gitbar.it/
send it over once it's out time for me to train my italian
Avatar
Avatar
3l3ktr4
send it over once it's out time for me to train my italian
when I'm back in Berlin we will do pair programming in italian 🇮🇹 😂
👍 1
Avatar
Avatar
antocuni
when I'm back in Berlin we will do pair programming in italian 🇮🇹 😂
I'm down
Avatar
Yesterday & Today BOT 12/01/2023 07:00
📆 Yesterday & Today - 01/12/2023 🧵
Avatar
OK... have a great weekend folks... 🎉
🦜 2
19:10
Catch non-US folks on Monday. Enjoy MLK day in the US.
Avatar
Yesterday & Today BOT 13/01/2023 07:00
📆 Yesterday & Today - 01/13/2023 🧵
Avatar
Yesterday & Today BOT 16/01/2023 07:00
📆 Yesterday & Today - 01/16/2023 🧵
Avatar
So, @Paul Everitt and I have had our talk "Build Yourself a PyScript" accepted to PyCon. 🎉
🎉 2
Avatar
FabioRosado 16/01/2023 18:44
Nice!
Avatar
tedpatrick 16/01/2023 19:22
Accepted and Confirmed… Tutorial for “Serverless PyScript” (edited)
❤️ 1
🎉 1
Avatar
Avatar
tedpatrick
Accepted and Confirmed… Tutorial for “Serverless PyScript” (edited)
Paul Everitt 16/01/2023 19:34
That sounds cool (edited)
Avatar
Yesterday & Today BOT 17/01/2023 07:00
📆 Yesterday & Today - 01/17/2023 🧵
Avatar
reminder to maintainers: we're forgetting to mark issues as backlog and if we don't they'll just be eventually automatically closed (edited)
✅ 1
👍🏼 1
Avatar
Jeff Glass 17/01/2023 13:58
Thank you!
✨ 1
Avatar
Joining the party... 🙂 Looks like all the proposals were accepted! I'm shocked!! Or did I miss someone?
🎊 1
Avatar
Bravo.
16:04
We should make sure our talks complement each other. I.e. perhaps have an online rehearsal PyCon where we present our talks (and adjust if required).
16:04
...a few weeks before the actual PyCon.
Avatar
Yes. Absolutely
Avatar
Also, that PyCon accepted our talks could be an indication of how interested folks are in PyScript..? 🤷‍♂️
Avatar
Avatar
ntoll
We should make sure our talks complement each other. I.e. perhaps have an online rehearsal PyCon where we present our talks (and adjust if required).
it's impossible that my talk will be ready few weeks before the conference. Usually I finish to prepare them half an hour before 😅
Avatar
Hehehehehe.. we've all been there.
Avatar
Yesterday & Today BOT 18/01/2023 07:00
📆 Yesterday & Today - 01/18/2023 🧵
Avatar
@FabioRosado @antocuni @madhurt will be 10-15 mins late for the 10am meeting. Stuck in traffic on return from dog walk.
👍🏼 1
Avatar
Hi folks - @FabioRosado @madhurt and I have spent this morning separating out the various discussion/proposal points from the multi-interpreter proposal into their own "RFC" (request for comments) proposals/discussions on GitHub. Please do contribute, ask questions and give feedback. 🚀
Avatar
Avatar
ntoll
@FabioRosado @antocuni @madhurt will be 10-15 mins late for the 10am meeting. Stuck in traffic on return from dog walk.
sorry, as you noticed I wasn't able to attend the meeting, I didn't feel well. I'm somewhat working this afternoon, although very lightly. If you want, we can do a catchup, else I'll just read what is on github
❤️ 1
Avatar
FabioRosado 18/01/2023 13:40
Can someone have a look at this change in the tutorials page? https://github.com/pyscript/pyscript/pull/1090 I am planning to write a tutorial on form handling and would like to use this new format 🙂
👍 1
Avatar
Avatar
antocuni
sorry, as you noticed I wasn't able to attend the meeting, I didn't feel well. I'm somewhat working this afternoon, although very lightly. If you want, we can do a catchup, else I'll just read what is on github
Always happy to chat. I'm hanging around in here for the next 15 mins or so, if you fancy a natter... https://anaconda.zoom.us/j/94250144713?pwd=b2dBVmxyZTg1eVJKT0FMWjd5RGhUQT09
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solution used around the world in board, conference, huddle, and training rooms, as well as ex...
Avatar
feel better @antocuni ❤️
❤️ 1
Avatar
Yesterday & Today BOT 19/01/2023 07:00
📆 Yesterday & Today - 01/19/2023 🧵
Avatar
FabioRosado 19/01/2023 09:39
My son is feeling unwell so I didn’t take him to the nursery. I’ll be doing some odd hours today
✅ 1
❤️ 1
Avatar
do we have pyscript fun?
Avatar
@antocuni why doesn't js.console.log redirects to the terminal?
01:12
is this a bug...
01:12
or a feature hehe
Avatar
it's by design
Avatar
what's the thinking behind also don't answer me now 😨 must be so late
Avatar
the terminal displays the content of the file descriptor 0 (i.e., stdout, i.e the python's sys.stdout)
Avatar
Avatar
3l3ktr4
what's the thinking behind also don't answer me now 😨 must be so late
yes, I just finished to prepare my things for my travel tomorrow and I was about to go to bed 💤
Avatar
ok, cuurious about why I don't get it But let's catch up tomorrow! I'd also like to pick your brain about the emscripten stuff
Avatar
Yesterday & Today BOT 20/01/2023 07:00
📆 Yesterday & Today - 01/20/2023 🧵
Avatar
FabioRosado 20/01/2023 09:36
I can see one use case to log to the console as well. If someone disables the py terminal and then prints things they would be shown in the console
Avatar
Avatar
FabioRosado
I can see one use case to log to the console as well. If someone disables the py terminal and then prints things they would be shown in the console
Yes, in this direction it already works
12:29
It's the OTHER direction that doesn't work: if someone calls console.log, it does NOT go to stdout/pyterminal
12:29
And i don't think that it should
Avatar
Jeff Glass 20/01/2023 12:58
I’m with Antonio here - as he says, print already goes to both, and js.console.log is so explicitly a JS concept it feels odd to override it
Avatar
FabioRosado 20/01/2023 14:31
Flake 8 is now failing all pre-commits because it want us to change our f-strings to do stuff like: f'<div id={el_id!r}>' Instead of: f'<div id="{el_id}">' I've opened up https://github.com/pyscript/pyscript/pull/1121 to simply ignore this recommendation mostly because I think the second versions is more explicit. if we all agree with this change, we need to merge it soon so we can merge other PRs. Otherwise we can always update all the f-strings to use the !r
👍🏼 1
Avatar
@FabioRosado I approved it (and merged it too) and we updated pre-commit as well
Avatar
What is the rationale behind this rule? 🤔
Avatar
FabioRosado 20/01/2023 16:45
I don’t know haha I definitely seen some weird flake8 rules but this one wins all
Avatar
Yesterday & Today BOT 23/01/2023 07:00
📆 Yesterday & Today - 01/23/2023 🧵
Avatar
Does anyone know how to fix this: Warning: PackagesNotFoundError: The following packages are not available from current channels: - python=3.11.1 Current channels: - https://conda.anaconda.org/conda-forge/linux-64 - https://conda.anaconda.org/conda-forge/noarch - https://repo.anaconda.com/pkgs/main/linux-64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/r/linux-64 - https://repo.anaconda.com/pkgs/r/noarch
21:38
Nevermind, just have to ask for python-version 3.11
Avatar
Yesterday & Today BOT 24/01/2023 07:00
📆 Yesterday & Today - 01/24/2023 🧵
Avatar
FabioRosado 24/01/2023 19:58
Oops, I was looking at an old version of https://github.com/pyscript/pyscript/pull/1129 and I added a suggestion and commited it but when I merged the PR I noticed your comment @3l3ktr4
Avatar
not a problem
19:58
just a minor comment
Avatar
FabioRosado 24/01/2023 19:59
But I think I made the changes you suggested haha
19:59
The phrase became: "Check out the developing process documentation for more information on how to setup your development environment."
✨ 1
Avatar
Yesterday & Today BOT 25/01/2023 07:00
📆 Yesterday & Today - 01/25/2023 🧵
Avatar
Jeff Glass 25/01/2023 14:33
Another PR for review here, a tweak to the last lifecycle hooks PR: https://github.com/pyscript/pyscript/pull/1132 Turns out having lifecycle functions with lots of position arguments a bad idea - just begging for us or users to get the order wrong 😬
Avatar
Avatar
Jeff Glass
Another PR for review here, a tweak to the last lifecycle hooks PR: https://github.com/pyscript/pyscript/pull/1132 Turns out having lifecycle functions with lots of position arguments a bad idea - just begging for us or users to get the order wrong 😬
great work Jeff thank you for that! ✨
Avatar
Yesterday & Today BOT 26/01/2023 07:00
📆 Yesterday & Today - 01/26/2023 🧵
Avatar
Jeff Glass 26/01/2023 16:34
FYI I cancelled the build on the just-merged PR #1135 since it hit 52 minutes elapsed. Checks on commits in another PR from 90 mins ago are also also still not complete. No signs on twitter of a GH Actions outage... not sure what's going on.
Avatar
Yesterday & Today BOT 27/01/2023 07:00
📆 Yesterday & Today - 01/27/2023 🧵
Avatar
heads up: I'll prbb be out most or all day on wednesday going to be travelling to socal and will prbb have to catch some greyhounds 😬 heard they're terrible (edited)
Avatar
@3l3ktr4 I'm driving down to LA this week, if you want we could try to carpool.
21:09
are you staring somewhere in the bay area?
Avatar
oh no way! that'd be super awesome I'm going to Mars
22:12
oohh but I bought
22:13
non refundable tickets to LA 😢
Avatar
Yesterday & Today BOT 30/01/2023 07:00
📆 Yesterday & Today - 01/30/2023 🧵
Avatar
Yesterday & Today BOT 31/01/2023 07:00
📆 Yesterday & Today - 01/31/2023 🧵
Avatar
does anyone know how can I export functions to the window object from JS? I know pyodide does it for example with loadPyodide...
Avatar
globalThis.someFunc = someFunc
16:30
I tried it but I must have tried it wrong haha
👍 1
Avatar
I'm always confused about how theoretically computers are supposed to be perfect repeatable science boxes but it never feels that way using them
Avatar
is there any difference between using globalThis.xxx = 42 and window.xxx = 42 in the browser? Or it's just that globalThis works also in node?
Avatar
Jeff Glass 31/01/2023 20:12
globalThis also works in web workers, which don't have window (edited)
👍 1
Avatar
globalThis also behaves differently inside iframes
👍 1
Avatar
Yesterday & Today BOT 01/02/2023 07:00
📆 Yesterday & Today - 02/01/2023 🧵
Avatar
Avatar
hood
I'm always confused about how theoretically computers are supposed to be perfect repeatable science boxes but it never feels that way using them
Sadly, we don't live in a perfect Platonic theoretical world.... doubly so with computers. 😉 Perhaps that's the problem, we believe the "perfect repeatable science boxes" PR and forget the "real" world is messy. As the old joke says, "In theory there is no difference between theory and practice, but in practice there is." 🤣
💯 1
Avatar
😆 3
Avatar
Yesterday & Today BOT 02/02/2023 07:00
📆 Yesterday & Today - 02/02/2023 🧵
Avatar
an interesting read about the upcoming WebAssembly JavaScript Promise Integration API: https://v8.dev/blog/jspi JSPI will allow to simulate synchronous calls from the main thread, solving part of the problems that we want to solve using webworkers. Unfortunately it's still far from being generally available, as currently you need to use a special version of chrome and to enable an experimental flag
14:21
I think that @hood already experimented with it in pyodide
Avatar
Once node v20 comes out in April I'm planning to rework our Pyodide virtual environments using JSPI which should make it much faster at startup and a better match for native behavior. It will be a long time before we can rely on it, but we can feature detect it at runtime and only enable it if it's present. This should allow code splitting in browsers that support it while falling back to loading everything up front in browsers without the support.
15:38
I think this does mean that we have to hand generate the code -- -sASYNCIFY=2 generates a module that requires JSPI. Maybe we can work with emscripten to provide a mode with a fallback for non supporting runtimes.
Avatar
This actually looks very promising: current support for ASYNCIFY=2 doesn't do a fallback if it's missing but code is structured in a way that would make it a fairly simple change
Avatar
code splitting sounds extremely interesting
16:33
it's something which I wanted to experiment with since a while, but I was blocked by the fact that you couldn't easily fetch the missing code from the main thread
16:34
for example, I imagine having a minimal pyodide runtime which does not contain the parser, the bytecode compiler and possibly the unicode db. Such a runtime would work only with .pyc files, but we can easily preprocess a pyscript page to pre-compile all the tags and files
Avatar
I&#39;m very excited about using JavaScript promise integration once it starts gaining runtime support. I notice that it is an all or nothing thing right now: if we compile with -sASYNCIFY=2 th...
👍 1
Avatar
hey folks yesterday was a traveling day for me but I also got pretty sick with something this morning I’m not feeling great so I’ll skip the pyscript fun, hope to be better later today
Avatar
Paul Everitt 02/02/2023 17:05
Hi, I thought I'd drop in fun but seems I have an outdated link?
Avatar
Avatar
Paul Everitt
Hi, I thought I'd drop in fun but seems I have an outdated link?
🙏 1
Avatar
Oh, following up on the call earlier... This is my current backyard situation 😅
18:11
😬 1
Avatar
Avatar
Fabio
Click to see attachment 🖼️
storm in austin?
Avatar
Yeah, big winter storm. Not as bad as 2 years ago but many parts of town don't have power (us included)
😨 1
Avatar
Yesterday & Today BOT 03/02/2023 07:00
📆 Yesterday & Today - 02/03/2023 🧵
Avatar
Few weeks ago I have been interviewed for an italian podcast (in italian) about PyScript. The episode is now online here: https://www.youtube.com/watch?v=MnaW1FYRNNo https://open.spotify.com/episode/11mFO7E3aVWnaV0WWFOk7b
👍 1
Avatar
Hi folks... here's the result of the Texas based chat from last week, about web-workers, message passing and multiple interpreters in PyScript. https://github.com/pyscript/pyscript/discussions/1141 Comments, constructive feedback and ideas most welcome... read it and knock yerself out with discussion. The more eyes on this, the better.
PyScript message passing / web worker description This is a high-level description of our proposal for consolidating how different interpreters interact with the browser&#39;s main thread from ...
✨ 1
🎆 1
Avatar
This is another interesting idea, from the micropython discord: I imagine that we could use a similar technique to get a custom micropython build which removes support for the compiler and the parser and bundles all the code of a given pyscript app, resulting in a super-small and super-fast-to-load binary: https://discord.com/channels/574275045187125269/1012726673709469818/1068307362043150376
🤩 2
Avatar
luvely thanks @ntoll !
Avatar
Yeah... so I believe the "people" Jimmo is talking about, are the European Space Agency. 😄 (IIRC Damian explain this to me a couple of years ago... they have severe resource constraints)
Avatar
Avatar
antocuni
Few weeks ago I have been interviewed for an italian podcast (in italian) about PyScript. The episode is now online here: https://www.youtube.com/watch?v=MnaW1FYRNNo https://open.spotify.com/episode/11mFO7E3aVWnaV0WWFOk7b
You're famous... will need autographs soon.
✍️ 1
Avatar
Avatar
antocuni
an interesting read about the upcoming WebAssembly JavaScript Promise Integration API: https://v8.dev/blog/jspi JSPI will allow to simulate synchronous calls from the main thread, solving part of the problems that we want to solve using webworkers. Unfortunately it's still far from being generally available, as currently you need to use a special version of chrome and to enable an experimental flag
And we'd need to wait for browser support (Firefox, Edge etc etc etc )
Avatar
Avatar
ntoll
You're famous... will need autographs soon.
I can also autograph the cave painting
Avatar
Avatar
ntoll
Yeah... so I believe the "people" Jimmo is talking about, are the European Space Agency. 😄 (IIRC Damian explain this to me a couple of years ago... they have severe resource constraints)
super interesting!
Avatar
Avatar
ntoll
And we'd need to wait for browser support (Firefox, Edge etc etc etc )
It's possible to set up code splitting using JSPI and fall back to eagerly loading if it's not available. Of course if nobody supports it this is a complexity increase for no gain, but at least we can start using it to benefit people with new browsers without worrying about breaking old browsers.
Avatar
if we move to running pyodide in a web worker, we can experiment with lazy loading even in current browser, with no need for JSPI -- I think?
Avatar
In that case you can lazy load Python code but you can only lazily load webassembly modules that are smaller than 4 kb. It's possible to compile the webassembly module on a different thread and transfer it, but it isn't possible to use Atomics to synchronously receive a transfer. Another possibility is to try to split the module into a bunch of small chunks, but that isn't likely to be a good idea. JavaScript code you can encode into a buffer and then decode and eval.
Avatar
with JSPI you can lazily load anything without any weird hacks
Avatar
Yesterday & Today BOT 06/02/2023 07:00
📆 Yesterday & Today - 02/06/2023 🧵
07:02
📆 Yesterday & Today - 02/06/2023 🧵
Avatar
Jeff Glass 06/02/2023 15:13
PR 1106 (Repl Plugin Hooks, output attribute for REPLs) is finally ready for review. Sorry it took an age, obviously no rush to get it integrated 😅 https://github.com/pyscript/pyscript/pull/1106
Avatar
Avatar
hood
In that case you can lazy load Python code but you can only lazily load webassembly modules that are smaller than 4 kb. It's possible to compile the webassembly module on a different thread and transfer it, but it isn't possible to use Atomics to synchronously receive a transfer. Another possibility is to try to split the module into a bunch of small chunks, but that isn't likely to be a good idea. JavaScript code you can encode into a buffer and then decode and eval.
I'm confused. I think that if you are inside a webworker you can do a blocking request > 4kb, can't you?
👍 1
Avatar
wow watching katie bell's talk @ntoll she's such a great communicator amazing! 🙂 what was her feedback for us?
Avatar
Avatar
3l3ktr4
wow watching katie bell's talk @ntoll she's such a great communicator amazing! 🙂 what was her feedback for us?
She's not looking for a job. 🤣
Avatar
hahahah
Avatar
@antocuni I didn't think so, but I just checked it and at least according to the error message you seem to be right:
WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread.
This is just in Chrome, firefox seems to allow synchronous compilation of large modules even on the main thread.
Avatar
Avatar
hood
@antocuni I didn't think so, but I just checked it and at least according to the error message you seem to be right:
WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread.
This is just in Chrome, firefox seems to allow synchronous compilation of large modules even on the main thread.
ah, to be honest I wasn't even aware that WebAssembly.Compile has a 4kb limit. I was mostly thinking about how to fetch the various .wasm files, because that part has also a 4kb limit in the main thread and no limit in the workers. But indeed, moving everything to the worker should solve both problems
Avatar
and her software is so cool https://splootcode.io/
17:11
I'm just catching up on the webworker discussion (protip: if you're having a hard time to understand it, Katie's video is highly recommended)
Avatar
@antocuni Another problem I've seen in my experiments with synchronous loading is that dynamic linking is sometimes screwed up. There may be some emscripten bugs on the code path that we have to fix, or Pyodide may need to add some sort of loadPackageSynchronous that takes a fetch handler as an argument.
👍 1
Avatar
Do you guys generate API docs for JavaScript code? Do you have any interest in sphinx-js? I am thinking about forking it for Pyodide since it is more or less unmaintained. Currently we just patch the heck out of it but it's not very sustainable. But it would be nice to get some other people to help out. (edited)
Avatar
Avatar
hood
Do you guys generate API docs for JavaScript code? Do you have any interest in sphinx-js? I am thinking about forking it for Pyodide since it is more or less unmaintained. Currently we just patch the heck out of it but it's not very sustainable. But it would be nice to get some other people to help out. (edited)
FabioRosado 06/02/2023 19:55
Currently we just write things by hand 😄 I'd be happy to help out with it
Avatar
We should set up a fork that we can work on
Avatar
FabioRosado 06/02/2023 21:00
That sounds good 😄 I'll wait for the pyodide fork and then fork off that fork 🤔
Avatar
there's something veeery misterious happening to my tests all of them fail with AttributeError: 'TestExamples' object has no attribute '_js_errors' when I try to run it with pytest -vv tests/integration/ --log-cli-level=warning but! the funny thing is, if I try to run with make test everything works perfectly anyone reproducing it or seeing similar?
Avatar
Yesterday & Today BOT 07/02/2023 07:00
📆 Yesterday & Today - 02/07/2023 🧵
Avatar
Avatar
3l3ktr4
there's something veeery misterious happening to my tests all of them fail with AttributeError: 'TestExamples' object has no attribute '_js_errors' when I try to run it with pytest -vv tests/integration/ --log-cli-level=warning but! the funny thing is, if I try to run with make test everything works perfectly anyone reproducing it or seeing similar?
FabioRosado 07/02/2023 09:43
Been a while since I ran the tests with pyscript, but tested it now and they are working for me
Avatar
Avatar
3l3ktr4
there's something veeery misterious happening to my tests all of them fail with AttributeError: 'TestExamples' object has no attribute '_js_errors' when I try to run it with pytest -vv tests/integration/ --log-cli-level=warning but! the funny thing is, if I try to run with make test everything works perfectly anyone reproducing it or seeing similar?
I just tried on my machine on commit 4c30359 (i.e., the latest commit in main as of now) and they seem to work fine
09:58
are you sure that: 1. you are in the right conda environment? 2. the pytest command line invokes the right python? What happens if you do python -m pytest instead of pytest?
Avatar
1 & 2 are yes python -m pytest throws some craazy numpy errors i've never seen before (edited)
17:22
E ImportError: E E IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! E E Importing the numpy C-extensions failed. This error can happen for E many reasons, often due to issues with your setup or how NumPy was E installed. E E We have compiled some common reasons and troubleshooting tips at: E E https://numpy.org/devdocs/user/troubleshooting-importerror.html E E Please note and check the following: E E * The Python version is: Python3.10 from "/Users/mariana/miniconda3/envs/pyscript/bin/python" E * The NumPy version is: "1.23.5" E E and make sure that they are the versions you expect. E Please carefully study the documentation linked above for further help. E E Original error was: No module named 'numpy.core._multiarray_umath'
17:22
lol sounds so funny 😆 weirdly written
17:24
last week i broke my conda trying to build a linux package in my osx (i know, i know) so i had to reinstall everything... so must be something weird with my env.
Avatar
aahh these errors were insane 🤪 I forgot to install pytest-playwright and that was the problem opening a PR with docs on how to install the test env 😅 (still not sure how it was running normally with make test...) (edited)
Avatar
Yesterday & Today BOT 08/02/2023 07:00
📆 Yesterday & Today - 02/08/2023 🧵
Avatar
sigh, timezones. I rushed up to arrive in time for the meeting "at 5", just to realize that it was UK's 5 🤦‍♂️ 😂
🤣 2
Avatar
FabioRosado 08/02/2023 16:59
Might be running a bit late dont wait 😄
Avatar
Yesterday & Today BOT 09/02/2023 07:00
📆 Yesterday & Today - 02/09/2023 🧵
Avatar
Capnproto reading
@ntoll did you read it because of curiosity or because you think to use it for communication? I'm a big fan of capnproto but I don't think it makes sense for us right now. For now the easiest thing is to just use JSON, and then we will see whether it's a bottleneck
18:54
FWIW, I started to look at the pyscript source code, in particular the Interpreter class: we need to make it "webworker-friendly", which means (at least): 1. kill interpreter.globals 2. kill all the usages of pyimport 3. make interpreter.run async again 😦 (edited)
Avatar
tedpatrick 09/02/2023 21:15
Feedback is welcome on the new Issues Process defined here... https://github.com/pyscript/pyscript/discussions/1158
We are working to make Issues more actionable and represent real bugs within PyScript. Prior to using Github Discussions, PyScript issues could hold bugs, doc changes, upstream bugs, package reques...
👍 1
Avatar
Yesterday & Today BOT 10/02/2023 07:00
📆 Yesterday & Today - 02/10/2023 🧵
Avatar
Avatar
antocuni
Capnproto reading
@ntoll did you read it because of curiosity or because you think to use it for communication? I'm a big fan of capnproto but I don't think it makes sense for us right now. For now the easiest thing is to just use JSON, and then we will see whether it's a bottleneck
Out of curiosity / looking for inspiration. Totally agree with "just use JSON" for now. The cpnproto RPC (time travel!) stuff resonated with me WRT the discussion with @hood and batching calls into a single message for the sake of efficiency. But that's premature optimization right now... yet something to keep in mind for the future.
Avatar
Hi team, I just saw on my calendar that there is a meeting starting in a few minutes but I won't be able to participate, sorry
👍 1
Avatar
Avatar
antocuni
Hi team, I just saw on my calendar that there is a meeting starting in a few minutes but I won't be able to participate, sorry
There's one right afterwards too. Some sort of OSS retro thing..?
Avatar
i should be able to make that one
Avatar
ok I've just tested what we were wondering about non contributors being able to create and interact in discussions and they can so I guess we're all good 👍
19:49
I guess I'll add the flowchart to our contributing.md so people can udnerstand our triage process and new contributors can have guidelines etc 🙂
Avatar
@FabioRosado I added types to all of sphinx-js and switched it to using pydantic in my fork: https://github.com/pyodide/sphinx-js/ If you want to try it out let me know. I still haven't added any of Pyodide's fixes or made it work with a more recent typedoc though.
Autodoc-style extraction into Sphinx for your JS project - GitHub - pyodide/sphinx-js: Autodoc-style extraction into Sphinx for your JS project
Avatar
Avatar
hood
@FabioRosado I added types to all of sphinx-js and switched it to using pydantic in my fork: https://github.com/pyodide/sphinx-js/ If you want to try it out let me know. I still haven't added any of Pyodide's fixes or made it work with a more recent typedoc though.
FabioRosado 11/02/2023 07:47
Awesome thanks! I’ll give it a try today and will try to bump the versions and see it explode 😄
Avatar
if you're deving pyscript and it's breaking inexplicably after you pulled the last changes dont forget to update pyodide with npm install
Avatar
FabioRosado 12/02/2023 11:59
Hood just bumped typedoc to the latest version 0.23.25 and ran the tests, it work pretty well... minus the 400 something validation errors 😆 I'm looking at the diff in schema and will start update it 😄 Thanks for the pydantic class! Also interestingly it seems that the new version returns a completely different output (edited)
Avatar
I'm looking at the diff in schema
21:18
do you have any specific techniques for this?
21:18
I do a lot of trial and error
21:21
I made all but 3 tests pass in v0.20.37 I will make a PR with that work
Avatar
Also @FabioRosado if you have any idea how to fix https://github.com/pyodide/sphinx-js/pull/4 I would appreciate it. Maybe I should just switch to circleci which handles test reports quite nicely.
Avatar
Yesterday & Today BOT 13/02/2023 07:00
📆 Yesterday & Today - 02/13/2023 🧵
Avatar
Avatar
hood
Also @FabioRosado if you have any idea how to fix https://github.com/pyodide/sphinx-js/pull/4 I would appreciate it. Maybe I should just switch to circleci which handles test reports quite nicely.
FabioRosado 13/02/2023 10:26
Sorry I was going to look at it today but I seem it was fixed 😄 And for the upgrade I've been doing the same, trial and error and trying to figure out what was blowing up haha
Avatar
Avatar
FabioRosado
Sorry I was going to look at it today but I seem it was fixed 😄 And for the upgrade I've been doing the same, trial and error and trying to figure out what was blowing up haha
trial and error and trying to figure out what was blowing up haha
Yeah, I guess that's the way. Though I think adding mypy and pydantic did pay off pretty well. I've almost got it working for versions 0.20.5+, 0.21, and 0.22. I am not sure what the effort threshold should be for whether it is worth supporting multiple versions..
Avatar
Yesterday & Today BOT 14/02/2023 07:00
📆 Yesterday & Today - 02/14/2023 🧵
Avatar
An interesting read about upcoming WASM features and multi language interop: https://seb.deleuze.fr/the-huge-potential-of-kotlin-wasm/
Last week, a preview release of Kotlin/Wasm was announced as part of Kotlin 1.8.20-Beta. For me who has been nudging the Kotlin team to work on WebAssembly support since June 2016, that’s a huge step forward even if providing WebAssembly first class support for Kotlin will be a long journey. I also decided recently to contribute actively by crea...
Avatar
I wonder what is going to happen with the compilers for this wasm-gc use case. Because with wasm-gc webassembly is diverging quite far from what is available in traditional compiler targets. I think if the compilers make it possible to have variables which are ref types just to pass through, then the garbage collector can be implemented in assembly code and the demands on the compiler can be kept limited. You can see that the solution presented in j2cl is to write a completely new compiler. This avoids the issue of what to do with existing compilers entirely. But I think adoption of this is going to be very slow because it's totally unclear how to make a C compiler emit any of these new instructions.
16:29
I guess the point is that this stuff is forward looking -- it is intended for new applications or new compilers written from the ground up to use wasm-gc. It's not so good for porting existing native applications that already have a shared-everything C FFI.
16:32
though a C FFI that uses opaque pointers and a few structs may not be too hard to switch over...
Avatar
Yesterday & Today BOT 15/02/2023 07:00
📆 Yesterday & Today - 02/15/2023 🧵
Avatar
Yesterday & Today BOT 16/02/2023 07:00
📆 Yesterday & Today - 02/16/2023 🧵
Avatar
@antocuni I have a new thought about dispatch and syncio. The fundamental issue here is that we effectively have two event loops: (1) the browser-native worker event loop and (2) the event loop for tasks delegated to the main thread. When dealing with tasks on the main thread the browser-native event loop stalls so event loop (2) is a sort of "sub event loop". Life will be better if we use asyncio to deal with this second event loop because then we can use asyncio.gather etc and don't have to reimplement these ourselves. If we had a syncifying decorator we can always do dispatch with await and then call the function synchronously outside: @syncify async def do_the_thing(selector, new_value): await main_thread.querySelector(".blah").setattr("innerHTML", new_value) await main_thread.fetch("a thing") def g(): do_the_thing(".blah1", "blah_value") do_the_thing(".blah2", "blah_value") The definition of syncify would look like: def syncify(func): def wrapper(*args): orig_loop = asyncio.get_event_loop() asyncio.set_event_loop(MainThreadDispatchLoop()) try: return asyncio.run(func(*args)) finally: asyncio.set_event_loop(orig_loop) return wrapper (edited)
Avatar
Avatar
hood
@antocuni I have a new thought about dispatch and syncio. The fundamental issue here is that we effectively have two event loops: (1) the browser-native worker event loop and (2) the event loop for tasks delegated to the main thread. When dealing with tasks on the main thread the browser-native event loop stalls so event loop (2) is a sort of "sub event loop". Life will be better if we use asyncio to deal with this second event loop because then we can use asyncio.gather etc and don't have to reimplement these ourselves. If we had a syncifying decorator we can always do dispatch with await and then call the function synchronously outside: @syncify async def do_the_thing(selector, new_value): await main_thread.querySelector(".blah").setattr("innerHTML", new_value) await main_thread.fetch("a thing") def g(): do_the_thing(".blah1", "blah_value") do_the_thing(".blah2", "blah_value") The definition of syncify would look like: def syncify(func): def wrapper(*args): orig_loop = asyncio.get_event_loop() asyncio.set_event_loop(MainThreadDispatchLoop()) try: return asyncio.run(func(*args)) finally: asyncio.set_event_loop(orig_loop) return wrapper (edited)
sorry, I think I'm missing some context here 😅. What is the problem that you are trying to solve with this?
Avatar
Avatar
antocuni
sorry, I think I'm missing some context here 😅. What is the problem that you are trying to solve with this?
Also, given PyScript is supposed to also be "for the 99%" (i.e. perhaps beginners or non-technical folks will be users), having situations where they have to think about asyncio is not a good place to be. My rule of thumb/heuristic is, "can I imagine explaining this to an average 11yo?" - if the answer is yes, we're in a good place. Otherwise, we need to work out how to manage the complexity in a way that empowers such users (while not hiding it from power-tech users). This is, actually, a very useful exercise in and of itself. (edited)
👍 1
Avatar
well as I've said before, removing the need to think about asyncio here sacrifices performance, but a beginner friendly asyncio-free wrapper can be put around any of this stuff
16:57
@antocuni's auto-syncify suggestion should work with any design
16:58
it sacrifices concurrency, but reasoning about concurrency is indeed an advanced concept so
16:58
getting rid of it entirely is probably a win for beginners anyways
Avatar
Avatar
hood
well as I've said before, removing the need to think about asyncio here sacrifices performance, but a beginner friendly asyncio-free wrapper can be put around any of this stuff
ok, so here you are basically talking about a better/more efficient way for the "power user" use case?
Avatar
Yeah, exactly. I am convinced that you have the right idea for the "simple interface": we just hide all the complexity and make it look like normal code.
17:05
I guess my perspective coming from Pyodide is very power user focused, our idea is mostly that someone else will make the user friendly layer on top of our as-expressive-as-we-can-make-it API so
17:05
it is helpful to remind me to think more about the complexity hiding aspects...
Avatar
right, have a more expressive low-level API is a good idea. But I think that for now I'd like to prioritise the "easy" interface, and optimize it later
👍 1
Avatar
Yeah this makes sense. I am just saying that when we get to the advanced interface it should ideally be normal looking asyncio plus potentially a decorator. This way both code and reasoning from ordinary asyncio can be moved over as easily as possible.
👍 1
Avatar
@3l3ktr4 this is a (partial) list of problems which people encountered when they tries pyscript in Boston. As you can see you were not the only one to be tricked by plt.show(). We should fix it
Avatar
haha "should do smth reasonable"
Avatar
yes! If it's called plt.show(), it should either -- ehm -- show it or raise an error if it cannot be shown
Avatar
yeah we should show it it's what the user expects
Avatar
Avatar
3l3ktr4
yeah we should show it it's what the user expects
it should be "easy": we could monkey-patch matplotlib in such a way that plt.show() calls display(plt). Or maybe we could add a new "pyscript backend" to matplotlib, so that .show() calls display() automatically
👍 1
Avatar
yeah
Avatar
Avatar
hood
Yeah this makes sense. I am just saying that when we get to the advanced interface it should ideally be normal looking asyncio plus potentially a decorator. This way both code and reasoning from ordinary asyncio can be moved over as easily as possible.
yes, I like the idea of integrating it with normal asyncio. I'm not sure I like your .setattr() syntax. Maybe it's possible to achieve something like this: from js import document # this is "sync" be default async def myfunc(): doc = Lazy(document) foo = doc.getElementById("foo") foo.innerHTML = "hello" await foo # or maybe await doc; I guess they probably would be equivalent
Avatar
Avatar
antocuni
yes, I like the idea of integrating it with normal asyncio. I'm not sure I like your .setattr() syntax. Maybe it's possible to achieve something like this: from js import document # this is "sync" be default async def myfunc(): doc = Lazy(document) foo = doc.getElementById("foo") foo.innerHTML = "hello" await foo # or maybe await doc; I guess they probably would be equivalent
i.e., Lazy(some_js_object) returns an object which records all the operations done on it (and on the results of these ops) and then sends them to the main thread when you do await
18:15
off for today (edited)
👍 1
Avatar
Avatar
antocuni
it should be "easy": we could monkey-patch matplotlib in such a way that plt.show() calls display(plt). Or maybe we could add a new "pyscript backend" to matplotlib, so that .show() calls display() automatically
leaving this thread here: https://github.com/pyscript/pyscript/issues/983#issuecomment-1343948823 might help on what to do on the way forward
Avatar
Avatar
antocuni
i.e., Lazy(some_js_object) returns an object which records all the operations done on it (and on the results of these ops) and then sends them to the main thread when you do await
I like the idea here except for the fact that i wish await foo was more expressive. I think it's not immediate to a noob user what they are waiting for... Maybe being more explicit and awaiting a sync method is more expressive even if a level deeper?
Avatar
Yesterday & Today BOT 17/02/2023 07:00
📆 Yesterday & Today - 02/17/2023 🧵
Avatar
Avatar
antocuni
yes, I like the idea of integrating it with normal asyncio. I'm not sure I like your .setattr() syntax. Maybe it's possible to achieve something like this: from js import document # this is "sync" be default async def myfunc(): doc = Lazy(document) foo = doc.getElementById("foo") foo.innerHTML = "hello" await foo # or maybe await doc; I guess they probably would be equivalent
Lots of tradeoffs to discuss in the APIs here!
I think it's not immediate to a noob user what they are waiting for.
Again I think the plan for noob users is that they can use an auto-sync API that hides this from them. For non-noobs, what they are awaiting for has a pretty similar answer to the typical one when doing asyncio.
20:30
I think the main issue with a sync method is that "Atomics / sync XHR async" and "Promise async" do not mix perfectly: "Atomics async" can happen inside "Promise async" but not the other way around
20:30
so something like a context manager to change the event loop is needed
20:31
but I guess the sync method would be expressive and it could just fail if we don't have the right event loop
20:33
The thing is that these tasks can be handled by either event loop
Avatar
@antocuni I think what you are suggesting is not a great idea: consider the following three code examples: 1. this should work fine foo = await doc.getElementById("foo") await doc.someFunc(foo) 2. Your proposal, perfectly possible to implement afaict foo = doc.getElementById("foo") foo.someAttr = "blah" await foo # returns a proxy for foo, # also assigns someAttr as a side effect 3. I'm not sure what this would do: foo = doc.getElementById("foo") await doc,someFunc(foo) await foo Does it execute document.getElementById twice? Once? If only once, how does that work? Do the objects foo and doc.someFunc(foo) know they are tied together in some way? (edited)
06:16
my feeling is that if 2 works, then people might be surprised that 3 doesn't? Or is there a stipulation that the foo object can't be used as an argument to a function, but it can have attributes / items assigned to them? I guess if 3 raises an error saying "please await foo first!" maybe that's clear enough.
06:17
I think 3 not raising an error gets us deep into crazy land, we'll practically have to design an entire new programming language
06:19
another issue is that this implies that foo has to be mutable, whereas I would really prefer the "Synclink proxies" to be immutable or else things are kind of spooky
06:23
another problem is that if someone says doc.getElementById("foo").someAttr = "blah" and they don't hold onto the foo to await it, nothing will happen... but this is also a problem in general. Maybe we can print something like RuntimeWarning: coroutine 'f' was never awaited in the destructor.
Avatar
Avatar
hood
@antocuni I think what you are suggesting is not a great idea: consider the following three code examples: 1. this should work fine foo = await doc.getElementById("foo") await doc.someFunc(foo) 2. Your proposal, perfectly possible to implement afaict foo = doc.getElementById("foo") foo.someAttr = "blah" await foo # returns a proxy for foo, # also assigns someAttr as a side effect 3. I'm not sure what this would do: foo = doc.getElementById("foo") await doc,someFunc(foo) await foo Does it execute document.getElementById twice? Once? If only once, how does that work? Do the objects foo and doc.someFunc(foo) know they are tied together in some way? (edited)
Does it execute document.getElementById twice?
I think it would execute it only once. But you cannot await it twice. E.g., if you start with Lazy(document), you can do all operations that you want, and they would be executed only when you use await. Once you have done that, you cannot call await on it (or on any other intermediate object) again. That said, I'm not sure it's a good idea, I'm mostly thinking aloud
Avatar
Yesterday & Today BOT 20/02/2023 07:00
📆 Yesterday & Today - 02/20/2023 🧵
Avatar
Yesterday & Today BOT 21/02/2023 07:00
📆 Yesterday & Today - 02/21/2023 🧵
Avatar
Yesterday & Today BOT 22/02/2023 07:00
📆 Yesterday & Today - 02/22/2023 🧵
Avatar
Why I am no longer able to open a blank issue on pyscript? There used to be an "open a blank issue" link in the bottom left, but I can no longer see it. Did we disable it consciously or it's a mistake?
Avatar
Yesterday & Today BOT 23/02/2023 07:00
📆 Yesterday & Today - 02/23/2023 🧵
Avatar
Avatar
antocuni
Why I am no longer able to open a blank issue on pyscript? There used to be an "open a blank issue" link in the bottom left, but I can no longer see it. Did we disable it consciously or it's a mistake?
Jeff Glass 23/02/2023 07:42
I believe it was part of this: https://github.com/pyscript/pyscript/pull/1157
Avatar
Yesterday & Today BOT 24/02/2023 07:00
📆 Yesterday & Today - 02/24/2023 🧵
07:01
📆 Yesterday & Today - 02/24/2023 🧵
Avatar
Jeff Glass 26/02/2023 14:18
I hope everyone's travel was smooth, comfy and uneventful! Thanks again for an amazing week.
14:19
While they’re fresh in our minds, I've turned two of the larger conversations into proposals. The first is around the syntax for py-[event] and event handlers: https://github.com/pyscript/pyscript/discussions/1222 (edited)
14:19
The second is a draft specification for plugin metadata files, and related changes in the plugin installation behavior: https://github.com/pyscript/pyscript/discussions/1228 (edited)
14:20
The plugin metadata proposal has an additional component - where in the virtual filesystem should files from a particular plugin be loaded? - that I've broken out into its own discussion for readability: https://github.com/pyscript/pyscript/discussions/1229
14:21
Comments, feedback, and continued discussion encouraged!
👍 1
Avatar
Yesterday & Today BOT 27/02/2023 07:00
📆 Yesterday & Today - 02/27/2023 🧵
07:02
📆 Yesterday & Today - 02/27/2023 🧵
Avatar
Naming conventions for SyncLink proxies and PyProxys 🧵
Avatar
@madhurt @hood IIRC you told me that you successfully wrapped the whole RemoteInterpreter into a SyncLink proxy: is the code available somewhere?
Avatar
@antocuni There are still 30ish tests failing, down from 81 originally. It is present at synclink branch and builds on top of split-interpreter branch. (edited)
Avatar
thanks! Do you think the split-interpreter branch is ready to a final review/merge, or it's still WIP?
Avatar
split-interpreter has a PR open, and it should be ready I guess -- https://github.com/pyscript/pyscript/pull/1218 (edited)
Avatar
Avatar
madhurt
split-interpreter has a PR open, and it should be ready I guess -- https://github.com/pyscript/pyscript/pull/1218 (edited)
cool thanks, I'll review
Avatar
Jeff Glass 27/02/2023 20:52
Anyone have any ideas as to why test_asyncio_gather is passing locally but failing in CI? The resulting list should be [3,2,1] but is coming out as [3, 2, 1]... but only in CI? I see the split interpreter class PR has a quick fix (stripping the result of spaces) but I'd still like to know why it started failing all of a sudden (edited)
Jeff Glass started a thread. 27/02/2023 21:18
Avatar
@hood doesn't have merge access, pinging @Fabio to provide it
Avatar
Yesterday & Today BOT 28/02/2023 07:00
📆 Yesterday & Today - 02/28/2023 🧵
Avatar
I just stumbled upon this tool: a "code size profiler" for wasm: https://rustwasm.github.io/twiggy/
Avatar
and for the compilers&interpreters geeks which are around, this is another interesting article about compiling SpiderMonkey to WASM and how they optimized it. Among the other things, they are using Wizer to pre-initialized the JS VM, which is something which I would like to try also for python. @hood IIRC wizer doesn't work with dynamic linking, but maybe we can experiment with a version of pyodide which doesn't support dynamic linking... it would still be interesting to see how much we can improve the startup https://bytecodealliance.org/articles/making-javascript-run-fast-on-webassembly (edited)
Avatar
Yeah the idea is to take a memory snapshot. Dynamic linking state, file system state, hiwire stuff and a bunch of other things are stored in JavaScript
11:15
Hiwire shouldn't matter because you can take your snapshots before initializing the Pyodide module
11:16
It should be possible to sync up fs state or of course if you could use wasmfs this wouldn't be a problem but it's not ready yet
11:16
We don't have any c++ code so libunwind state is not a problem
11:17
And all dynamic loading happens after interpreter initialization as well
11:18
The main problem is just that there is a lot of complicated state which all has to be manually synced up just right
11:19
Also every single em_js function can close over an enormous number of different things so
11:20
Ideally we would instrument the em_js and em_asm and track down all of the things that are done up to interpreter initialization and
11:20
Record what they do to the JavaScript state
11:24
I think we should try to do this to micropython first it will be much easier
Avatar
Avatar
hood
I think we should try to do this to micropython first it will be much easier
yes, this sounds like a good idea
13:44
or CPython without pyodide's ffi
13:45
syncing the filesystem should be "easy". I think the hard part is the implicit state which is stored by JS functions (edited)
Avatar
I'd like to propose we vote for Hood to become a maintainer. Per the project CONTRIBUTING file: Contributors are invited to be maintainers of the project by demonstrating good decision making in their contributions, a commitment to the goals of the project, and consistent adherence to the code of conduct. New maintainers are invited by a 3/4 vote of the existing maintainers. So, let's vote! I'm obviously +1
✅ 7
Avatar
Yesterday & Today BOT 01/03/2023 07:00
📆 Yesterday & Today - 03/01/2023 🧵
07:01
📆 Yesterday & Today - 03/01/2023 🧵
Avatar
Avatar
antocuni
syncing the filesystem should be "easy". I think the hard part is the implicit state which is stored by JS functions (edited)
I don't think Pyodide's FFI actually creates any problem: we just take the core dump after interpreter init and before pyodide init.
Avatar
what is the standard way to write a webworker in typescript? If I add a .ts file to the project, it gets bundled with the all the rest inside pyscript.js, but for workers I want the typescript compiler to output it to another file. A quick google doesn't find anything relevant
Avatar
well the issue is really with rollup. It shouldn't bundle the file unless you import it or list it as an entrypoint
17:42
you have to set two different rollup entrypoints, one for the main thread bundle and one for the worker
Avatar
Avatar
hood
you have to set two different rollup entrypoints, one for the main thread bundle and one for the worker
this is very outside of my typescript knowledge. I barely know that we are using rollup and what it is 😅
Avatar
the config is inside of pyscriptjs/rollup.config.js. It looks like a harmless file but it has a pretty significant impact on the way the app works...
17:47
if you export an array of configs instead of a single config then multiple targets will be produced. So for instance Pyodide has three entrypoints: api.ts, pyodide.ts, and pyodide.umd.ts so we export a list of three configs. https://github.com/pyodide/pyodide/blob/main/src/js/rollup.config.mjs
Pyodide is a Python distribution for the browser and Node.js based on WebAssembly - pyodide/rollup.config.mjs at main · pyodide/pyodide
Avatar
thanks, this is a good starting point
Avatar
Yesterday & Today BOT 02/03/2023 07:00
📆 Yesterday & Today - 03/02/2023 🧵
Avatar
ok, I need again help with rollup, typescript & friends. Thanks to @hood suggestions I managed to teach rollup to emit two different files: pyscript.js with all the "main" code and worker_interpreter.js with the (very minimal so far) worker code
16:37
however, I cannot import any typescript module from worker_interpreter.ts
16:37
this is the commit which I have so far, I pushed it to the antocuni/play-with-workers branch on GH: https://github.com/pyscript/pyscript/commit/3c928e796f27ca8adaded620333264f088398163
16:38
as you can see, I have src/workers/worker_interpreter.ts: from that file, I try to import { add } from './foo';, which is a file next to it
Avatar
Well you need some of the plugins to do that
16:39
Probably resolve and typescript
Avatar
my end goal is to be able to import RemoteInterpreter from one directory up
Avatar
Avatar
hood
Well you need some of the plugins to do that
in rollup?
Avatar
Yeah. I'd recommend starting with putting in all the plugins that are in pyscript_main
16:40
Can later see which ones you actually need.
Avatar
I see. I assumed that typescript imports are resolved by the typescript compiler
16:41
the interactions between all these tools are very confusing to me
16:43
let's make a thread to avoid cluttering the main channel 🧵
Avatar
Jeff Glass 02/03/2023 17:47
For those who weren't on the call - this is built on top of a Dev branch of Pyodide adding support for Pyxel, an 8-bit Retro game engine for writing games in Python
🤯 2
Avatar
FabioRosado 02/03/2023 18:35
This is awesome!
Avatar
Yesterday & Today BOT 03/03/2023 07:00
📆 Yesterday & Today - 03/03/2023 🧵
07:02
📆 Yesterday & Today - 03/03/2023 🧵
Avatar
FabioRosado 03/03/2023 14:36
@3l3ktr4 on the copilot, is the icon on the bottom right bar of vscode orange? I think it gets globally deactivated the first time you install it
Avatar
Avatar
FabioRosado
@3l3ktr4 on the copilot, is the icon on the bottom right bar of vscode orange? I think it gets globally deactivated the first time you install it
i got it through anaconda and I have pycharm I'm wondering how to activate it on the IDE actually did you get yours through anaconda?
15:43
sorry I know we've been through this already somewhere but the deprecation on pys-onClick should be removed not in the next version of pyscript, but the one the comes next because we're adding the deprecation warnings right now? (they weren't there in the 2022.12.1 version) correct @FabioRosado ? (edited)
15:44
also, do we have plans for a next release? are we waiting on webworkers and plugins and events... or should we just do it?
Avatar
Avatar
3l3ktr4
sorry I know we've been through this already somewhere but the deprecation on pys-onClick should be removed not in the next version of pyscript, but the one the comes next because we're adding the deprecation warnings right now? (they weren't there in the 2022.12.1 version) correct @FabioRosado ? (edited)
FabioRosado 03/03/2023 15:48
Yeah that’s the idea although it seems that with the async changes those old attributes stopped working maybe we can remove them now? 🤔
Avatar
oh great
15:48
ahaha
15:48
ahhr idk if that's alright tho
15:49
i'll spend some time trying to fix it
Avatar
@madhurt about PR #1218: if I look at it now, I cannot see many of the comments which I did. I think this happens because you rebased+force-pushed, and github gets confused. But this makes it very hard to re-review a PR, because you no longer know what were the changes requested and how they were resolved. I think that the following could be interesting for everyone because it makes PR reviewing much easier. When I work on a PR, I usually like to follow this workflow:
  • always merge with upstream, never rebase (the end result is exactly the same since we squash&merge)
    • when someone requests a trivial change (e.g. a typo), I just change and mark it as resolved by myself
    • when the change is non-trivial, I fix it in a single commit and then I put the commit id in the discussion, so that the author of the review can look at it and decide whether they are fine with the change. In this way, they decide whether to mark the discussion as "resolved". An example of this is here: https://github.com/pyscript/pyscript/pull/917#discussion_r1017842650
    I think this makes the life much easier for the reviewers, but I'm happy to hear comments&thoughts
Avatar
I'm experimenting with getting prism-js to correctly syntax highlight Toml and Python. It works pretty well but I haven't gotten it to work with py-tutor yet
18:44
unlike prettier, prism-js has a nice API for this
Avatar
Iirc, I'm using it on the slideshow plugin I created for my talks (and still need to polish and actually release :/ )
01:30
Actually... not that I remember, py-tutor uses a vendored in version of prism-js. What issues are you seeing @hood ?
Avatar
I think the issue was with the execution order of injected script tags. I got it working in js both with static and dynamic script tags so I think I just need to duplicate that logic into pytutor. We should have a utility function that injects a script into a target element and returns a Promise for the resolution.
👍 1
Avatar
I think the issue was with the execution order of injected script tags. I got it working in js both with static and dynamic script tags so I think I just need to duplicate that logic into pytutor. We should have a utility function that injects a script into a target element and returns a Promise for the resolution.
06:10
Though there are many other better designs one might consider especially taking into account what might happen to plugins once the worker split occurs
Avatar
Yesterday & Today BOT 06/03/2023 07:00
📆 Yesterday & Today - 03/06/2023 🧵
Avatar
well in py-tutor, the toml highlighting works but enabling syntax highlighting for py-script messes up:
08:07
Toml highlighting works (edited)
08:07
py-script highlighting does not
Avatar
Names 🧵
Avatar
new interpreter divide thread 🧶
Avatar
lol you wanna talk about names I wanna talk about smth else
16:54
it's alright
Avatar
Can we be explicit about what the thread is about..? 😄
Avatar
ahaha
Avatar
it's 2 threads
Avatar
+1 for two separate threads
3l3ktr4 started a thread. 06/03/2023 16:54
ntoll started a thread. 06/03/2023 16:55
Avatar
synclink/worker branch 🧵
Avatar
🥁 🥁 🥁 ... I have a branch of pyscript in which pyodide actually runs in a web worker 🎉🎉🎉 It's a complete hack and it's based on the excellent synclink branch which @madhurt and @hood started in Lisbon, but it's complete enough that test_pyscript_hello passes. It's very likely that this branch will never be merged and that I'll have to re-do it on top of the synclink branch once it's done, but it's cool to see that it actually works. https://github.com/pyscript/pyscript/tree/antocuni/play-with-workers
🎉 3
🤯 1
👏 1
Avatar
Yesterday & Today BOT 07/03/2023 07:00
📆 Yesterday & Today - 03/07/2023 🧵
Avatar
can't we remove that pre-commit commit every time we push? I always have to force push, if I want to correct something it's a bit annoying idk if there's a better way to handle it though (edited)
Avatar
oh, it seems like discussions can't be closed like issues... should we lock them once they're not relevant anymore or should we just leave them open?
12:21
also, are we currently interested in creating an npm package for pyscript?
antocuni started a thread. 07/03/2023 16:11
Jeff Glass started a thread. 07/03/2023 17:02
Avatar
Avatar
hood
Though there are many other better designs one might consider especially taking into account what might happen to plugins once the worker split occurs
Yeah, we'll need to revisit make things. That's also why I've been holding a bit on more plugins work
Avatar
Yesterday & Today BOT 08/03/2023 07:00
📆 Yesterday & Today - 03/08/2023 🧵
Avatar
Avatar
hood
Though there are many other better designs one might consider especially taking into account what might happen to plugins once the worker split occurs
we could also declare that you cannot inject <py-script> tags dynamically (or, equivalently, that if you do they are not executed). Originally I introduced that test because it was easy to implement and mimics the behaviour of <script>, but I'm not 100% of what are good use cases for it
Avatar
Well the issue I'm more concerned about is behavior like this: https://github.com/pyscript/pyscript/blob/main/pyscriptjs/src/plugins/python/py_tutor.py#L82-L94 it would probably be better to implement this in JavaScript in the main thread though I suppose it should be possible to keep it like this with synclink
Home Page: https://pyscript.net Examples: https://pyscript.net/examples - pyscript/py_tutor.py at main · pyscript/pyscript
Avatar
Avatar
antocuni
we could also declare that you cannot inject <py-script> tags dynamically (or, equivalently, that if you do they are not executed). Originally I introduced that test because it was easy to implement and mimics the behaviour of <script>, but I'm not 100% of what are good use cases for it
Jeff Glass 08/03/2023 11:32
The use case I see is is with reactive or dynamic UI’s, where the page is loading certain page elements/sections in response to data or user response; the page should be able to load and execute the py-script tags as applicable to each section when loaded; and if we ultimately want that UI behavior to be achievable from within PyScript, then we need dynamically added tags to behave in a roughly sensible way. (edited)
11:33
Though agreed we have some work to do on what is “sensible” and potentially the API around it as well
Avatar
Avatar
Jeff Glass
The use case I see is is with reactive or dynamic UI’s, where the page is loading certain page elements/sections in response to data or user response; the page should be able to load and execute the py-script tags as applicable to each section when loaded; and if we ultimately want that UI behavior to be achievable from within PyScript, then we need dynamically added tags to behave in a roughly sensible way. (edited)
I don't understand why you need to actually put <py-script> tags in the DOM. I see two scenarios: 1. I want to execute python code from JS: currently you can add a <py-script> tag, but we can imagine providing an API to just call a python function or a snippet of python code. Something like pyscript.runPython("...."). 2. I want to execute python code from python: in that case, just call a function and/or import a module. Am I missing anything? (edited)
Avatar
Hmmm... I can see that js has a localStorage attribute when I: import js print(dir(js)) But when I try to: from js import localStorage I get: ImportError: cannot import name 'localStorage' from 'js' (unknown location) Help!!?!?!
12:14
I was kinda expecting it to "just work" ™️
Avatar
Just been Googling... and folks seem to think it should be there... https://realpython.com/pyscript-python-in-browser/
In this tutorial, you'll learn about PyScript, a new framework that allows for running Python in the web browser with few or no code modifications and excellent performance. You'll leverage browser APIs and JavaScript libraries to build rich, highly interactive web applications with Python.
12:27
...and other things in the js "namespace" work: from js import alert alert("hi")
antocuni started a thread. 08/03/2023 12:28
Avatar
FabioRosado 08/03/2023 12:56
Added tests for the snippets in the docs and fixed a small issue with the requests tutorial. Can someone review? https://github.com/pyscript/pyscript/pull/1264
Jeff Glass started a thread. 08/03/2023 13:10
Avatar
Pytest plugin for testing applications that use Pyodide - GitHub - pyodide/pytest-pyodide: Pytest plugin for testing applications that use Pyodide
Avatar
Jeff Glass 08/03/2023 20:41
What's New in PyScript 2023.03.1
20:41
The What's New section isn't finished, obviously, will need to put a button on that tonight
Avatar
Avatar
Jeff Glass
The What's New section isn't finished, obviously, will need to put a button on that tonight
Jeff Glass 08/03/2023 20:51
It'll mostly be a call-to-action - "Here's where the team is so far on web workers, events, and plugins. Want to weigh in or contribute? Now's your chance!"
Avatar
Yesterday & Today BOT 09/03/2023 07:00
📆 Yesterday & Today - 03/09/2023 🧵
Avatar
I am kinda fixing tests related to py-repl on the synclink branch since they are flaky and have lots of timing issues. owing to that, I randomly tried a test called test_run_clears_previous_output according it the title, there should be only 1 cell, since we clear the previous one and run it again but using the --dev, it seems like there are 2 cells This can also be seen in other related tests like test_python_exception_after_previous_output and test_hide_previous_error_after_successful_run Let me know if this is expected aka I am interpreting this incorrectly OR if the test itself is incorrect?
antocuni started a thread. 09/03/2023 14:12
Avatar
Hi, Thank you for pytest-pyodide. Context: I&#39;m trying to run some &quot;normal&quot; tests inside Pyodide with PyTest and Chrome. Problem: no matter what I put into the test functio...
Avatar
Yesterday & Today BOT 10/03/2023 07:00
📆 Yesterday & Today - 03/10/2023 🧵
Avatar
is there a way to use a "dynamic import" to load pyodide without adding the <script> tag to the DOM? I tried this: let mod = await import("https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js"); However, the resulting mod seems to be empty: > mod Module {Symbol(Symbol.toStringTag): 'Module'}
Avatar
Avatar
antocuni
is there a way to use a "dynamic import" to load pyodide without adding the <script> tag to the DOM? I tried this: let mod = await import("https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js"); However, the resulting mod seems to be empty: > mod Module {Symbol(Symbol.toStringTag): 'Module'}
uhm, if I understand correctly, after the await import() the mod is empty, but loadPyodide is available in the global namespace. Is this expected? 🤔
Avatar
tedpatrick 10/03/2023 13:31
We are feature complete for a release of PyScript this week. We need your help testing 2023.03.1. How to test 2023.03.1.RC2 &lt;link rel=&quot;stylesheet&quot; href=&quot;https://py...
🎉 2
Avatar
Avatar
tedpatrick
Jeff Glass 10/03/2023 14:11
Release post is standing by! I'm heading out of town this evening for a week or so (vacation and a conference), but I'll get the post up whenever we release, maybe with a bit of a delay.
14:11
A little teaser of the bonus demo included in that post 😇
🎉 3
🤩 2
❤️ 2
Avatar
Avatar
Jeff Glass
Release post is standing by! I'm heading out of town this evening for a week or so (vacation and a conference), but I'll get the post up whenever we release, maybe with a bit of a delay.
tedpatrick 10/03/2023 14:11
I believe today is the day.
tedpatrick started a thread. 10/03/2023 16:39
Avatar
Per @tedpatrick post above. Ted and I are about to go off on vacation... I just tested all the examples locally (pointing to https://pyscript.net/snapshots/2023.03.1.RC2/pyscript.js) and the all were working fine. Ship it ?
🚢 3
Avatar
Aaaaaaaand, thanks to @tedpatrick , its out! https://github.com/pyscript/pyscript/releases/tag/2023.03.1
New Contributors @romankehr made their first contribution in #1052 @NayanKhedkar made their first contribution in #1058 @Anash3 made their first contribution in #1129 @IanoNjuguna made their first...
🚢 3
🦜 3
🤖 2
👾 3
Avatar
Avatar
Fabio
Aaaaaaaand, thanks to @tedpatrick , its out! https://github.com/pyscript/pyscript/releases/tag/2023.03.1
Jeff Glass 11/03/2023 01:17
Here's the final release blog post! https://jeff.glass/post/whats-new-pyscript-2023-03-1/
What's New in PyScript 2023.03.1
😍 2
🎉 1
Avatar
Avatar
Jeff Glass
Here's the final release blog post! https://jeff.glass/post/whats-new-pyscript-2023-03-1/
Seriously @Jeff Glass , you write the best release notes I've ever seen 😍😍😍
🤗 1
Avatar
Avatar
Fabio
Seriously @Jeff Glass , you write the best release notes I've ever seen 😍😍😍
Jeff Glass 11/03/2023 01:50
Thanks @Fabio ! Enjoy your vacation!!
🙏 1
Avatar
Avatar
antocuni
is there a way to use a "dynamic import" to load pyodide without adding the <script> tag to the DOM? I tried this: let mod = await import("https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js"); However, the resulting mod seems to be empty: > mod Module {Symbol(Symbol.toStringTag): 'Module'}
you should do let mod = await import("https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.mjs");
22:44
with one extra m
22:45
and then mod.loadPyodide will be the loadPyodide function and
22:45
the global namespace will be unaltered
Avatar
Yesterday & Today BOT 13/03/2023 07:00
📆 Yesterday & Today - 03/13/2023 🧵
Avatar
Hi folks, today I will mostly be preparing presentations and talks (Home Office).
Avatar
Avatar
Jeff Glass
A little teaser of the bonus demo included in that post 😇
oh wow
12:20
wow Jeff, just wow just that
Avatar
@madhurt I and @hood have just merged the PR #1265 (the one about ESLint) but now the synclink branch has conflict. We are currently working on the code of synclink itself, so if you have time and feel like rebasing the branch, it would be appreaciated 🙂
Avatar
Yes, I will rebase, thanks @antocuni
Avatar
thanks!
Avatar
Yesterday & Today BOT 14/03/2023 07:00
📆 Yesterday & Today - 03/14/2023 🧵
Avatar
hi channel, @Andrea Giammarchi would like to write on this channel but he doesn't have enough permissions. Does anybody know how to give him enough permissions?
Avatar
FabioRosado 14/03/2023 09:49
We need one of the admins to add @Andrea Giammarchi to the maintainers role
Avatar
@Leonard Wolf could you do it please?
Avatar
Leonard Wolf 14/03/2023 10:42
Aye let me
10:43
@Andrea Giammarchi hey pls try
Avatar
Avatar
Leonard Wolf
@Andrea Giammarchi hey pls try
Andrea Giammarchi 14/03/2023 10:46
all good, thanks a lot 🙏
Avatar
Avatar
Andrea Giammarchi
all good, thanks a lot 🙏
Leonard Wolf 14/03/2023 10:50
Happy to help!
Avatar
Avatar
Leonard Wolf
Happy to help!
Thank you Leonard 🙏
Avatar
Avatar
antocuni
Thank you Leonard 🙏
Leonard Wolf 14/03/2023 12:40
Happy to help!!
Avatar
FabioRosado 14/03/2023 15:19
Hey folks I'm going to pick up my son from the nursery so i wont be in the meeting. But I haven;t been doing much on the open source side of things 😄
👍 1
Avatar
@antocuni I have rebased the synclink branch, a lot of examples fail due to not being able to create an instance of py-tutor plugin. Will push some more changes though. And will collaborate with @hood again today....
Avatar
Yesterday & Today BOT 15/03/2023 07:00
📆 Yesterday & Today - 03/15/2023 🧵
Avatar
Avatar
madhurt
@antocuni I have rebased the synclink branch, a lot of examples fail due to not being able to create an instance of py-tutor plugin. Will push some more changes though. And will collaborate with @hood again today....
thank you @madhurt this is a very useful information!
Avatar
i'll be on a youtube interview tomorrow
woooo, congrats @3l3ktr4 ! Who is going to interview you?
Avatar
a colleague from saucelabs 🙂
15:13
idk exactly what it is tbh
15:14
the means I just know my part on it
Avatar
Andrea Giammarchi 15/03/2023 17:51
Hello, I am not sure this is the most appropriate channel to discuss this, but I wonder if there's any background around saving the pyodide.asm.data or pyodide.wasm.data locally, via IndexedDB, as opposite of asking it to a CDN, 'cause apparently files bigger than 1MB don't benefit anymore from browser cache via CDN (Safari and recently Chrome) ... or at least, that's what I am observing in the REPL, where that file, despite the etag and other techniques, is always retrieved from the network (3.2MB).
17:53
My thinking is that because the version of pyscript is "pinned by design", having it locally should kinda improve repeated access to the same domain, whenever it uses those files to serve users.
17:53
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solut...
17:57
if anyone is interested in knowing more this is just one article that seems to explain the what and the why https://www.peakhour.io/blog/cache-partitioning-firefox-chrome/
17:59
using IndexedDB can't solve (AFAIK) the cross site boost up, but for very frequently accessed same sites it might be desirable (if the HD is faster than the network, of course). My thinking is that if there's no version entry in the IndexedDB, it's fetched and stored as blob/file and from that time on returned from the local IndexedDB instance. Any thoughts or insights to share? Thanks!
Avatar
Yesterday & Today BOT 16/03/2023 07:00
📆 Yesterday & Today - 03/16/2023 🧵
antocuni started a thread. 16/03/2023 10:38
Avatar
Yesterday & Today BOT 17/03/2023 07:00
📆 Yesterday & Today - 03/17/2023 🧵
07:01
📆 Yesterday & Today - 03/17/2023 🧵
Avatar
Yesterday & Today BOT 20/03/2023 07:00
📆 Yesterday & Today - 03/20/2023 🧵
07:01
📆 Yesterday & Today - 03/20/2023 🧵
Avatar
@hood I plan to work more on the pyodide static build. Did you do any progress on it that I should be aware of?
Avatar
Andrea Giammarchi 20/03/2023 10:27
to whom it might concern, I've asked a question around slots in our components, as I think there's room for simplification (and reduced code) https://github.com/pyscript/pyscript/discussions/1295
I am going through the code and wondering what is the idea, or background, behind the usage of slot elements in our components. In case it helps anyone, slots are not meant to be generic containers...
Avatar
I'm confused about the use of py-config { "interpreters": [{ "src": "https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js", "name": "pyodide-0.22.1", "lang": "python" }], "plugins": [{ "src": "./pyvizzu.py" }], "fetch": [{ "files": ["./ab.py"] }] } Is this how the json file should look?
11:00
regarding the toml file how do I know which syntax to use when do I use [[runtimes]] for example or plugins = [] etc, are they equivalent? @madhurt
11:00
thanks!
Avatar
plugins is just a list aka plugins = [ "https://pyscript.net/latest/plugins/python/py_markdown.py", "https://pyscript.net/latest/plugins/python/py_tutor.py" ] should work for a TOML based config [[interpreters]] is correct since that is a list of dictionary fetch is also a list of dictionaries so you have to use [[fetch]] when using it via TOML
11:10
^^see the above link for more information
Avatar
Jeff Glass 20/03/2023 11:16
In the language of the TOML spec, each instance of [[fetch]] adds a table (dictionary) to the array “fetch”; similarly with [[interpreters]]. https://toml.io/en/v1.0.0#array-of-tables
👍 1
Avatar
aha
Avatar
well, then maybe I found a bug in the json parsing... or impl. I have no idea about that side of the code
11:29
but when I try to import a plugin using json I get the error Uncaught (in promise) TypeError: singleFile.endsWith is not a function and when I use the equivalent code in toml, the plugin is just successfully imported
Avatar
Avatar
3l3ktr4
but when I try to import a plugin using json I get the error Uncaught (in promise) TypeError: singleFile.endsWith is not a function and when I use the equivalent code in toml, the plugin is just successfully imported
Andrea Giammarchi 20/03/2023 11:33
watch out there the plugin is not a string but an object, so singleFile.src.endsWith should work in that case, if I understand what's happening there (edited)
11:33
"plugins": [{ "src": "./pyvizzu.py" }],
11:34
I meant here the plugin is not typeof singleFile === 'string' it's a type of object so the parser could be smart, otherwise you should write just "./pyvizzu.py" instead, not {"src": "./pyvizzy.py"} (edited)
Avatar
ah yeah! great, thanks @Andrea Giammarchi!
👍 1
11:40
that's exactly it 🙂
🥳 1
Avatar
Andrea Giammarchi 20/03/2023 11:43
a11y related: it looks like in the name of better accessibility we made it worse by using the same IDs for buttons and labels that use these buttons over and over again. Especially because our labels are not even visible, I suggest we consider either approaches: 1. we use aria-labelledby instead https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby , where the same label is applied to more than one element (requires a unique known element on the DOM we cna decide to keep hidden) 2. we simply use aria-label avoiding the creation of extra elements and confining the label to the button instead so that it doesn't need a duplicated runButton id and it doesn't need a label element around that doesn't necessarily point at that button neither ... thoughts? P.S. within ShadowDOM IDs can be unique (in there) but because we're not placing stuff within SD but also we're appending clones multiple times, I suggest we just move the label to the button and call it a day
The aria-labelledby attribute identifies the element (or elements) that labels the element it is applied to.
Avatar
Btw, congratulations to @Andrea Giammarchi for his first merged PR 🎉
🥳 5
🙏 2
Avatar
Andrea Giammarchi 20/03/2023 17:02
esbuild related: both @hood and @antocuni gave me the idea of trying esbuild to see if we can improve build time ... well, this PR is a Work In Progress https://github.com/pyscript/pyscript/pull/1298 but I am already super satisfied by the results ... what I'd like to understand here (or there) is if we should just drop all rollup dependencies, keep just esbuild, and if that's the case, should we use a .js file to orchestrate that so that we have one command to watch and serve examples, as npm run dev does now? For the time being I am just using npm run server which is a python -m http.server and a npm run esbuild-dev which watches files ... beside having dependencies simplified, it takes ~50ms to build either minified or not with source maps (edited)
Description This PR would like to explore the usage of esbuild instead of rollup. Changes Added 3 extra scripts for npm: esbuild to build production code esbuild-dev to build and watch without min...
Avatar
Avatar
Andrea Giammarchi
esbuild related: both @hood and @antocuni gave me the idea of trying esbuild to see if we can improve build time ... well, this PR is a Work In Progress https://github.com/pyscript/pyscript/pull/1298 but I am already super satisfied by the results ... what I'd like to understand here (or there) is if we should just drop all rollup dependencies, keep just esbuild, and if that's the case, should we use a .js file to orchestrate that so that we have one command to watch and serve examples, as npm run dev does now? For the time being I am just using npm run server which is a python -m http.server and a npm run esbuild-dev which watches files ... beside having dependencies simplified, it takes ~50ms to build either minified or not with source maps (edited)
Andrea Giammarchi 20/03/2023 17:03
this looks promising to me
Avatar
Avatar
Andrea Giammarchi
esbuild related: both @hood and @antocuni gave me the idea of trying esbuild to see if we can improve build time ... well, this PR is a Work In Progress https://github.com/pyscript/pyscript/pull/1298 but I am already super satisfied by the results ... what I'd like to understand here (or there) is if we should just drop all rollup dependencies, keep just esbuild, and if that's the case, should we use a .js file to orchestrate that so that we have one command to watch and serve examples, as npm run dev does now? For the time being I am just using npm run server which is a python -m http.server and a npm run esbuild-dev which watches files ... beside having dependencies simplified, it takes ~50ms to build either minified or not with source maps (edited)
wow, 50ms is super fast 🤩
if we should just drop all rollup dependencies, keep just esbuild
I don't understand: if esbuild is a substitute for rollup, why would we want to keep it? Do we use it more other things?
Avatar
how to import a js lib in the python side? 🧶 (edited)
Avatar
Avatar
antocuni
wow, 50ms is super fast 🤩
if we should just drop all rollup dependencies, keep just esbuild
I don't understand: if esbuild is a substitute for rollup, why would we want to keep it? Do we use it more other things?
Andrea Giammarchi 20/03/2023 17:11
current rollup config does a few more things and to me is rather a question of keep doing just those things with rollup or just use esbuild and do those things without any library ... at the end it looks like it's more a matter of copying stuff here and there so we might just drop it completely
Avatar
Avatar
Andrea Giammarchi
current rollup config does a few more things and to me is rather a question of keep doing just those things with rollup or just use esbuild and do those things without any library ... at the end it looks like it's more a matter of copying stuff here and there so we might just drop it completely
if we use rollup for just copying files around, I'd say to move this logic in the makefile or in some other place But again, I know very few about these topics, so I'll let other people decide ( @tedpatrick maybe knows more?)
Avatar
Avatar
antocuni
if we use rollup for just copying files around, I'd say to move this logic in the makefile or in some other place But again, I know very few about these topics, so I'll let other people decide ( @tedpatrick maybe knows more?)
Andrea Giammarchi 20/03/2023 17:16
honestly I love Makefile but it's not super common to use it for JS devs although, if that's the outcome/solution, we can as well just use cp or any common *nix operations within npm scripts and call it a day ... to which I'd be OK as I don't think Windows users would ever use Makefile anyway, or better this doesn't seem to be a concern until now, but WSL for Windows would still work perfectly fine.
Avatar
Avatar
Andrea Giammarchi
honestly I love Makefile but it's not super common to use it for JS devs although, if that's the outcome/solution, we can as well just use cp or any common *nix operations within npm scripts and call it a day ... to which I'd be OK as I don't think Windows users would ever use Makefile anyway, or better this doesn't seem to be a concern until now, but WSL for Windows would still work perfectly fine.
Andrea Giammarchi 20/03/2023 17:17
we could also just write few lines of nodejs to copy stuff over or use a file that uses esbuild as a module, instead of a CLI (like I've done in the PR) ... I guess these are the only things to clarify before I drop the WIP and propose a full migration.
Avatar
Avatar
Andrea Giammarchi
we could also just write few lines of nodejs to copy stuff over or use a file that uses esbuild as a module, instead of a CLI (like I've done in the PR) ... I guess these are the only things to clarify before I drop the WIP and propose a full migration.
Andrea Giammarchi 20/03/2023 17:25
btw, the WIP PR is mostly to allow anyone to fetch it and test it locally via npm run esbuild or npm run esbuild-dev to measure locally differences ... I think just the fact we'll need one dependency instead of dozens is a pros, but maybe not everyone is experiencing the same speed improvement (and CI is not using it right now so I don't know about that neither)
Avatar
Avatar
Andrea Giammarchi
btw, the WIP PR is mostly to allow anyone to fetch it and test it locally via npm run esbuild or npm run esbuild-dev to measure locally differences ... I think just the fact we'll need one dependency instead of dozens is a pros, but maybe not everyone is experiencing the same speed improvement (and CI is not using it right now so I don't know about that neither)
Andrea Giammarchi 20/03/2023 17:26
P.S. apologies I am really bad at making threads ... sorry @3l3ktr4 in particular I've polluted this channel too much 😢 (edited)
Avatar
no problem at all @Andrea Giammarchi! 🙂
Avatar
Thanks for working on this @Andrea Giammarchi!
use a file that uses esbuild as a module, instead of a CLI
+1 for this
maybe not everyone is experiencing the same speed improvement
but probably they are 🙂
👍 1
Avatar
wow, I just tried the esbuild branch and the build is instant 😍. That's awesome
Avatar
Yesterday & Today BOT 21/03/2023 07:00
📆 Yesterday & Today - 03/21/2023 🧵
Avatar
Andrea Giammarchi 21/03/2023 10:42
is anyone familiar with this error? I am working on esbuild and I have most demo working but the REPL is badly broken and it's hard to understand why ...
10:47
FWIWI it looks like all demo except those using codemirror are working fine with esbuild ... maybe I should try to update it ...
10:49
yeah ... that fixed it 🥳
🎉 1
Avatar
Andrea Giammarchi 21/03/2023 12:38
FYI this is now final with docs updated too and test were green already (it's running again as I've just pushed the docs) https://github.com/pyscript/pyscript/pull/1298
Description This PR migrates building tasks to esbuild so that it takes ~100ms instead of 6 seconds to create our artifacts. Changes removed all rollup dependencies and related files created an es...
12:39
While doing that PR I've realized we copy .ts files inside the build folder as they are (even with rollup) ... not sure those files are usable in the wild ... any insight to share?
Avatar
hey @hood when you convert objs from py to js you lose some properties or maybe they just change? so... do you know how to access stuff like `py_function.__call__()? in the js side? (edited)
Avatar
e.g., t = pyodide.runPython(` class T: def __call__(self, x): print("called T with arg", x) return x + 1 T() `); t(3) t.__call__(3) (edited)
Avatar
humm this is not working for me, it's what I tried (calling __call__ in the obj that should have a call method) I'm executing code using eval though which I get from the interpreter const pyEval = interpreter.globals.get('eval') which is ultimately doing what you did up there ^ (edited)
14:44
maybe when I'm evaluating the code this information changes? or get lost smh?
Avatar
I guess... it's somehow related to the add_event_listener from pyodide not sure why but every time I use it, I can't use callable to figure out if something is callable but every time I don't, works normally so I don't think it's related to the eval stuff
Avatar
if callable returns a false positive / negative, that is a bug so it would be good to get a reproduction
Avatar
I'll try to make a small reproducible example 🙂
Avatar
I could appreciate some help with the synclink branch, basically, apart from the 4 integration tests that fail -- which @hood is picking up, there is also an issue with a unit test -- aka jest related issues. This can be seen by executing make test-ts My hunch is that it is really related to setting up jest.config etc. Basically, I remember using the following snippet before: import { TextEncoder, TextDecoder } from 'util'; global.TextEncoder = TextEncoder; global.TextDecoder = TextDecoder; in pyodide.test.ts But with the synclink integration, we get ReferenceError: TextDecoder is not defined again Also, this is a very common issue it seems -- https://stackoverflow.com/questions/68468203/why-am-i-getting-textencoder-is-not-defined-in-jest In any case, my commit which accommodates the unit test with synclink is present here: https://github.com/pyscript/pyscript/pull/1258/commits/6fe6f11679a49cebb3efa91bdff6b5a7585cadd9
Avatar
Andrea Giammarchi 21/03/2023 19:51
I forgot jest uses jsdom behind the scene, which is slow and not at pair with the environment, so maybe using https://github.com/mikemadest/jest-environment-linkedom would help? I'm the LinkeDOM author, so I can help there 👍
Trying to make linkedom works in a jest project. Contribute to mikemadest/jest-environment-linkedom development by creating an account on GitHub.
👍🏼 1
19:53
A triple-linked lists based DOM implementation. Contribute to WebReflection/linkedom development by creating an account on GitHub.
Avatar
Yesterday & Today BOT 22/03/2023 07:00
📆 Yesterday & Today - 03/22/2023 🧵
Avatar
esbuild vs rollup 🧵
Avatar
hey folks I'm rebasing a pr with docs... and noticed we don't have a "how to session" anymore what happened to that? did we moved it smw else?
13:11
ahhm it disappeared from our menus..
13:12
ah it's inside guides I guess
Avatar
Andrea Giammarchi 22/03/2023 14:15
Node.JS version 🧵
Avatar
Jeff Glass 23/03/2023 01:58
Experimenting with a PR adds an option to py-config that makes the py-terminal a full xtermjs terminal. Dynamically loaded only if that option is true so as not to increase bundle size. Mostly kinda working (and working with @Andrea Giammarchi 's new docked terminal), though some oddness around resizing. Just wanted to share, as it's fun
🥳 1
😍 2
🙂 1
Avatar
Yesterday & Today BOT 23/03/2023 07:00
📆 Yesterday & Today - 03/23/2023 🧵
Avatar
Avatar
Jeff Glass
Experimenting with a PR adds an option to py-config that makes the py-terminal a full xtermjs terminal. Dynamically loaded only if that option is true so as not to increase bundle size. Mostly kinda working (and working with @Andrea Giammarchi 's new docked terminal), though some oddness around resizing. Just wanted to share, as it's fun
this is awesome 😍 And as soon as we have workers, we will be able to use it also for input()
08:33
and .e.g pdb.set_trace()
Avatar
Avatar
antocuni
and .e.g pdb.set_trace()
FabioRosado 23/03/2023 09:43
You had me at pdb 😆
😅 1
Avatar
Andrea Giammarchi 23/03/2023 13:51
apologies for the probably awkward question (because maybe it's just my IDE doing things wrong) ... do I understand correctly most projects are developed with 4 spaces indentation instead of tabs (not asking about Makefile tabs, rather about python or JS code) ... if that's the case, any particular reason/discussion to spare around this?
13:53
(maybe I should open a tabs VS spaces thread by my experience says that never ended well ... or at all 😅)
antocuni started a thread. 23/03/2023 14:29
Avatar
Naming conventions in JS 🧵
Avatar
Andrea Giammarchi 23/03/2023 14:41
in other news, and to whom it might concern, I've just published a dumb GitHup page to test anything we'd like to test if it's available or not in Web Workers ... example: https://webreflection.github.io/is-it-worker/?self ... this comes after some debugging and messing around the jest JSDOM environment so that now there is a super easy way to be sure some global class or namespace is also available in Web Workers, it's not us mocking too much. I hope this helps @hood or @madhurt (or others) in the future. (edited)
🙌🏼 3
👏 1
Avatar
Heads up. Just added @hood and @Andrea Giammarchi to the pyscript-write group so you both have wr rights once you accept :).
🎉 2
Avatar
Thanks @Fabio!
🍻 1
Avatar
CORS headers 🧵
Avatar
Yesterday & Today BOT 24/03/2023 07:00
📆 Yesterday & Today - 03/24/2023 🧵
Avatar
Avatar
Fabio
Heads up. Just added @hood and @Andrea Giammarchi to the pyscript-write group so you both have wr rights once you accept :).
Andrea Giammarchi 24/03/2023 09:34
I think I am not able to push anymore to my own fork of the branch now ... 😅 ... trying to figure out what's going on - solved (edited)
Avatar
Plan for Web workers 🧵
Avatar
@Maintainers please read the thread above since it affects everyone 👆
👍 1
Avatar
https://github.com/pyscript/pyscript/pull/1258 is ready and mergeable, I have removed WIP Could really appreciate help in making ESLint happy though
15:09
^^also includes lots of fixes for various py-repl based tests
15:10
cc: @antocuni and @hood thanks @Andrea Giammarchi for help with jest related issues
Avatar
thank you for your work @madhurt ! I'm very happy to see that tests are green. However, the branch is not mergeable until the whole build is green (including eslint). The point is that if we merge a PR which makes the build red, we cannot know whether subsequent PRs would be red because of that or because they introduced more failures. I'm happy to skip individual problems to make eslint green (assuming that they will be fixed properly soon), but not to make eslint red.
15:15
That said, we should sit down as a team and decide whether eslint and/or the current set of rules are useful or not. But this is another discussion
Avatar
Yeah, regarding eslint, we need to define the type of proxyClass basically I remember @hood changed it to any while there were issues with keeping it as PyProxyCallable Further, it seems like it doesn't allow us to use @ts-ignore which we do for the line: this.globals = this._remote.globals as PyProxyDict; Fixing these 2 should be enough I guess
Avatar
I guess you can disable eslint for a specific line using this: https://stackoverflow.com/a/29592334
15:22
about @ts-ignore, I think we should disable that eslint rule. It doesn't make sense to complain about it (if we decide that it's fine to explicitly ignore typescript types for the next line, it means that we know what we are doing and eslint should just agree with us)
👍 1
Avatar
Agree the @ts-ignore rule is really dumb
15:24
there were issues with keeping it as PyProxyCallable
The problem with keeping it as PyProxyCallable is that it is inaccurate so even if it doesn't result in any type errors it is still nonsense. Same issue with this.globals = this._remote.globals as PyProxyDict.
15:24
It needs to be something like SynclinkProxy<PyProxyCallable>
15:25
and SynclinkProxy<PyProxyDict>
Avatar
why can't we just use any?
15:37
ideally, I'd like to use a naming convention for pyproxies, synclink proxies and sinclink proxy of a pyproxy. Something like py_*, r_* and rpy_* (with or without the underscore, I don't care).
Avatar
Jeff Glass 26/03/2023 02:37
PR 1310 is up for quick review - the new beforePyReplExec and afterPyReplExec plugin hooks should be optional for js plugins to implement or not https://github.com/pyscript/pyscript/pull/1310
Description Makes the new methods beforePyReplExec and afterPyReplExec from #1106 optional for plugin classes, just like I did for all the other methods in #1134. An oversight of mine, working on ...
❤️ 1
Avatar
Avatar
antocuni
why can't we just use any?
We can just use any
Avatar
is github very slow/half down only for me?
👍 1
13:24
ok, according to twitter it's not only me
Avatar
Avatar
antocuni
ok, according to twitter it's not only me
Jeff Glass 27/03/2023 13:32
Avatar
I'm having problems too
Avatar
Avatar
Jeff Glass
PR 1310 is up for quick review - the new beforePyReplExec and afterPyReplExec plugin hooks should be optional for js plugins to implement or not https://github.com/pyscript/pyscript/pull/1310
taking a look rn thanks Jeff!
❤️ 1
Avatar
this pr is pure wholesome energies thanks for taking over @Andrea Giammarchi 🙂
🙏 1
Avatar
Avatar
3l3ktr4
this pr is pure wholesome energies thanks for taking over @Andrea Giammarchi 🙂
Andrea Giammarchi 27/03/2023 15:56
glad to help but which PR? I'm after reading/commenting on few of them ... is this the src related to custom elements? 'cause I've just read about other src problems and I am not sure any ot these two is related
Avatar
Avatar
Andrea Giammarchi
glad to help but which PR? I'm after reading/commenting on few of them ... is this the src related to custom elements? 'cause I've just read about other src problems and I am not sure any ot these two is related
Andrea Giammarchi 27/03/2023 16:13
I think it's about the custom elements one ... yes, I loved the idea, and it's coming up super nicely 🥳 ... thanks for supporting it, I never meant to take over you, just wanted to bring in some possible improvement around it
Avatar
FWIW, I'm re-enabling blank issues in PR https://github.com/pyscript/pyscript/pull/1311. I don't think we never had any problem with people abusing them, so I don't see why they should be disabled
Avatar
everything is Green: https://github.com/pyscript/pyscript/pull/1258 shall we merge?
🚢 3
✅ 1
Avatar
GO 🟢
🚢 1
Avatar
and merged! + made sure to write a single line clean comment instead of all the commits which appear when doing squash and merge
🎉 1
🛳️ 1
Avatar
Avatar
madhurt
and merged! + made sure to write a single line clean comment instead of all the commits which appear when doing squash and merge
yes, this is a good practice. However, for such a big PR the commit should be MUCH longer and detailed. For example, look at my commits 58f7c21 and f9194cc. Anyway, it's still a very good PR, good job 💪
👍🏼 1
🛳️ 1
Avatar
Jeff Glass 27/03/2023 18:41
Huge props to all those involved in this enormous leap! 🎊🎉🥳
🚢 2
🙏 1
Avatar
Uh? The bot didn't create a Yesterday & Today thread? 🤔
09:52
📆 Yesterday & Today - 03/28/2023 🧵
Avatar
Avatar
antocuni
Uh? The bot didn't create a Yesterday & Today thread? 🤔
Andrea Giammarchi 28/03/2023 13:11
I see not everyone is participating and once I've filled it myself alone ... which is fine, yet I've been wondering if we have this rule as daily async standup or not, just to understand how much attention I should give to the thread (and to clarify, I'm OK with it) (edited)
Avatar
Avatar
Andrea Giammarchi
I see not everyone is participating and once I've filled it myself alone ... which is fine, yet I've been wondering if we have this rule as daily async standup or not, just to understand how much attention I should give to the thread (and to clarify, I'm OK with it) (edited)
I think we do have this rule. I don't know why people don't respect it 🤷‍♂️
Avatar
Avatar
antocuni
I think we do have this rule. I don't know why people don't respect it 🤷‍♂️
Something to remind folks of in this afternoon's catch up call..?
👍 1
Avatar
tedpatrick 28/03/2023 14:35
It is a great habit for the whole team. It is our standup, if we do not participate, we can always make it a meeting.
Avatar
Avatar
tedpatrick
It is a great habit for the whole team. It is our standup, if we do not participate, we can always make it a meeting.
Virtuoso nerd sniping there @tedpatrick
Avatar
Honestly I really really think we should have a small team working agreement that we can stick to and use are reference..... As a reminder us and as a tool for onboarding as well. We talked about it a few times.. It's on my todo list but that list is long. 🙂
Avatar
sigh, the Y&T bot is definitely broken, it didn't work today as well
08:31
📆 Yesterday & Today - 03/29/2023 🧵
Avatar
Andrea Giammarchi 29/03/2023 13:42
to whom it might concern, yesterday we had a quite lengthy discussion about the idea of moving away bootstrap logic from page/UI components where code doesn't really belong to (imho) ... as that discussion has been done internally I've took a few minutes to summarize the current status, its possible issues in the wild, and the proposal to improve in that area and I'd love to hear your thoughts around this topic 🙏 https://github.com/pyscript/pyscript/discussions/1326 (edited)
I've demoed a quick PoC which uses <script> tags to bootstrap pyscript as opposite of using non visual related custom elements to do so, such as <py-script> and <py-config>, w...
🎉 1
Avatar
@hood
read manylinux peps again
what do you need to do w.r.t. manylinux? (Just curious :))
Avatar
Still just thinking about an Emscripten wheel pep. I'm trying to understand the implications of pep 600 for us...
👍 1
Avatar
also @hood , since you are going to split pyscript/__init__.py into multiple files: one thing which I would really like is to have a pyscript._internal (or a similar name) for all the things which are needed by pyscript itself but should not be called by the users (e.g. the new _run_python). If we put them inside _internal, we can probably even remove the leading underscore from the individual functions
👍 1
Avatar
agreed we definitely need something like that
15:40
there are a lot of things in the pyscript package that it's not clear if they are intended to be exported
15:41
e.g., the top level await checker stuff doesn't have underscore prefixes but
15:41
I'm pretty sure it's not intended as public API
Avatar
yes, it's a file which just grew unorganically
Avatar
<rant> I hate squash&merge. It makes it very hard to develop a PR on top of another one, because when you merge it git creates a completely unrelated commit and you are no longer able to just git merge main </rant>
👍 1
Avatar
Questions about RemoteInterpreter 🧵
hood started a thread. 29/03/2023 18:14
Avatar
@hood can I call pyodide.registerComLink(Synclink) even if I am on the main thread? Does it have any negative consequences?
Avatar
Avatar
antocuni
<rant> I hate squash&merge. It makes it very hard to develop a PR on top of another one, because when you merge it git creates a completely unrelated commit and you are no longer able to just git merge main </rant>
yes and no
Avatar
Avatar
hood
yes and no
uh? Maybe you clicked reply on the wrong message? Else it doesn't make sense 😅
18:45
I'm replying to the two questions directly above
18:45
sorry
Avatar
sure, np
Avatar
as I've mentioned before, registerComlink has no test coverage in Pyodide so there's a few broken code paths
18:47
it
18:47
is certainly better than not doing it though
18:47
I should add test coverage and fix the problems I just haven't gotten around to it (lots of things to do...)
Avatar
what is the correct type of the following line? const worker_initialize: any = Synclink.wrap(worker);
18:50
I mean, the type of worker_initialize
Avatar
if you Synclink.expose(t: T) then it should be Synclink.Remote<T>
Avatar
the thing which I Synctlink.expose is the following: async function worker_initialize(cfg) { ... }
18:52
I have no idea how to write the type of a function in TS 😅
Avatar
you will want to export type worker_initialize
18:52
actually I think export type { worker_initialize}
18:52
and then import type { worker_initialize } from "worker.ts"
Avatar
Avatar
hood
you will want to export type worker_initialize
do I? worker_initialize lives in a completely separate file which is not even seen by the main bundle of pyscript
Avatar
that's why you only export the type
18:53
not the value
18:54
import/export of types has no effect on the bundling
Avatar
it cannot work easily because I'm currently ignoring that file from tsconfig (because of various reasons, but in particular tsc doesn't like it because it's not a module)
Avatar
eventually it should be bundled with esbuild which ingests modules and produces the appropriate output
18:58
until you do that, why not just leave the type as any?
Avatar
because eslint complains. I'll just disable it again
Avatar
Yeah just disable all the any lints, can reenable later
Avatar
anyway, I have the first bits to run pyodide in a webworker 🙂 https://github.com/pyscript/pyscript/pull/1333
Avatar
Avatar
hood
Yeah just disable all the any lints, can reenable later
or just don't re-enable them
Avatar
I think they are good
19:03
at least many of them
Avatar
I'm talking about the ones related to any
19:03
most of them are good
19:03
I am working on a branch that does more lint cleanup
19:04
I think we should disable
19:04
unsafe-assign
19:04
and explicit-any
19:04
and keep the rest
Avatar
anyway, I don't want to dwell into this discussion now
Avatar
currently I'm down to: 3 @typescript-eslint/no-unsafe-member-access 1 @typescript-eslint/no-unsafe-call
19:05
as the total lint overrides
19:05
trying to remove these if possible
19:05
and I caught some more mistakes with async/await...
19:06
btw, any reason for: /* eslint-disable @typescript-eslint/no-unused-vars */ const xPyRepl = customElements.define('py-repl', PyRepl);
19:06
seems we should just not store the result
Avatar
no reason AFAIK
19:07
==> off for today
Avatar
Avatar
hood
btw, any reason for: /* eslint-disable @typescript-eslint/no-unused-vars */ const xPyRepl = customElements.define('py-repl', PyRepl);
Jeff Glass 29/03/2023 19:17
I don't think there's a reason to store them - seems to be a holdover from the very earliest days of PyScript that's never really had a purpose https://github.com/pyscript/pyscript/blob/00060b23762dc79904295fa5bf99be75e96911dc/pyscriptjs/src/main.ts#L12-L13
Avatar
Avatar
hood
seems we should just not store the result
Andrea Giammarchi 30/03/2023 08:29
customElements.get('py-repl') would indeed return that if defined, nothing otherwise, but most importantly we have the PyRepl class right there in the scope so that xPyRepl should go indeed.
08:29
there's no yes/tod thread ... waiting for the bot to wake up 😁
Avatar
Andrea Giammarchi 30/03/2023 08:37
(yes/tod as in yesterday/today)
Avatar
I think the bot is broken, in the past days I created the thread manually
08:57
📆 Yesterday & Today - 03/30/2023 🧵
Avatar
py-config option for webworkers 🧵 (edited)
Avatar
Missing source maps 🧵
Avatar
Jeff Glass 30/03/2023 16:20
@antocuni I love your commit messages 🤣
😂 3
Avatar
Well, that went better than expected. Bravo Ted, Fabio, Hood and Jeff for stepping into the conversation. 😉
🙏 1
👍 1
🙌 1
Avatar
Andrea Giammarchi 31/03/2023 08:34
Yesterday & Today - 03/31/2023 🧵
Avatar
@tedpatrick where is the source code for the Yesterday&Today bot and how is it deployed? It's broken
✅ 1
Avatar
Avatar
antocuni
@tedpatrick where is the source code for the Yesterday&Today bot and how is it deployed? It's broken
Is it not a built in feature of discord..? (Scheduled messages). Also could it be UTC / summer daylight savings mismatch that means it appears late/early/not at all..? 🤷
Avatar
Avatar
ntoll
Is it not a built in feature of discord..? (Scheduled messages). Also could it be UTC / summer daylight savings mismatch that means it appears late/early/not at all..? 🤷
it's not appearing at all
Avatar
Ahhh... OK... so I've just been replying to manually created threads then..? (I didn't realise). Yeah, this is one for Ted.
Avatar
Avatar
ntoll
Ahhh... OK... so I've just been replying to manually created threads then..? (I didn't realise). Yeah, this is one for Ted.
Yes, I have been playing the the bot for the past days, although today Andrea was faster than me 🤖
Avatar
Andrea Giammarchi 31/03/2023 11:28
@ntoll I am afraid every single name on earth around grid is taken for a module to reuse in more than a project ... so I ended up with greedily but I don't like it too much neither 😅
Avatar
FabioRosado 31/03/2023 12:04
@antocuni the bot source code lives here https://github.com/pyscript/misc#readme I don’t know how it gets deployed tho
Avatar
Avatar
FabioRosado
@antocuni the bot source code lives here https://github.com/pyscript/misc#readme I don’t know how it gets deployed tho
Cool, I'll make a PR so that it uses non US dates 😅
Avatar
Avatar
antocuni
Cool, I'll make a PR so that it uses non US dates 😅
Andrea Giammarchi 31/03/2023 12:38
I was going to complain about that indeed 🤣
Avatar
Avatar
antocuni
Cool, I'll make a PR so that it uses non US dates 😅
Oh yes please
Avatar
Avatar
Andrea Giammarchi
@ntoll I am afraid every single name on earth around grid is taken for a module to reuse in more than a project ... so I ended up with greedily but I don't like it too much neither 😅
How about gridly-bear ..? 🤣 🐻
Avatar
Avatar
ntoll
How about gridly-bear ..? 🤣 🐻
FabioRosado 31/03/2023 13:38
Mighty-gridly?
Avatar
gridzilla
🤯 1
13:38
Oh my
Avatar
FabioRosado 31/03/2023 13:39
Gridzilla +1 haha
Avatar
Itsybitsyteenyweenyyellowpolkadot-grid.
Avatar
FabioRosado 31/03/2023 13:40
🤣
Avatar
pygrid grydthon grids.py
Avatar
FabioRosado 31/03/2023 13:40
I doubt that one will be taken
Avatar
yeah.... a bit of a bugger to pip install tho... ;-D
Avatar
FabioRosado 31/03/2023 13:44
Haha
Avatar
Avatar
ntoll
Itsybitsyteenyweenyyellowpolkadot-grid.
Andrea Giammarchi 31/03/2023 13:44
that works as custom-element name ... I might consider it 🤣
Avatar
developers everywhere will thank you
Avatar
Avatar
ntoll
pygrid grydthon grids.py
Andrea Giammarchi 31/03/2023 13:45
that confines the idea in python but currently the custom element is in JS 😅
13:46
and it gets exported as HTML ... no py/js/html ... itsybitsyteenyweenyyellowpolkadot-grid is also free on npm 😁
Avatar
I mean, what can possibly go wrong... (context... you do know about the song, right..?)
Avatar
Andrea Giammarchi 31/03/2023 13:47
nope, but I am sure it's super serious
Avatar
Yes, very.
Avatar
Avatar
ntoll
gridzilla
Andrea Giammarchi 31/03/2023 13:55
you gotta be kidding me ... https://www.npmjs.com/package/gridzilla
Gridzilla is a responsive, mobile-first flexbox grid system.. Latest version: 1.0.5, last published: 6 years ago. Start using gridzilla in your project by running npm i gridzilla. There are no other projects in the npm registry using gridzilla.
Avatar
Hahahaha.... oh my.
Avatar
Andrea Giammarchi 31/03/2023 13:58
oddly enough, the docs and demo looks amazing, not sure why it has literally zero downloads https://teefouad.github.io/gridzilla/
Gridzilla is a responsive, mobile-first flexbox grid system.
🤷 2
Avatar
<script type="module"> 🧵
Avatar
tedpatrick 31/03/2023 14:55
Fixing TodayBot!
✅ 1
Avatar
Yesterday & Today BOT 31/03/2023 17:44
📆 31 Mar 2023: Yesterday & Today 🧵
Avatar
-> the weekend 👋 (catch you lovely folk next week)
Avatar
wooo, workers are coming 🙂
🤯 4
🥳 4
Avatar
Andrea Giammarchi 31/03/2023 20:32
thanks @tedpatrick for chiming in in my <script> to bootstrap discussion ... if nothing else to add we have bugs coming due current situation https://github.com/pyscript/pyscript/discussions/1326#discussioncomment-5492789
I've demoed a quick PoC which uses <script> tags to bootstrap pyscript as opposite of using non visual related custom elements to do so, such as <py-script> and <py-config>, w...
🤠 1
Avatar
Avatar
Andrea Giammarchi
thanks @tedpatrick for chiming in in my <script> to bootstrap discussion ... if nothing else to add we have bugs coming due current situation https://github.com/pyscript/pyscript/discussions/1326#discussioncomment-5492789
answered in a very long, detailed and verbose way 😅.
Avatar
FabioRosado 01/04/2023 00:23
I’m yet to add my two cents but you already asked a question that I had Antonio, about the scr attribute 😄
Avatar
It happened. Nearly 5 years of paper writing, being snuck Committee Meeting notes on the DL until I could access them myself and absolve my co-conspirators of their sins, 5 different implementations/patches later, I can
Avatar
Yesterday & Today BOT 03/04/2023 08:00
📆 03 Apr 2023: Yesterday & Today 🧵
Avatar
@ntoll can you use pypercard to build a slide presentation?
Avatar
You could, but I'd say it's 60% there... far better to use something like reveal.js (my preferred presentation tool... it's just a web page).
10:28
@antocuni that's something I have on my "radar" as a demo project. But like I said, we're perhaps 60% there ATM. Perhaps a post-PyCon thing.
Avatar
ok👍
Avatar
But... (here's the thing), it'd be a great "reveal" to be able to present with PyperCard about PyScript, and then just casually drop into the Python repl in one of the slides, in an "oh by the way" sort of a way. 😉
Avatar
yes, I did this at one meeting in Berlin and I can confirm you get lots of "oooh"s from the audience 🙂
Avatar
Lots of ooohs = a good result 😄
Avatar
(I used some hand-crafted slideshow logic for that)
Avatar
Quite, but if the slideshow is just a very simple PyperCard app... folks can go build their own..! 🚀
Avatar
yes exactly, this is why I asked
Avatar
This is definitely something I think is important... if only for teachers to use as a pedagogical / presentation tool.
10:33
All of a sudden, their slideshow is both a teaching tool, has Python built in, and is an example of a simple GUI framework for learning to code. WIN/WIN/WIN 😄
Avatar
... and maybe we can embed a canvas in one of the slides/cards and have a pyxel videogame inside it 😂
Avatar
Avatar
antocuni
answered in a very long, detailed and verbose way 😅.
Andrea Giammarchi 03/04/2023 11:27
done the same "You're welcome" 😁
Avatar
Hi guys, after pulling from the current state of the main branch, seems like I cannot build pyscript Specifically, I get this: file:///Users/madhur/Desktop/Anaconda/pyscript/pyscriptjs/esbuild.mjs:5 import { cp, lstat, readdir } from 'fs/promises'; ^^ SyntaxError: The requested module 'fs/promises' does not provide an export named 'cp' at ModuleJob._instantiate (internal/modules/esm/module_job.js:124:21) at async ModuleJob.run (internal/modules/esm/module_job.js:179:5) at async Loader.import (internal/modules/esm/loader.js:178:24) at async Object.loadESM (internal/process/esm_loader.js:68:5) (edited)
Avatar
Avatar
madhurt
Hi guys, after pulling from the current state of the main branch, seems like I cannot build pyscript Specifically, I get this: file:///Users/madhur/Desktop/Anaconda/pyscript/pyscriptjs/esbuild.mjs:5 import { cp, lstat, readdir } from 'fs/promises'; ^^ SyntaxError: The requested module 'fs/promises' does not provide an export named 'cp' at ModuleJob._instantiate (internal/modules/esm/module_job.js:124:21) at async ModuleJob.run (internal/modules/esm/module_job.js:179:5) at async Loader.import (internal/modules/esm/loader.js:178:24) at async Object.loadESM (internal/process/esm_loader.js:68:5) (edited)
Andrea Giammarchi 03/04/2023 11:41
please use (at least) 16LTS as 14LTS is end of time/support - edit actually can't remember when that got introduced but we discussed this and agreed if our CI can do that, so should we (just to reflect what we do in CI, including likely the Node version used to build). (edited)
👍🏼 1
Avatar
I guess you're just missing an npm install?
Avatar
@Andrea Giammarchi I updated node, specifically, I use v18.11.0 for node and 8.19.2 for npm And now it's stuck at idealTree:pyscriptjs: sill idealTree buildDeps when I do npm install
Avatar
Avatar
madhurt
@Andrea Giammarchi I updated node, specifically, I use v18.11.0 for node and 8.19.2 for npm And now it's stuck at idealTree:pyscriptjs: sill idealTree buildDeps when I do npm install
Andrea Giammarchi 03/04/2023 12:13
uhm ... please be sure you remove node_modules folders and then you do an npm ci
👍🏼 1
Avatar
Avatar
Andrea Giammarchi
uhm ... please be sure you remove node_modules folders and then you do an npm ci
Thanks, that helped!
Avatar
Avatar
madhurt
Thanks, that helped!
Andrea Giammarchi 03/04/2023 12:19
differently form npm i (install) the ci uses the package-lock.json file to ensure everyone uses actually the very same modules and very same modules versions ... or at least that's the idea, while npm i might grab patches without asking ... worth checking out if next version of some dev/dependency might break our builds (not today though)
👍🏼 1
Avatar
Andrea Giammarchi 03/04/2023 12:55
to whoever has little time to read the extremely lengthy discussion around using <script type="py"> instead of <py-script> (worth it to me, but not for everyone to follow?), among all the details and improvements already shared, there is this particular reason that alone should make everyone think we did a mistake to use a layout element to define code data blocks ... maybe it helps as summary with demo you can test, images as results, and why that happens: https://github.com/pyscript/pyscript/discussions/1326#discussioncomment-5509027
I've demoed a quick PoC which uses <script> tags to bootstrap pyscript as opposite of using non visual related custom elements to do so, such as <py-script> and <py-config>, w...
Jeff Glass started a thread. 03/04/2023 13:22
Avatar
Only two weeks until the node v20 release!
❓ 1
Avatar
Yesterday & Today BOT 04/04/2023 08:00
📆 04 Apr 2023: Yesterday & Today 🧵
08:01
📆 04 Apr 2023: Yesterday & Today 🧵
Avatar
now we have two threads going 😅
Avatar
Two threads of chatter, woven together in code. Is this enough space? #haiku 😛
☯️ 1
Avatar
Avatar
3l3ktr4
now we have two threads going 😅
but look at those wonderful dates 😍
✨ 1
Avatar
i like it more haikus ++
Avatar
Andrea Giammarchi 04/04/2023 12:44
as I've found a workaround I don't think that's super important but imho I've wrsteled with CSS way too much before realizing it wasn't me doing things weirdly ... it was our splashscreen https://github.com/pyscript/pyscript/issues/1362
Checklist I added a descriptive title I searched for other issues and couldn't find a solution or duplication I already searched in Google and didn't find any good information or help What ...
Avatar
if I click on View raw logs I see the following. I think it means that for some reason github did not even start my job, not that the tests themselves are stuck. Am I right?
15:32
ah no wait, as soon as I pressed Cancel workflow, the rest of the logs appeared. So it was a "genuine" hanging... good to know
Avatar
one of the reasons I like circleci better than github actions is that it displays logs correctly for running tests
15:42
Thinking about how to go about the test for missing CORs
@madhurt You can test if typeof SharedArrayBuffer === "undefined"
15:43
that means CORS is missing or it's an old version of Safari
15:44
We require CORS + Safari >= 15.2
Avatar
does anybody know what is this error?
18:01
@hood it seems to be related to some stuff which you did recently?
Avatar
did you change the esbuild config?
18:01
is this on the worker branch?
Avatar
yes, it's my antocuni/webworker-support branch, just after merging origin/main
Avatar
I think you don't include the relevant plugin
18:02
in the worker esbuild config
Avatar
ah ok
18:03
ok, it works now. That was quick 🙂
18:04
but indeed, we need to understand what is the best layout for building/deploying stuff. Because I think that currently we are depoying/downloading a lot of duplicated code in pyscript.js and worker.js
👍 1
Avatar
among other things, the new Test Reporter stuff which was added by @hood recently it's awesome 😍. Let me post a screenshot here so that everybody is aware that it exists. It shows you a nice summary of all passed/failed tests, and you can click on failed ones to see the output. Live example: https://github.com/pyscript/pyscript/pull/1363/checks?check_run_id=12514717064
18:24
Uhm, test_zz_examples.py::TestExamples::test_bokeh seems to be broken on main my machine. I get these CORS errors:
18:24
18:25
is it broken also for other people? I don't understand why it might have stopped to work today? Maybe they changed something in the config of cdn.bokeh.org?
Avatar
I've been having trouble with a bunch of the examples tests locally
Avatar
it's not only locally, they also fail on CI
Avatar
I wonder if the examples tests should be split out into a different CI job with rerun on failed
18:38
since they are a bit heavier than the rest of the tests
Avatar
yes, this is a good idea, but doesn't solve my immediate issue 😅
18:39
basically, I would like to understand what's happening. If they are failing because of external reasons, we should probably skip them
18:40
@hood do you confirm that if NOW we get those error message and before we didn't, it means that cdn.bokeh.org is returning different HTTP headers?
18:47
the error mentions cross origin embedder policy
Avatar
yes, but I don't know how to interpret the error
Avatar
I'm looking into it one minute
18:49
do you have a CI log with the error somewhere?
18:50
if I go to https://pyscript.net/examples/bokeh.html I don't see any hits to cdn.bokeh.org
Avatar
locally I get a 404 for bokeh.html
18:58
so I can't reproduce locally
Avatar
you need make examples I think
Avatar
I did that
18:59
$ ls examples/bokeh* examples/bokeh.html examples/bokeh_interactive.html $ pytest tests/integration/ -k bokeh --dev ==> browser window with "Error code: 404 Message: File not found."
19:00
I think for us to use cdn.bokeh.org it needs to set Cross-Origin-Resource-Policy: cross-origin
19:01
probably should ask the bokeh people to do that
Avatar
are you still getting the 404 for bokeh.html? That's very weird, we should understand why and fix that
19:04
I've been getting these for a few weeks I think, I just skip the examples
19:04
Problem description We're working on PyScript in a worker. Currently we're using the SharedArrayBuffer + Atomics approach which requires us to set Cross-Origin-Embedder-Policy: require-corp...
👍 1
Avatar
ah, I also wrote a message on slack
19:08
anyway, I'm off now. Chat tomorrow 👋
Avatar
have a good evening!
Avatar
A blog post with some interesting gripes about Safari: https://www.construct.net/en/blogs/ashleys-blog-2/safari-releases-development-1616
Safari 16.4 rolled out last week, and for us it's been a nightmare. We make the browser-based game creation app Construct. Early versions of Safari 16.4 broke o...
Avatar
Yesterday & Today BOT 05/04/2023 08:00
📆 05 Apr 2023: Yesterday & Today 🧵
Avatar
An update on the bokeh/CORS problem which I found yesterday. TL;DR: the bokeh CDN is not compatible with webworkers, but should be fixable. More detailed explanation: 1. the tests failed on CI because of a timeout (probably the CI machines were slower than usual) 2. when I tried to debug them on my machine with --dev, I discovered an unrelated problem with CORS headers. On main, the problem manifests itself only with --dev, but as soon as we merge #1333 (webworkers) we will have the same problems also on main. I have opened an issue: https://github.com/pyscript/pyscript/issues/1365 (edited)
Avatar
Avatar
antocuni
An update on the bokeh/CORS problem which I found yesterday. TL;DR: the bokeh CDN is not compatible with webworkers, but should be fixable. More detailed explanation: 1. the tests failed on CI because of a timeout (probably the CI machines were slower than usual) 2. when I tried to debug them on my machine with --dev, I discovered an unrelated problem with CORS headers. On main, the problem manifests itself only with --dev, but as soon as we merge #1333 (webworkers) we will have the same problems also on main. I have opened an issue: https://github.com/pyscript/pyscript/issues/1365 (edited)
Andrea Giammarchi 05/04/2023 14:43
the tests failed on CI because of a timeout
I've raised this concern already in some recent PR ... CI was failing due timeout and I've asked to raise the timeout but it went a bit crickets ... 😅 https://github.com/pyscript/pyscript/pull/1292#issuecomment-1488157783 ... I've also checked for other issues and it looks like we really want to increase that timeout as we don't get to know in which hardware CI is running (AFAIK)
Description Get src attribute from py-repl tags and load it into the repl The purpose of this code is when you use the src attribute of the py-repl tags, it will load the src resources into the rep...
Avatar
Avatar
Andrea Giammarchi
the tests failed on CI because of a timeout
I've raised this concern already in some recent PR ... CI was failing due timeout and I've asked to raise the timeout but it went a bit crickets ... 😅 https://github.com/pyscript/pyscript/pull/1292#issuecomment-1488157783 ... I've also checked for other issues and it looks like we really want to increase that timeout as we don't get to know in which hardware CI is running (AFAIK)
sorry, I missed that thread. Yes, if we have flaky tests due to timeouts we should definitely try to make them non-flaky. As a side-effect of PR 1363 I have added: 1. a log() which tells how much time we spend in wait_for_pyscript for each test 2. a timeout argument to wait_for_pyscript so that we can change it on a test-by-test basis 3. an increased timeout for the problematic tests Hopefully this should improve the situation: we will hopefully be able to set a smaller default timeout (because the current 30s is way too much for the vast majority of tests) and a higher one only for the tests which actually need it
👍 4
antocuni started a thread. 05/04/2023 15:19
Avatar
Yesterday & Today BOT 06/04/2023 08:00
📆 06 Apr 2023: Yesterday & Today 🧵
Avatar
Would appreciate review on PR #1338 if anyone has a chance
Avatar
Avatar
antocuni
@ntoll can you use pypercard to build a slide presentation?
@antocuni @ntoll fwiw, I'm totally going to try to write my slides with Pypercard. Started yesterday 🙂
Avatar
@hood Did you end up starting an issue/discussion around why Plugins will not work with the changes we are doing to support workers? sorry, I've been out of most things here, overwhelmed and wasn't able to really follow but I can't seem to find it (if you did create it)
Avatar
no I haven't made one, but I currently think it will be (mostly) okay with auto-syncify
Avatar
Avatar
hood
no I haven't made one, but I currently think it will be (mostly) okay with auto-syncify
Ok. Can you collect your thoughts/concerns somewhere, even if just a maybe? I'd rather think about it upfront that later when it's kinda late...
Avatar
yeah can do
21:18
where do you suggest to put this sort of thing?
21:21
I was told that plugins aren't currently considered to be public API? If this is the case I think it is significantly less concerning
Avatar
yes, we don't have any 3rd party plugin at the moment. If we need to change the API to be more worker-friendly, we can surely do it
👆 1
Avatar
Avatar
hood
where do you suggest to put this sort of thing?
Issue? Discussion?
Avatar
Avatar
antocuni
yes, we don't have any 3rd party plugin at the moment. If we need to change the API to be more worker-friendly, we can surely do it
Jeff Glass 07/04/2023 00:53
Are they not public? We have docs on how to create them. Albeit with a warning saying they’re experimental and will have breaking changes, but plugins are being used in the wild in some places.
Avatar
Jeff Glass 07/04/2023 01:34
Perhaps I have been wrong to be telling people to use them 😅
Avatar
experimental and will have breaking changes
That's good enough for me!
Avatar
Avatar
Jeff Glass
Are they not public? We have docs on how to create them. Albeit with a warning saying they’re experimental and will have breaking changes, but plugins are being used in the wild in some places.
ah sorry, I wasn't aware that we documented them. Anyway, since we said they are experimental, we are free to break them 🙂
Avatar
Yesterday & Today BOT 07/04/2023 08:00
📆 07 Apr 2023: Yesterday & Today 🧵
Avatar
CI build wheel support is coming along pretty well:
Avatar
Avatar
hood
CI build wheel support is coming along pretty well:
this is CI build wheel using pyodide? That's awesome 😍
Avatar
Yesterday & Today BOT 10/04/2023 08:00
📆 10 Apr 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 11/04/2023 08:00
📆 11 Apr 2023: Yesterday & Today 🧵
Avatar
New Synclink version 🧵
Avatar
Yesterday & Today BOT 12/04/2023 08:00
📆 12 Apr 2023: Yesterday & Today 🧵
Avatar
@tedpatrick could you please give @Deleted User (username of Kay) the permissions to write on this channel?
✅ 1
Avatar
Strange synclink error 🧵
Avatar
so, PR 1333 (support for webworkers) is ready to review: https://github.com/pyscript/pyscript/pull/1333
Avatar
@tedpatrick I took the liberty to update https://github.com/pyscript/pyscript/issues/1355 with links to the many individual issue which I opened for webworker support
✅ 1
Avatar
Yesterday & Today BOT 13/04/2023 08:01
📆 13 Apr 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 13/04/2023 15:16
#1323 is ready for review - adds some functionality to how plugins validate user-provided values https://github.com/pyscript/pyscript/pull/1323
15:18
I'll have to miss the PS:Fun meeting today - hope everyone's found some time to have some fun amidst all the other incredible progress that's happening 🤯
Avatar
Should we add a new CI workflow to try the build system for Windows as well?
Avatar
Avatar
Jeff Glass
#1323 is ready for review - adds some functionality to how plugins validate user-provided values https://github.com/pyscript/pyscript/pull/1323
Thanks @Jeff Glass I will review in a while
Avatar
Andrea Giammarchi 13/04/2023 17:04
Sorry folks, I've got completely absorbed by VP refactoring and didn't even realize what time was it ... I think I'll miss PS:Fun meeting too as I am pretty close to have a fully working controller and I want just to check something before ending my day of work. I hope that's OK, apologies for any inconvenience.
Avatar
py-terminal and pytest 🧵
Avatar
Avatar
Jeff Glass
#1323 is ready for review - adds some functionality to how plugins validate user-provided values https://github.com/pyscript/pyscript/pull/1323
Approved, unit tests look great!
🥳 1
Avatar
Yesterday & Today BOT 14/04/2023 08:02
📆 14 Apr 2023: Yesterday & Today 🧵
Avatar
so, PR #1333 was merged and now we have experimental (and limited) worker support in pyscript 🎉
🔥 3
🥳 2
Avatar
Jeff Glass 16/04/2023 18:07
I'm putting in some work this weekend on the event handlers PR (#1240) that @3l3ktr4 made awesome progress on, but I think I'm at the limit of my Synclink/workers knowledge to be able to actually move that forward
Avatar
Yesterday & Today BOT 17/04/2023 08:00
📆 17 Apr 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 18/04/2023 03:01
Safe travels to all who are travelling in the next couple days. See you in Utah!
👋 2
Avatar
Yesterday & Today BOT 18/04/2023 08:00
📆 18 Apr 2023: Yesterday & Today 🧵
Avatar
I'm running into html escaping problems in the test suite: def _repr_svg_(self): return ( # careful here, can't use less than sign! f'##svg height="{self.r*2}" width="{self.r*2}">' + f'##circle cx="{self.r}" cy="{self.r}" r="{self.r}" fill="red" />##/svg>' ).replace('##', chr(60)) # 60 is less than (edited)
00:21
@Andrea Giammarchi
🤷 1
Avatar
Yesterday & Today BOT 19/04/2023 08:00
📆 19 Apr 2023: Yesterday & Today 🧵
Avatar
Avatar
hood
Click to see attachment 🖼️
Andrea Giammarchi 19/04/2023 09:06
I guess you solved? if that's code within <py-script> tag literally exactly what I would expect and explained when I've suggested to use <script type="py"> instead ... but of course we can ask everyone to use different chars to represent HTML and we could escape those chars on our side ... no other ideas beside using inverted tags for HTML/SVG content ... example: def _repr_svg_(self): return ( f'>svg height="{self.r*2}" width="{self.r*2}"<' + f'>circle cx="{self.r}" cy="{self.r}" r="{self.r}" fill="red" /<>/svg<' ) 😅 ... we could fix that when parsing <py-script> tags then .. (this is a horrible idea anyway). (edited)
😂 1
Avatar
Avatar
Andrea Giammarchi
I guess you solved? if that's code within <py-script> tag literally exactly what I would expect and explained when I've suggested to use <script type="py"> instead ... but of course we can ask everyone to use different chars to represent HTML and we could escape those chars on our side ... no other ideas beside using inverted tags for HTML/SVG content ... example: def _repr_svg_(self): return ( f'>svg height="{self.r*2}" width="{self.r*2}"<' + f'>circle cx="{self.r}" cy="{self.r}" r="{self.r}" fill="red" /<>/svg<' ) 😅 ... we could fix that when parsing <py-script> tags then .. (this is a horrible idea anyway). (edited)
Andrea Giammarchi 19/04/2023 09:10
another idea could be to have <!tag ... /!> which should not bother the parser as that's an invalid tag name ... <[tag ... /]> might do too as long as those chars don't interfere with both the HTML parser and Python ... the alternative is to use <script> and stop this "madness" sooner than later 😇
Avatar
Yesterday & Today BOT 20/04/2023 08:00
📆 20 Apr 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 20/04/2023 11:56
did you know? any attachShadow({mode: 'open'}) automatically augment the custom element with a shadowRoot property making our own shadow property redundant -> https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#parameters ... as you're all busy at the PyCon, do you mind if I suggest a "chore" PR that removes such redundant property from our custom elements? 🤔
The Element.attachShadow() method attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot.
Andrea Giammarchi started a thread. 20/04/2023 12:11
Avatar
Andrea Giammarchi 20/04/2023 12:12
Thoughts about bootstrapping PyScript 🧵
Avatar
Andrea Giammarchi 20/04/2023 12:20
@antocuni just FYI I had a lot of timeouts while testing locally via make test and I think that's friction for contributors, specially since we ask if all tests passed locally whenever a PR is filed ... should we tackle this after the conf? I find this issue quite problematic 🤔
Avatar
Avatar
Andrea Giammarchi
@antocuni just FYI I had a lot of timeouts while testing locally via make test and I think that's friction for contributors, specially since we ask if all tests passed locally whenever a PR is filed ... should we tackle this after the conf? I find this issue quite problematic 🤔
yes, definitely! Tests should always pass also locally. What are the problematic ones? Is the problem only that the timeout is too low (and they would pass if you make it bigger), or there is something more fundamental? Btw, I often run tests on my machine and I don't have problems normally
Avatar
Avatar
antocuni
yes, definitely! Tests should always pass also locally. What are the problematic ones? Is the problem only that the timeout is too low (and they would pass if you make it bigger), or there is something more fundamental? Btw, I often run tests on my machine and I don't have problems normally
Andrea Giammarchi 20/04/2023 20:36
the issue is the timeout ... as CI passed in my MR
Avatar
Avatar
Andrea Giammarchi
the issue is the timeout ... as CI passed in my MR
Andrea Giammarchi 20/04/2023 20:40
fundamentally I think we shouldn't base timeout on "your machine" 😁 but I am happy to share my specs ... it's a pretty beefy laptop last gen too: Lenovo ThinkPad Z13 top specs (Ryzen 7, 32GB RAM, 1TB nvme and so on). (edited)
Avatar
Avatar
Andrea Giammarchi
fundamentally I think we shouldn't base timeout on "your machine" 😁 but I am happy to share my specs ... it's a pretty beefy laptop last gen too: Lenovo ThinkPad Z13 top specs (Ryzen 7, 32GB RAM, 1TB nvme and so on). (edited)
Andrea Giammarchi 20/04/2023 20:41
20:44
I can build WPEWebKit cross compiled for Rapsberry Pi in it without issues and within reasonable time, I might be doing something wrong but then again, this shouldn't be on contributors (have top-tech hardware or forget about it), imho (edited)
20:47
maybe something to investigate though, as I don't think CI has better hardware ... if you want me to do so, I'm game 👍
Avatar
Avatar
Andrea Giammarchi
fundamentally I think we shouldn't base timeout on "your machine" 😁 but I am happy to share my specs ... it's a pretty beefy laptop last gen too: Lenovo ThinkPad Z13 top specs (Ryzen 7, 32GB RAM, 1TB nvme and so on). (edited)
I think that your laptop is faster than mine 🙂 But if the the tests timeouts, just make a PR to increase them 👍
👍 1
Avatar
Yesterday & Today BOT 21/04/2023 08:00
📆 21 Apr 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 24/04/2023 08:00
📆 24 Apr 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 25/04/2023 08:00
📆 25 Apr 2023: Yesterday & Today 🧵
Avatar
Avatar
antocuni
I think that your laptop is faster than mine 🙂 But if the the tests timeouts, just make a PR to increase them 👍
Andrea Giammarchi 25/04/2023 09:11
Description Added testTimeout parameter to jest.config.js; updated changelog. Changes Default jest timeout of 5000 ms causes erroneous jest timeout issues on unit test suite pyodide.tests.ts when m...
Avatar
Yesterday & Today BOT 26/04/2023 08:00
📆 26 Apr 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 27/04/2023 08:00
📆 27 Apr 2023: Yesterday & Today 🧵
Avatar
FabioRosado 27/04/2023 12:25
@Andrea Giammarchi Question about the MutationObserver in your PR (just curious) 😄 In the callback that creates the MutationObserver, are we looping once at page load? We have two loops together and I wonder if it will cause a slight delay if the index page is huge? 🤔 (Mind you, if its huge and has a bunch of packages the load will be higher anyway haha)
Avatar
Avatar
FabioRosado
@Andrea Giammarchi Question about the MutationObserver in your PR (just curious) 😄 In the callback that creates the MutationObserver, are we looping once at page load? We have two loops together and I wonder if it will cause a slight delay if the index page is huge? 🤔 (Mind you, if its huge and has a bunch of packages the load will be higher anyway haha)
Andrea Giammarchi 27/04/2023 13:25
the MutationObserver doesn't observe what's live already so one does a pass whenever pyscript initializes and the rest is observed and it addresses only added nodes, not the whole document. Both are common techniques and no double loop ever happens with that code.
Avatar
Avatar
Andrea Giammarchi
the MutationObserver doesn't observe what's live already so one does a pass whenever pyscript initializes and the rest is observed and it addresses only added nodes, not the whole document. Both are common techniques and no double loop ever happens with that code.
Andrea Giammarchi 27/04/2023 13:27
if the page is huge and it flushes at some point and pyscript initializes in there, there is one single pass up to that point, then the rest will be queued in the MutationObserver. I have created Custom Elements polyfills since 2014 believe me we have no issues in there and we need MutationObserver regardless for various other topics (see the event handling Open issue too and runtime changed attributes).
Avatar
Avatar
Andrea Giammarchi
if the page is huge and it flushes at some point and pyscript initializes in there, there is one single pass up to that point, then the rest will be queued in the MutationObserver. I have created Custom Elements polyfills since 2014 believe me we have no issues in there and we need MutationObserver regardless for various other topics (see the event handling Open issue too and runtime changed attributes).
Andrea Giammarchi 27/04/2023 13:32
to clarify, if within an already loaded page you add a MutationObserver for all added nodes you won't be notified until you actually add other nodes so that the single pass should be done regardless or you won't catch already landed nodes on the page. This, of course, unless I've misunderstood the double loop you are referring too but accordingly to WebKit internals (and IIRC others too) one MO or many MO don't make any difference, it's a (task) queue and the current logic in my PR only searches once for added nodes and their content. No node is initialized more than once but I could add an extra guard if you like, but that's something we should tackle for our custom element anyway, as if the node is moved it gets re-evaluated because we use connectedCallback there, and that triggers any time the node is moved around the DOM. I've mentioned that at the end of the description of my PR.
Avatar
FabioRosado 27/04/2023 13:37
That's awesome! Thanks! I dont know much about MutationObserver so your explanation helped a lot 😄
Avatar
Avatar
Andrea Giammarchi
to clarify, if within an already loaded page you add a MutationObserver for all added nodes you won't be notified until you actually add other nodes so that the single pass should be done regardless or you won't catch already landed nodes on the page. This, of course, unless I've misunderstood the double loop you are referring too but accordingly to WebKit internals (and IIRC others too) one MO or many MO don't make any difference, it's a (task) queue and the current logic in my PR only searches once for added nodes and their content. No node is initialized more than once but I could add an extra guard if you like, but that's something we should tackle for our custom element anyway, as if the node is moved it gets re-evaluated because we use connectedCallback there, and that triggers any time the node is moved around the DOM. I've mentioned that at the end of the description of my PR.
Andrea Giammarchi 27/04/2023 13:37
... on a second thought, if you are referring to the fact I attach the MO and then modify the DOM due initialization that gets triggered per each added node (it should be notified all at once though) but nothing happens there because I don't add nodes that match the query. If that was your initial concern, I can move the MO .observe(document) after the initial bootstrap to save some CPU tick but in general MO is fast and that loop is fast too, with so many moving parts it will get triggered per each new added node and we shouldn't care.
Avatar
FabioRosado 27/04/2023 13:37
I wasn't too concerned to be honest, was mostly curious about it haha
Avatar
Avatar
FabioRosado
I wasn't too concerned to be honest, was mostly curious about it haha
Andrea Giammarchi 27/04/2023 13:38
put it in this way: MO observes mutations ... it doesn't care about already live nodes 😉
13:43
doh ... another timeout in CI ... I will push the last change so we observe after initial bootstrap and call it a day 😄
Avatar
FabioRosado 27/04/2023 13:46
Sounds good 😄 I think we still dont dismiss reviews when we push new commits, so feel free to merge once CI is green 😄
Avatar
Yesterday & Today BOT 28/04/2023 08:00
📆 28 Apr 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 01/05/2023 08:00
📆 01 May 2023: Yesterday & Today 🧵
08:01
📆 01 May 2023: Yesterday & Today 🧵
Avatar
tedpatrick 01/05/2023 15:29
How do we get these PRs merged? I see 20 now on pyscript/pyscript?
15:31
Can someone on team own the merging? We need to determine merge order and make sure that all PRs are rebased as thing merge if needed.
Jeff Glass started a thread. 01/05/2023 15:55
Avatar
Jeff Glass 01/05/2023 18:52
#1360 (pre-commit auto-update, with a couple lines in the micrograd example tweaked for new ruff rules) is up for review: https://github.com/pyscript/pyscript/pull/1360
Avatar
Yesterday & Today BOT 02/05/2023 08:00
📆 02 May 2023: Yesterday & Today 🧵
Avatar
Heads up. Opened a discussion (https://github.com/pyscript/pyscript/discussions/1442) to [finally] try and decide how to properly manage community contributed examples so that we can provide better guidance to our users.
The topic of "where do we host and cherish community examples" has been around for a while and we should decide what to do and the best place to handle it. The goal of this discussion is ...
Avatar
Yesterday & Today BOT 03/05/2023 08:00
📆 03 May 2023: Yesterday & Today 🧵
Avatar
- investigation around py-repl Shadow DOM (what Antonio demoed yesterday)
@Andrea Giammarchi thank you 🤩 If you need a repro, it's here: https://4897a01d-e56f-47fa-814f-70c7c1e11730.pyscriptapps.com/5412a8f5-0787-42bb-92a2-9a582e7bc7f2/latest/
Avatar
Avatar
antocuni
- investigation around py-repl Shadow DOM (what Antonio demoed yesterday)
@Andrea Giammarchi thank you 🤩 If you need a repro, it's here: https://4897a01d-e56f-47fa-814f-70c7c1e11730.pyscriptapps.com/5412a8f5-0787-42bb-92a2-9a582e7bc7f2/latest/
Andrea Giammarchi 03/05/2023 11:27
the TL;DR is that indeed there's no Shadow DOM at all currently and we need to have one, move CSS in there, orchestrate events and queries within the shadowRoot and so on ... all doable on the surface but it requires some refactoring (edited)
👍 1
Avatar
Yesterday & Today BOT 04/05/2023 08:00
📆 04 May 2023: Yesterday & Today 🧵
Avatar
Hi, I am thinking of removing PyWidget since we don't seem to use it anywhere? Any thoughts? CC: @Fabio @Jeff Glass ?
Avatar
Avatar
madhurt
Hi, I am thinking of removing PyWidget since we don't seem to use it anywhere? Any thoughts? CC: @Fabio @Jeff Glass ?
Jeff Glass 04/05/2023 13:36
I say go for it - I think there's an open issue asking about deprecating/removing it?
13:37
#1221
Avatar
Yeah
13:37
last chance people....3, 2, 1...
Avatar
Jeff Glass 04/05/2023 13:38
What's the reaction that means "unship it", I wonder? What's the opposite of 🛳️ ?
Avatar
Jeff Glass 04/05/2023 13:39
Perfect!
😅 1
Avatar
An extension to the above question is, removing PyWidget also renders the function createWidget as useless since we don't use it anywhere. Do we potentially see it being used? Or perhaps we can remove this too? Basically, we can delete the full file i.e. pyscriptjs/src/components/pywidget.ts
🖥️ 1
Avatar
Jeff Glass 04/05/2023 14:30
For my money they can both be removed, however we should probably do one release with them deprecated, in case someone we don't have visibility on is using <py-register-widget> in the wild.
✅ 1
14:31
And then we can delete them in the following release
Avatar
Avatar
madhurt
Hi, I am thinking of removing PyWidget since we don't seem to use it anywhere? Any thoughts? CC: @Fabio @Jeff Glass ?
Agree with Jeff. Kill it with fire
tedpatrick started a thread. 04/05/2023 17:54
Avatar
WebGPU is the new WebGL. That means it is the new way to draw 3D in web browsers. It is, in my opinion, very good actually. It is so good I think it will also replace Canvas and become the new way to draw 2D in web browsers. In fact it is so good I think it will replace Vulkan as well as normal OpenGL, and become just the standard way to draw, i...
👍 1
Avatar
Yesterday & Today BOT 05/05/2023 08:00
📆 05 May 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 08/05/2023 08:00
📆 08 May 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 08/05/2023 11:05
Shadow DOM and Custom Elements 🧵
Avatar
Yesterday & Today BOT 09/05/2023 08:00
📆 09 May 2023: Yesterday & Today 🧵
Avatar
Good and bad tests 🧵
Avatar
Andrea Giammarchi 09/05/2023 12:54
We are investigating reports of degraded performance for Git Operations. https://t.co/2yhhPJQ78Y
Avatar
Yesterday & Today BOT 10/05/2023 08:00
📆 10 May 2023: Yesterday & Today 🧵
08:01
📆 10 May 2023: Yesterday & Today 🧵
Avatar
Deleted User 10/05/2023 10:06
hmm, what I noticed while trying to run pyodide on native OSX (without docker & co) is, that actual there is pretty interesting issue about sys.platform on the python interpreter used. as it will always report host-OS. Means "linux", or on OSX "darwin". Which leads to multiple issues
Avatar
Avatar
Deleted User
hmm, what I noticed while trying to run pyodide on native OSX (without docker & co) is, that actual there is pretty interesting issue about sys.platform on the python interpreter used. as it will always report host-OS. Means "linux", or on OSX "darwin". Which leads to multiple issues
does it depend on the platform where you run it, or where you build?
Avatar
Avatar
antocuni
does it depend on the platform where you run it, or where you build?
Deleted User 10/05/2023 12:18
It depends on the python interpreter used. As this is that one from the host-system during build-time. Means on linux it is linux, on OSX it is darwin. You need to know that the python-interpeter has a stored sysconfigdata, which defines all such information. see as sample https://github.com/AnacondaRecipes/python-feedstock/blob/45bbfda8d98c8134d241fd0ee9a7c5f5b3cf33b7/recipe/sysconfigdata/_sysconfigdata_x86_64_apple_darwin13_4_0.py#LL588C1-L588C1
A conda-smithy repository for python. Contribute to AnacondaRecipes/python-feedstock development by creating an account on GitHub.
Deleted User started a thread. 10/05/2023 12:43
Avatar
@hood when you wake up, do you have time to do a quick call to synchronize about the current status of web worker support and the next steps to do?
Avatar
Andrea Giammarchi 10/05/2023 14:44
to whom it might concern ... there's a tiny new dependency in main branch so you're invited to run npm i inside the pyscript/pyscriptjs folder otherwise tests won't be able to run locally
14:45
happy to answer any question related to such dependency but the TL;DR reason is that WeakSet or WeakMap are not iterable, but since the FinalizationRegistry arrived on every browser it is possible to make these iterable (without retaining entries for longer than needed) (edited)
14:46
A FinalizationRegistry object lets you request a callback when a value is garbage-collected.
Avatar
Yesterday & Today BOT 11/05/2023 08:00
📆 11 May 2023: Yesterday & Today 🧵
Avatar
tests/integration/test_zz_examples.py::TestExamples::test_panel_kmeans is kinda broken and fails with ValueError: brush parameter was not found in list of parameters of class Selection
Avatar
Avatar
madhurt
tests/integration/test_zz_examples.py::TestExamples::test_panel_kmeans is kinda broken and fails with ValueError: brush parameter was not found in list of parameters of class Selection
Andrea Giammarchi 11/05/2023 14:12
Home Page: https://pyscript.net Examples: https://pyscript.net/examples - Simplified classList within Python code · pyscript/pyscript@274e9f9
Avatar
test_panel_kmeans 🧵
Avatar
Yesterday & Today BOT 12/05/2023 08:00
📆 12 May 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 15/05/2023 08:00
📆 15 May 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 15/05/2023 11:35
if anyone could review MR 1459 and/or 1464 (as they both should be green in a few seconds/minutes) it'd be great! Thanks @madhurt for unlocking those PRs 👍
Avatar
Approved both @Andrea Giammarchi
🙏 1
Avatar
Jeff Glass 15/05/2023 19:30
PR1347 (Upgrade Pyodide to 0.23.2) is once again ready for review.
👍 1
Avatar
Yesterday & Today BOT 16/05/2023 08:00
📆 16 May 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 16/05/2023 08:27
is it me or something changed in discord Markdown ? 🤔
Avatar
npm install local package 🧵
Avatar
PEP 658 was mainly motivated by allowing a package installer to look at multiple versions of a project more efficiently for the dependency resolution process, but sdist metadata are in generaly not useful on their own for this purpose and thus left out of the proposal. But the current specification leaves enough room for anyone to submit a propo...
🔥 1
Avatar
Jeff Glass 16/05/2023 20:02
Did something change on GitHub actions/runners today? All of the examples tests are failing in any PR https://github.com/pyscript/pyscript/actions/runs/4995591644/jobs/8947649557?pr=1468 (edited)
20:03
That PR just adds a single-line comment to main.ts 🤔
Avatar
Yesterday & Today BOT 17/05/2023 08:00
📆 17 May 2023: Yesterday & Today 🧵
Avatar
Avatar
Jeff Glass
Did something change on GitHub actions/runners today? All of the examples tests are failing in any PR https://github.com/pyscript/pyscript/actions/runs/4995591644/jobs/8947649557?pr=1468 (edited)
something seems definitely wrong. Some tests are failing for me also locally, on main
11:23
Failing tests (false alarm, they pass) 🧵 (edited)
Avatar
Minified pyscript.js 🧵
Avatar
Avatar
antocuni
Minified pyscript.js 🧵
Andrea Giammarchi 17/05/2023 14:25
the suspense is killing me 😄
Avatar
Avatar
Andrea Giammarchi
the suspense is killing me 😄
what do you mean? You don't see the content of the thread?
Avatar
CORS headers drama 🧵
Avatar
Avatar
antocuni
what do you mean? You don't see the content of the thread?
Andrea Giammarchi 17/05/2023 15:06
nope
Avatar
Avatar
Andrea Giammarchi
nope
very weird. I swear that a thread exists
Avatar
Avatar
antocuni
very weird. I swear that a thread exists
Andrea Giammarchi 17/05/2023 15:08
ok, restarted browser and refreshed now I see it!
👍 1
Avatar
Avatar
Jeff Glass
Did something change on GitHub actions/runners today? All of the examples tests are failing in any PR https://github.com/pyscript/pyscript/actions/runs/4995591644/jobs/8947649557?pr=1468 (edited)
tedpatrick 17/05/2023 17:49
I am rerunning manually
Avatar
a sandboxed Python virtual environment with Deno
Avatar
Deleted User 17/05/2023 22:12
is it worthwhile to replace the urls for download.osgeo.org to the github ones? geos and libproj are affect
Avatar
Yesterday & Today BOT 18/05/2023 08:00
📆 18 May 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 19/05/2023 08:00
📆 19 May 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 22/05/2023 08:00
📆 22 May 2023: Yesterday & Today 🧵
08:01
📆 22 May 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 23/05/2023 08:00
📆 23 May 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 23/05/2023 20:00
Created a discussion (and upstream feature proposal issue) around adding addition optional arguments to @when, like we discussed this morning. https://github.com/pyscript/pyscript/discussions/1484
20:02
Question, about a different feature of @when - we talked about being able to remove listeners. I thought what I heard was that the api would be calling remove_when() (or something) on the function, ie: @when('click', 'button') def foo(): print("fOO!") ... # later foo.remove_when(...) Leaving aside the specifics of the API for that function - is this what we want? (edited)
Avatar
Avatar
Jeff Glass
Question, about a different feature of @when - we talked about being able to remove listeners. I thought what I heard was that the api would be calling remove_when() (or something) on the function, ie: @when('click', 'button') def foo(): print("fOO!") ... # later foo.remove_when(...) Leaving aside the specifics of the API for that function - is this what we want? (edited)
yes, this is what I proposed. Personally, I like it (but probably we need a better name). Whether it's what we want, I don't know though 🙂
👍 1
Avatar
Some discussion in this article about deployment of apps using shared array buffer: https://leaningtech.com/mini-webvm-your-linux-box-from-dockerfile-via-wasm/ They use a service worker to inject the headers into github pages
TL;DR – WebVM is a Linux-like virtual machine running fully client-side in the browser. It is based on CheerpX: a x86 execution engine in WebAssembly by Leaning Technologies. With today’s update, you can deploy your own version of WebVM by simply forking the repo on GitHub and editing the included Dockerfile. A GitHub Actions workflow...
22:52
GitHub Pages do not enable COEP/COOP/CORP headers, but the problem can be solved by automatically loading a service worker that injects the headers as required. The same setup works transparently on any other hosting as well.
Avatar
Avatar
hood
GitHub Pages do not enable COEP/COOP/CORP headers, but the problem can be solved by automatically loading a service worker that injects the headers as required. The same setup works transparently on any other hosting as well.
Andrea Giammarchi 24/05/2023 07:05
I feel like creating a Service Worker that automatically works out of the box could be part of the pyscript CLI /cc @Fabio ... that being said, great read but I couldn't see any comment/discussion after the post ... any pointer?
Avatar
Yesterday & Today BOT 24/05/2023 08:00
📆 24 May 2023: Yesterday & Today 🧵
Avatar
Avatar
Andrea Giammarchi
I feel like creating a Service Worker that automatically works out of the box could be part of the pyscript CLI /cc @Fabio ... that being said, great read but I couldn't see any comment/discussion after the post ... any pointer?
Can you elaborate on this scenario @Andrea Giammarchi ?
Avatar
Avatar
Fabio
Can you elaborate on this scenario @Andrea Giammarchi ?
Andrea Giammarchi 24/05/2023 16:09
rather than telling people how to write a Service Worker, why it's needed, why we do things they way we do we pyscript --sw-proxy ./project-folder and we place a service worker (or we augment the present one) with all the logic ... something a bit "magic" like vite or other web dev oriented CLI tools do, nothing too articulated as a thought
Avatar
Aaaah, yeah, that's what I thought what you were suggesting but was good to clarify explicitly. +1 on that for sure.
Avatar
Workers support in the next release 🧵
Avatar
Heads up. I'd like to move the conversation about future of examples ahead and take action. If you have opinions, please comment here: https://github.com/pyscript/pyscript/discussions/1442
The topic of "where do we host and cherish community examples" has been around for a while and we should decide what to do and the best place to handle it. The goal of this discussion is ...
Avatar
Yesterday & Today BOT 25/05/2023 08:00
📆 25 May 2023: Yesterday & Today 🧵
Avatar
For those in the call wondering about where Ted and I were... The Salt Lick BBQ (512) 858-4959 https://maps.app.goo.gl/ZFhbcW7hSQo5NKWm6 😉 (edited)
🤤 1
19:32
Some serious pit here
Avatar
At first, I read it as The Salt Lake BBQ
20:05
memories of Utah xD
😅 1
Avatar
Yesterday & Today BOT 26/05/2023 08:00
📆 26 May 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 26/05/2023 13:32
Some thoughts (and good further links) on HTML generation: https://utcc.utoronto.ca/~cks/space/blog/programming/OnHTMLViaStringTemplates
Avatar
tedpatrick 26/05/2023 21:42
We are feature complete for a release of PyScript next week. We need your help testing 2023.05.1. How to test 2023.05.1.RC1 <link rel="stylesheet" href="https://pyscript.net/snaps...
🔥 2
🎉 2
hood started a thread. 27/05/2023 14:50
Avatar
Yesterday & Today BOT 29/05/2023 08:00
📆 29 May 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 30/05/2023 08:00
📆 30 May 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 30/05/2023 13:50
For those interested is contributing to PyScript Recipes as mentioned on last week's Fun call, I've made the repo public and added information on building the site and formatting conventions (@madhurt ) https://github.com/JeffersGlass/pyscript-recipes
Avatar
Thanks @Jeff Glass, gonna open some -- probably around data manipulation, etc.
🤗 1
Avatar
Yesterday & Today BOT 31/05/2023 08:00
📆 31 May 2023: Yesterday & Today 🧵
Avatar
Deleted User 31/05/2023 08:20
moin
Avatar
@Jeff Glass I just discovered about pyscript.recipes, it's wonderful 😍
Avatar
Jeff Glass 31/05/2023 23:26
Another interesting article, breaking down what an ES Module is (with fun cartoons!) https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/
ES modules bring an official, standardized module system to JavaScript. With the release of Firefox 60 in May, all major browsers will support ES modules, and there is current work ...
✅ 1
Avatar
Yesterday & Today BOT 01/06/2023 08:00
📆 01 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 02/06/2023 08:00
📆 02 Jun 2023: Yesterday & Today 🧵
Avatar
tedpatrick 02/06/2023 18:05
Thoughts on posting RC2?
👍🏼 1
✅ 1
Avatar
Yesterday & Today BOT 05/06/2023 08:00
📆 05 Jun 2023: Yesterday & Today 🧵
Avatar
we should close this PR, not sure what the purpose etc is https://github.com/pyscript/pyscript/pull/1504
Avatar
Avatar
madhurt
we should close this PR, not sure what the purpose etc is https://github.com/pyscript/pyscript/pull/1504
have closed it ✅ (edited)
Avatar
Yesterday & Today BOT 06/06/2023 08:00
📆 06 Jun 2023: Yesterday & Today 🧵
08:01
📆 06 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 07/06/2023 08:00
📆 07 Jun 2023: Yesterday & Today 🧵
Avatar
where is py_tutor.py?
Avatar
Yesterday & Today BOT 08/06/2023 08:00
📆 08 Jun 2023: Yesterday & Today 🧵
Avatar
@Andrea Giammarchi small bug in pyscript.core: if you check out pyscript-next and run npm run build, it fails with: Error: ENOENT: no such file or directory, stat 'cjs' I manually run mkdir cjs and now it builds fine
Avatar
Avatar
antocuni
@Andrea Giammarchi small bug in pyscript.core: if you check out pyscript-next and run npm run build, it fails with: Error: ENOENT: no such file or directory, stat 'cjs' I manually run mkdir cjs and now it builds fine
Andrea Giammarchi 08/06/2023 08:59
that's because the .gitignore in that folder doesn't work ... I need to bring it into the parent folder ... which is annoying ... if we could have a whole pyscript-core repository instead it'd be much easier to setup that folder but not sure what others think about this
08:59
meanwhile I could just document that bit in the README, thanks for letting me know
09:00
(or maybe I can fix ascjs module to create the foler if not there ... that seems like more sensible ... maybe ...)
Avatar
Avatar
antocuni
@Andrea Giammarchi small bug in pyscript.core: if you check out pyscript-next and run npm run build, it fails with: Error: ENOENT: no such file or directory, stat 'cjs' I manually run mkdir cjs and now it builds fine
Andrea Giammarchi 08/06/2023 09:02
to be honest the instruction to not ignore that is there https://github.com/pyscript/pyscript/blob/next/.gitignore#L149 ... not sure why our repo doesn't understand it
Home Page: https://pyscript.net Examples: https://pyscript.net/examples - pyscript/.gitignore at next · pyscript/pyscript
Avatar
Cannot destructure property 'runtime' of 'runtimes.get(...)'
Avatar
@Andrea Giammarchi in pyscript-next, can I use an inline <py-config> (or equivalent), or it's required to use an external config file?
Avatar
what is the best way to open issues for pyscript-next? Should I just open an issue on the normal pyscript tracker and label it somehow?
Avatar
Avatar
antocuni
what is the best way to open issues for pyscript-next? Should I just open an issue on the normal pyscript tracker and label it somehow?
Andrea Giammarchi 08/06/2023 19:24
I use [next] as prefix ... the rest is the same
Avatar
Avatar
antocuni
@Andrea Giammarchi in pyscript-next, can I use an inline <py-config> (or equivalent), or it's required to use an external config file?
Andrea Giammarchi 08/06/2023 19:25
with latest from next you need the py-script plugin to do so, otherwise yes
Avatar
Avatar
Andrea Giammarchi
with latest from next you need the py-script plugin to do so, otherwise yes
Andrea Giammarchi 08/06/2023 19:26
that's in the making though, as fully usable plugin, right now it's half-usable but py-confing is in there
👍 1
Avatar
Yesterday & Today BOT 09/06/2023 08:00
📆 09 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 12/06/2023 08:00
📆 12 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 13/06/2023 08:00
📆 13 Jun 2023: Yesterday & Today 🧵
Avatar
Tests on the main repo do not run, it is probably because we switched to a beefier runnner?
14:24
Maybe not, because this has been happening for some PRs older than that as well..
14:26
I think it stopped working after this PR: https://github.com/pyscript/pyscript/pull/1510 (including this one)
14:30
because the PR before that i.e. https://github.com/pyscript/pyscript/pull/1507/commits did have the github workflow running
Avatar
Andrea Giammarchi 13/06/2023 16:29
can anyone confirm main doesn't run CI too? nothing from next got merged there, this is a bit weird!
Avatar
Yesterday & Today BOT 14/06/2023 08:00
📆 14 Jun 2023: Yesterday & Today 🧵
08:02
📆 14 Jun 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 14/06/2023 14:43
Should runtimes have explicit (long) name only? 🧵 (edited)
Avatar
Yesterday & Today BOT 15/06/2023 08:00
📆 15 Jun 2023: Yesterday & Today 🧵
08:01
📆 15 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 16/06/2023 08:00
📆 16 Jun 2023: Yesterday & Today 🧵
08:01
📆 16 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 19/06/2023 08:00
📆 19 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 20/06/2023 08:00
📆 20 Jun 2023: Yesterday & Today 🧵
08:01
📆 20 Jun 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 20/06/2023 13:43
PR1546 Up for quick review before release: the changelog incorrectly says the previous release is 2023.01.01 (it was 2023.03.1) https://github.com/pyscript/pyscript/pull/1546 update Merged, thanks @FabioRosado ! (edited)
The previous release in the changelog is listed as 2023.01.1. The correct title of that release is 2023.03.1.
Avatar
Jeff Glass 20/06/2023 17:12
If it's a helpful data point, the tiny PR I merged this morning (a docs change) also failed in CI, in what looks like the same way as release CI
Avatar
Now that we have released (🎉 congrats everyone!!) 🧵 Shall we go ahead and finally sort the pending issue around examples, plugins and other resources? After discussions in https://github.com/pyscript/pyscript/discussions/1442 and the many chats during the core /pyscript fun meetings, I think we are landing at a place where we want to:
  • keep the collective for examples and listing resources (may need renaming?)
  • publish said examples on pyscript.com (under an official PyScript OSS account, maintained by all maintainers) as the best place for our users to see them, copy and explore using them
  • create a separate repo under the pyscript org called plugins where we collect all the pyscript plugins maintainer by the community (that include but is not limited to the ones we create and maintain). It's important to understand here that this does not mean that ALL plugins go there. For instance, we may want to keep a few core plugins that are shipped by default into core
  • move current examples from core to collective
  • enable examples testing nightly or something and make it part of the release process (but not part of the process for merging a PR). Did I missing anything? Any counter proposals? Please chime in, otherwise I'll start working on these items tomorrow. TY!
(edited)
The topic of "where do we host and cherish community examples" has been around for a while and we should decide what to do and the best place to handle it. The goal of this discussion is ...
antocuni started a thread. 20/06/2023 21:55
Avatar
Yesterday & Today BOT 21/06/2023 08:00
📆 21 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 22/06/2023 08:00
📆 22 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 23/06/2023 08:00
📆 23 Jun 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 23/06/2023 14:47
@Jeff Glass it's not completed yet (last two big topics missing) but I'd love to hear from you around this very first draft of @pyscript/core documentation https://github.com/pyscript/pyscript/blob/a3bf2881e42592d4360eff132118446af426e5eb/pyscript.core/docs/README.md (edited)
Home Page: https://pyscript.net Examples: https://pyscript.net/examples - pyscript/pyscript.core/docs/README.md at a3bf2881e42592d4360eff132118446af426e5eb · pyscript/pyscript
Avatar
Avatar
Andrea Giammarchi
@Jeff Glass it's not completed yet (last two big topics missing) but I'd love to hear from you around this very first draft of @pyscript/core documentation https://github.com/pyscript/pyscript/blob/a3bf2881e42592d4360eff132118446af426e5eb/pyscript.core/docs/README.md (edited)
Jeff Glass 23/06/2023 15:20
This looks awesome @Andrea Giammarchi! I won't have a chance to look at it in detail today, but I'll dive into it over the weekend and get back at you.
Avatar
Avatar
Jeff Glass
This looks awesome @Andrea Giammarchi! I won't have a chance to look at it in detail today, but I'll dive into it over the weekend and get back at you.
Andrea Giammarchi 23/06/2023 15:23
please note I've linked to the readable commit version ... it's going to change as I go so take your time, and feedback welcome!
Avatar
Andrea Giammarchi 23/06/2023 15:37
Description This MR would like to at least draft the most comprehensive user-facing documentation around the current TP so that it's clear what is offering, what is different, why we made some ...
Avatar
Avatar
Andrea Giammarchi
Jeff Glass 26/06/2023 04:43
Just submitted a whole pile of comments on the PR! Feel free to take or leave any of them - some are really tiny, others much broader, nothing's precious.
🙏 1
Avatar
Yesterday & Today BOT 26/06/2023 08:00
📆 26 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 27/06/2023 08:00
📆 27 Jun 2023: Yesterday & Today 🧵
Avatar
Writing the PyScript Next Tech Preview announcement. Please review and lmk your thoughts!
21:35
📢 Announcement: PyScript NEXT (new core) Tech-Preview Release!! 📢 After invaluable community feedback, many experiments in code, and careful cooperation with valued collaborators, we are thrilled to announce the tech preview of the new version of PyScript. This work marks a significant milestone in our journey towards PyScript's vision and what our community has been asking for. Here are the highlights and key features of this groundbreaking technical Milestone, the Tech Preview Release: Massive Size Reduction: We have optimized PyScript to offer a minimal download size. The core library is only ~10kb compressed and all the rest is downloaded only on demand. Combined with the very small footprint of MicroPython, you can have a fully working app in ~250kb, resulting in an astounding reduction of 98% compared to the previous version (~13.5Mb = ~11MB Pyodide + ~2.5MB Pyscript Classic). This makes PyScript more lightweight and faster to download with all the supported interpreters, ensuring a seamless user experience to the user. Versatile Execution Options: With PyScript, you have the flexibility to choose the execution environment that best suits your needs. Whether you prefer executing your code on the main thread or leveraging the power of web workers for parallel processing, in a sync or async way, PyScript has got you covered. Blazing Fast MicroPython Interpreter: The new PyScript core now incorporates a cutting-edge MicroPython interpreter, which delivers unparalleled speed and performance. Experience lightning-fast execution of your Python code in the browser environment. (edited)
21:35
Experimental Interpreters: In addition to the already exciting support for Pyodide and Micropython interpreters, as possible Python interpreters, this Tech Preview also adds support for 2 new experimental Interpreters: wasmoon, an interpreter that runs Lua on the browser and that, among the previous two interpreters, is fully compatible with all core features; and ruby-wasm-wasi an interpreter that adds Ruby to the list of programming languages currently supported :). Multiple Interpreter Support: PyScript now supports the utilization of multiple interpreters simultaneously. This means you can take advantage of different languages (or Python versions) or configurations within a single application, opening up a world of possibilities for experimentation and optimization. Enhanced Compatibility: We have diligently worked on improving PyScript's compatibility with a wider range of Python code and libraries. The re-written core incorporates extensive compatibility optimizations, enabling seamless execution of complex Python applications and libraries in the browser, especially when it comes to supporting blocking calls and other aspects now available through the execution on Web Workers. This also includes the possibility of better debugging capabilities. We invite you to give the tech preview a spin, build something amazing and share your feedback with us. Your participation in the project is at the heart of what we do, and essential for guaranteeing PyScript allows you to build the amazing things you want and fulfills its potential for everyone. To get started, visit the Tech Preview showcase, where you can find detailed documentation and examples! Have fun and build cool stuff. Happy coding! The PyScript Team (edited)
21:36
Feedback 🧵
Avatar
Yesterday & Today BOT 28/06/2023 08:00
📆 28 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 29/06/2023 08:00
📆 29 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 30/06/2023 08:00
📆 30 Jun 2023: Yesterday & Today 🧵
08:01
📆 30 Jun 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 03/07/2023 08:00
📆 03 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 04/07/2023 08:00
📆 04 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 05/07/2023 08:00
📆 05 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 06/07/2023 08:00
📆 06 Jul 2023: Yesterday & Today 🧵
08:02
📆 06 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 07/07/2023 08:00
📆 07 Jul 2023: Yesterday & Today 🧵
08:02
📆 07 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 10/07/2023 08:00
📆 10 Jul 2023: Yesterday & Today 🧵
Avatar
Sharings FS between multiple emscripten programs 🧵
Avatar
Andrea Giammarchi 10/07/2023 14:56
@antocuni is wasmtime a desired interpreter for us? something that would enable proof of concepts out there?
15:02
@here if you are exploring PyScript Next (especially its core as that's what we're working on mostly these days) be aware that @pyscript/core@0.0.8 has been published and it comes with the following breaking changes (for good!):
  • events now pass through a runEvent interpreter helper, and these can only represent context methods or namespaced version of it ... that is py-click="method" or py-script="some.namespace.method" without the (event) part, just the pointer for that event and it will receive the event out of the box
  • we're currently thinking about renaming the xworker module but so far you need to import XWorker from xworker on the page and import xworker from xworker on the Worker/thread
  • other minor improvements should be backed in too, but if there's something not right to you, please file an issue with [next] as prefix and we'll look into it ASAP!
(edited)
Avatar
Better pyodide error messages 🧵
Avatar
Yesterday & Today BOT 11/07/2023 08:00
📆 11 Jul 2023: Yesterday & Today 🧵
08:01
📆 11 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 12/07/2023 08:00
📆 12 Jul 2023: Yesterday & Today 🧵
08:02
📆 12 Jul 2023: Yesterday & Today 🧵
Avatar
wasm-snip 🧵
Avatar
Is there an easy way to save and restore the state of a dictionary in Python? with set_value(a_dict, "key", value): # in the body of the with block, a_dict["key"] is value # after exiting the state of the key is restored, including whether it is present or not I think the best way to do it is: @contextmanager def set_value(d, key, value): orig = d.get(key, _sentinel) d[key] = value try: yield finally: if orig == _sentinel: d.pop(key, None) else: d[key] = orig but this is a bit cumbersome
Avatar
wasm .a files 🧵
Avatar
Yesterday & Today BOT 13/07/2023 08:00
📆 13 Jul 2023: Yesterday & Today 🧵
Avatar
Hey Folks! Quick heads up, as mentioned in https://github.com/pyscript/pyscript/pull/1583#issuecomment-1634635384 , the governance is a very important and delicate one. Here's how I'd like to move the process forward:
  • try to get all other aspects of this PR ready
  • leave the decision-making process and structure on hold
  • list the governance models I've heard so far
  • call a maintainers meeting where we can discuss the models
  • in that meeting, have a selective process where we vote the preferences and each round eliminates the least voted option until we have 1
NOTE: maintainers meeting will likely be around 10 days from now since many folks are at EuroPython next week
This PR aims to bring more clarity on how we interact within the project, how the decision-making process is done and a few other things related to both the workflow and contributing. The goal is t...
Avatar
Yesterday & Today BOT 14/07/2023 08:00
📆 14 Jul 2023: Yesterday & Today 🧵
08:01
📆 14 Jul 2023: Yesterday & Today 🧵
Avatar
hey @hood are you planning on being around later today? I'm working on getting Panel examples working on a worker and I think I hit a pyodide thing (or a polyscript thing, not sure). So would be good to have an extra pair of eyes on it 🙂
Avatar
Yesterday & Today BOT 17/07/2023 08:00
📆 17 Jul 2023: Yesterday & Today 🧵
Avatar
MicroPython JS ffi 🧵
Avatar
Yesterday & Today BOT 18/07/2023 08:00
📆 18 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 19/07/2023 08:00
📆 19 Jul 2023: Yesterday & Today 🧵
08:01
📆 19 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 20/07/2023 08:00
📆 20 Jul 2023: Yesterday & Today 🧵
08:01
📆 20 Jul 2023: Yesterday & Today 🧵
Avatar
tedpatrick 20/07/2023 17:09
We are going to close the PyScript Fun call. Everyone is at EuroPython
Avatar
Yesterday & Today BOT 21/07/2023 08:00
📆 21 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 24/07/2023 08:00
📆 24 Jul 2023: Yesterday & Today 🧵
08:01
📆 24 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 25/07/2023 08:00
📆 25 Jul 2023: Yesterday & Today 🧵
Avatar
Morning... I'll try to pay attention to this much more.
Avatar
Yesterday & Today BOT 26/07/2023 08:00
📆 26 Jul 2023: Yesterday & Today 🧵
08:01
📆 26 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 27/07/2023 08:00
📆 27 Jul 2023: Yesterday & Today 🧵
Avatar
Avatar
ntoll
Morning... I'll try to pay attention to this much more.
The link to your talk is the same as the link to Antonio's 🙂
16:00
@Martin ^^^
16:00
But you can't have too much @antocuni either... 😄
🥸 2
Avatar
Yesterday & Today BOT 28/07/2023 08:00
📆 28 Jul 2023: Yesterday & Today 🧵
08:01
📆 28 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 31/07/2023 08:00
📆 31 Jul 2023: Yesterday & Today 🧵
08:01
📆 31 Jul 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 01/08/2023 08:00
📆 01 Aug 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 01/08/2023 17:30
@pyscript/core on npm 🧵
Avatar
Yesterday & Today BOT 02/08/2023 08:00
📆 02 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 03/08/2023 08:00
📆 03 Aug 2023: Yesterday & Today 🧵
Avatar
Here's the outline of the agenda document for the community call that will start next week. https://docs.google.com/document/d/1iI6sEsDGj5fkG8od--FHf7lRICaBD6IO1K5Ut1qljvg/edit Please, check it out if you can and lmk if you have any feedback. I'm planning on posting it out with a call for partecipation later today. TY!
Welcome to the PyScript Community Call Meeting Zoom link Confused about the call time? Check what time is the meeting in my time zone Introduction The PyScript community gathers on a regular basis to share ideas, discuss roadmap decisions or Issues/Discussions/PRs in person, ask questions an...
Avatar
Yesterday & Today BOT 04/08/2023 08:00
📆 04 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 07/08/2023 08:00
📆 07 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 08/08/2023 08:00
📆 08 Aug 2023: Yesterday & Today 🧵
Avatar
Community call agenda 🧵
Avatar
Yesterday & Today BOT 09/08/2023 08:00
📆 09 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 10/08/2023 08:00
📆 10 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 11/08/2023 08:00
📆 11 Aug 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 11/08/2023 14:47
to @Jeff Glass or anyone else curious, I've sketched down basic PyScript Next documentation in this MR https://github.com/pyscript/pyscript/pull/1634
Description This MR simply sketches down the most basic PyScript Next documentation I can think about ... looking forward for review, hints, suggestions, or listening what's missing. Changes i...
🤩 1
14:49
the current README file can be better read in here: https://github.com/pyscript/pyscript/blob/d661386a8f107d24fe2693bba8ba3b8345c17456/pyscript.core/docs/README.md ... please note if changes land this specific link won't get updated automatically
Avatar
Yesterday & Today BOT 14/08/2023 08:00
📆 14 Aug 2023: Yesterday & Today 🧵
Avatar
Avatar
Andrea Giammarchi
to @Jeff Glass or anyone else curious, I've sketched down basic PyScript Next documentation in this MR https://github.com/pyscript/pyscript/pull/1634
Jeff Glass 14/08/2023 15:15
Sorry I didn't see this before the weekend, or I would have had a lot more reading material! What's most helpful to you on this? Do want general comments, specific comments, and/or proofreading? Or hold off for a bit?
Avatar
Yesterday & Today BOT 15/08/2023 08:00
📆 15 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 16/08/2023 08:00
📆 16 Aug 2023: Yesterday & Today 🧵
08:01
📆 16 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 17/08/2023 08:00
📆 17 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 18/08/2023 08:00
📆 18 Aug 2023: Yesterday & Today 🧵
08:01
📆 18 Aug 2023: Yesterday & Today 🧵
Avatar
FabioRosado 19/08/2023 10:11
Just putting this here for visibility, seems like the docker terminal at the bottom by default is confusing some users:
Avatar
Yesterday & Today BOT 21/08/2023 08:00
📆 21 Aug 2023: Yesterday & Today 🧵
08:01
📆 21 Aug 2023: Yesterday & Today 🧵
antocuni started a thread. 21/08/2023 09:47
Avatar
Yesterday & Today BOT 22/08/2023 08:00
📆 22 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 23/08/2023 08:00
📆 23 Aug 2023: Yesterday & Today 🧵
Avatar
Hi! I'm back from vacation. I'd like to play a bit with the upcoming pyscript-next, where are the most up-to-date instructions about it?
Avatar
Yesterday & Today BOT 24/08/2023 08:00
📆 24 Aug 2023: Yesterday & Today 🧵
08:02
📆 24 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 25/08/2023 08:00
📆 25 Aug 2023: Yesterday & Today 🧵
Avatar
heads up! Just added this discussion to keep track of the pending tasks needed for the Next release: https://github.com/pyscript/pyscript/discussions/1653
Opening this as an umbrella issue to capture all tasks issues and tasks needed to get the first release of PyScript Next out: Restore integration tests: This is needed to have the bare minimum leve...
🥳 1
Avatar
Yesterday & Today BOT 28/08/2023 08:00
📆 28 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 29/08/2023 08:00
📆 29 Aug 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 30/08/2023 08:00
📆 30 Aug 2023: Yesterday & Today 🧵
Avatar
python code bundling in pyscript-classic 🧵
Avatar
Yesterday & Today BOT 31/08/2023 08:00
📆 31 Aug 2023: Yesterday & Today 🧵
08:02
📆 31 Aug 2023: Yesterday & Today 🧵
Avatar
proper time.sleep in workers 🧵
Avatar
Yesterday & Today BOT 01/09/2023 08:00
📆 01 Sep 2023: Yesterday & Today 🧵
Avatar
Just a heads up to avoid duplication of work this week that we are focusing on wrapping up the release. I've started a ton of changes to the docs this weekend and have things in a branch that will be pushing tomorrow (likely late in European time because it's a holiday and I probably won't be waking up early 😅) So, better to focus on wrapping up any other things related to the release. 🙂
Avatar
Yesterday & Today BOT 04/09/2023 08:00
📆 04 Sep 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 05/09/2023 08:00
📆 05 Sep 2023: Yesterday & Today 🧵
Avatar
Heads up. As mentioned in the community call, here's the docs branch I'm working on: https://github.com/pyscript/pyscript/compare/next...fpliger/new_docs?expand=1 You should be able to check the new docs layout by following the instructions in the newdocs/README.md file.
Home Page: https://pyscript.net Examples: https://pyscript.net/examples - Comparing next...fpliger/new_docs · pyscript/pyscript
Avatar
Yesterday & Today BOT 06/09/2023 08:00
📆 06 Sep 2023: Yesterday & Today 🧵
Avatar
🚨 IMPORTANT: Release Plan 🧵 As we are working to get things aligned and release, I've been thinking how do that in the most graceful, open and communicative way. Here's what I was thinking: Ssince a lot has changed and there's a lot going on, I'd like to propose we release tomorrow or, the latest, Friday early (morning European time) but hold to announce until we are good with documentation and messaging (which might happen this week or may spill into next week). This way we keep the stressful part of the release out of the way (or at least we split them) and deliver without trying to rush to get all together. Thoughts?
Jeff Glass started a thread. 06/09/2023 21:39
Avatar
Ok.... I've opened https://github.com/pyscript/pyscript/pull/1681 because I'm still cleaning up, need add tests and other small things but, more than that, it adds pydom under pyweb as a namespace package (idea here is that other 3rd party packages can augment the namespace package. (At least that's the idea that Antonio and I were entertaining...) Honestly, I feel like the way pydom is currently organized is not great... Ideas? Another question: We currently don't have @when and HTML. This PR somehow introduce them back but.... where do you think they should belong? pyscript module? pyweb?
Description This PR adds the pyweb namespace package, that includes pydom, a higher-level Pythonic DOM API Changes Adds pyweb to the stdlib Checklist All tests pass locally I have updated docs/...
Avatar
Yesterday & Today BOT 07/09/2023 08:00
📆 07 Sep 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 08/09/2023 08:00
📆 08 Sep 2023: Yesterday & Today 🧵
Avatar
Heads up. The more I've been working on pydom and testing the release... the more a couple of things felt off (specially the naming and namespace of pydom). I've pairined with @tedpatrick and @Martin yesterday and today and we capture out thoughts in this discussion https://github.com/pyscript/pyscript/discussions/1687 Please check it out and let's discuss before we release. (I know it's a bit of last minute but I'd rather take a few more days than make a big mess 🙂 )
I've been working on pydom, docs, and examples, while also trying to ask around out of the core maintainers group and understand what feels natural and "pythonic". This morning I'...
Avatar
Yesterday & Today BOT 11/09/2023 08:00
📆 11 Sep 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 11/09/2023 14:10
@Andrea Giammarchi What's the best way to point PyScipt Next to a specific version of Pyodide? As far as I can tell, <script type="py"> doesn't support the version tag like Polyscript
Avatar
Yesterday & Today BOT 12/09/2023 08:00
📆 12 Sep 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 13/09/2023 08:00
📆 13 Sep 2023: Yesterday & Today 🧵
Avatar
xterm-pty + emscripten 🧵
Avatar
Should import pydom become from pyscript import dom? 🧵
Avatar
"Send" Pyhon code to an xworker 🧵
Avatar
Terminal vs REPL 🧵
Avatar
Yesterday & Today BOT 14/09/2023 08:00
📆 14 Sep 2023: Yesterday & Today 🧵
Avatar
quick preview of what I'll show in pyscript FUN 🙂
❤️ 2
Avatar
The two demos I showed in the FUN call: https://twitter.com/antocuni/status/1702373875223285924
@pyscript_dev Demo #1: xterm.js + input() + pdb++: https://t.co/CpOZKjR607 Demo #2: same as above, running pytest --pdb https://t.co/vdY0jXhPYj
🤩 1
Avatar
Avatar
antocuni
The two demos I showed in the FUN call: https://twitter.com/antocuni/status/1702373875223285924
Jeff Glass 14/09/2023 19:59
SO COOL!
❤️ 1
Avatar
Yesterday & Today BOT 15/09/2023 08:00
📆 15 Sep 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 15/09/2023 15:57
I've started adding the Classic tag to issues the PyScript repo that relate purely to bugs or implementation details in PyScript Classic. These would be good candidates for re-examination or closure once we release.
Avatar
A (almost) GUI debugger for PyScript 😍. https://antocuni.pyscriptapps.com/gui-debugger/latest/
😍 1
Fabio started a thread. 15/09/2023 16:41
Avatar
Avatar
Jeff Glass
I've started adding the Classic tag to issues the PyScript repo that relate purely to bugs or implementation details in PyScript Classic. These would be good candidates for re-examination or closure once we release.
Andrea Giammarchi 15/09/2023 16:42
that's both good but slightly controversial after release ... as we're discussing (as I write) if we should fix/maintain classic, once next branch is out/released.
Avatar
Avatar
Andrea Giammarchi
that's both good but slightly controversial after release ... as we're discussing (as I write) if we should fix/maintain classic, once next branch is out/released.
Jeff Glass 15/09/2023 17:00
Ahhh gotcha. Fair enough; I'll continue tagging just for our own tracking, but perhaps we don't close them (or not right away). Thanks for the heads up!
Avatar
Avatar
Jeff Glass
Ahhh gotcha. Fair enough; I'll continue tagging just for our own tracking, but perhaps we don't close them (or not right away). Thanks for the heads up!
This is a great opportunity for sanitizing our issues and cleaning a lot of things. We always proceeded with the assumption that we'd not maintain the old codebase [we clearly stated that PyScript is young and, although we'll try to not break things, we'll break them for some time and users should take that into account and pin their versions].
Avatar
Yesterday & Today BOT 18/09/2023 08:00
📆 18 Sep 2023: Yesterday & Today 🧵
08:01
📆 18 Sep 2023: Yesterday & Today 🧵
Avatar
Pyodide 0.24 is a major release focused on fine tuning public APIs and performance. It includes a major rework of the streams APIs to be faster and more flexible. We increased the consistency of the foreign function interface. We also added micropip support for the Python simple repository API. Performance Improvements Up to this point, we had n...
Avatar
regeneration of pyscript.core/src/stdlib/pyscript.js 🧵
Avatar
PyScript ready 🧵
Avatar
differences between <script type="py> and <py-script> 🧵
Avatar
Knowing when a worker tag is done 🧵
Avatar
Yesterday & Today BOT 19/09/2023 08:00
📆 19 Sep 2023: Yesterday & Today 🧵
08:01
📆 19 Sep 2023: Yesterday & Today 🧵
Avatar
PyScript Event Calendar 📆 I have created another calender which contains the PyScript public events:
Avatar
tedpatrick 19/09/2023 15:59
Welcome @bugzpodder to pyscript-core
🤗 2
👋 1
Avatar
Yesterday & Today BOT 20/09/2023 08:00
📆 20 Sep 2023: Yesterday & Today 🧵
08:01
📆 20 Sep 2023: Yesterday & Today 🧵
Avatar
tedpatrick 20/09/2023 19:12
Today we are moving "next" branch to "main". Change is underway...
🥳 2
Avatar
Jeff Glass 20/09/2023 19:13
A big day!
Avatar
tedpatrick 20/09/2023 19:13
1. "main" renamed to "classic". Branch is locked.
19:13
2. "next" renamed to "main".
19:14
3. Starting series of PR to enable GHActions for deployment/testing
Jeff Glass started a thread. 20/09/2023 19:25
Avatar
tedpatrick 20/09/2023 19:53
Ran a snapshot deployment for 2023.09.1.TEST1. Ran perfectly output is here https://pyscript.net/snapshots/2023.09.1.TEST1/
Avatar
Yesterday & Today BOT 21/09/2023 08:00
📆 21 Sep 2023: Yesterday & Today 🧵
08:01
📆 21 Sep 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 21/09/2023 16:45
@Andrea Giammarchi Just to make sure I'm not missing something: PolyScript's env attribute is not available in PyScript, yes? Or rather, is always set to the same value across all tags by this line?https://github.com/pyscript/pyscript/blob/287d0fa1afb2d395f9382147054c9fd7656a8e43/pyscript.core/src/core.js#L144
16:47
Not requesting it, just working on an explanation/blog post around script attributes for after release
Avatar
Avatar
Jeff Glass
@Andrea Giammarchi Just to make sure I'm not missing something: PolyScript's env attribute is not available in PyScript, yes? Or rather, is always set to the same value across all tags by this line?https://github.com/pyscript/pyscript/blob/287d0fa1afb2d395f9382147054c9fd7656a8e43/pyscript.core/src/core.js#L144
Andrea Giammarchi 21/09/2023 16:48
env is the most unique identifier we have and py-script is our env in polyscript, yes ... it's not exposed though, but no example or use case required otherwise ... we could expose it but I am not sure what's the purpose so that maybe we can do better?
16:50
I think env should be out of the discussion in PyScript .... if you specify a different env it means you want a new pyodide bootstrap and we don't have any mechanism to map a <py-config> element to that desire needed ... please keep env out of the explanation as that's really more like a polyscript internal feature, exposed by need, rather than by usefulness, thanks!
Avatar
Avatar
Andrea Giammarchi
I think env should be out of the discussion in PyScript .... if you specify a different env it means you want a new pyodide bootstrap and we don't have any mechanism to map a <py-config> element to that desire needed ... please keep env out of the explanation as that's really more like a polyscript internal feature, exposed by need, rather than by usefulness, thanks!
Jeff Glass 21/09/2023 16:51
Makes sense to me - thank you!
Avatar
Andrea Giammarchi 21/09/2023 16:52
to re-mention my answer in other venues ... "please don't mention polyscript when you talk about PyScript, as we might even want to drop polyscript features out of the box to avoid confusion about what PyScript is" ... that might is already here https://github.com/pyscript/polyscript/pull/46 (edited)
Coming from this comment pyscript/pyscript#1728 (comment) I think there is a desire to have default polyscript behavior out of our way. This MR makes it possible for embedders to actually reach pol...
👍 1
16:54
we have <script type="mpy"> now for MicroPython, and Lua and Ruby don't need to be mentioned ... so don't mention polyscript at all feels like the natural consequence of current state. (edited)
16:54
(or <mpy-script>)
Avatar
Jeff Glass 21/09/2023 17:00
Agreed - I was just writing up an explanation of the async src , worker, and config attributes in PyScript, and I think I had mistakenly remembered that env was also available in PyScript. Clearly I was wrong - thanks for confirming!
Avatar
Some notes from wasmcon @Fabio
Avatar
I made an example with Pyodide 0.24.0 + coincident that correctly handles the interaction between stdio and keyboard interrupts: https://github.com/hoodmane/coincident/tree/interrupts/interrupt-example I added one commit to coincident to get this working: https://github.com/hoodmane/coincident/commit/5c46edbfe578ad54fd858fd84b6c5941c3f821b1#diff-b2c8927ebb8acd7d573766fdc77d5841daa68c67788f98e1b5b090156a7829eb @antocuni @Andrea Giammarchi
Avatar
Yesterday & Today BOT 22/09/2023 08:00
📆 22 Sep 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 24/09/2023 00:38
What's the status on #1743 "Ensure dedicated configs per interpreter" ? The one that got reverted right before RC1. (edited)
Avatar
Yesterday & Today BOT 25/09/2023 08:00
📆 25 Sep 2023: Yesterday & Today 🧵
08:02
📆 25 Sep 2023: Yesterday & Today 🧵
Avatar
Avatar
hood
I made an example with Pyodide 0.24.0 + coincident that correctly handles the interaction between stdio and keyboard interrupts: https://github.com/hoodmane/coincident/tree/interrupts/interrupt-example I added one commit to coincident to get this working: https://github.com/hoodmane/coincident/commit/5c46edbfe578ad54fd858fd84b6c5941c3f821b1#diff-b2c8927ebb8acd7d573766fdc77d5841daa68c67788f98e1b5b090156a7829eb @antocuni @Andrea Giammarchi
Andrea Giammarchi 25/09/2023 09:32
I think we have that working already witohut needing to change coincident at all but maybe @antocuni can provide more details?
09:35
also worth saying that any main exposed utility can be a promise and I would personally implement timeouts in there witohut bothering too much the Atomics API ... but that's probably another story.
Avatar
Avatar
Jeff Glass
What's the status on #1743 "Ensure dedicated configs per interpreter" ? The one that got reverted right before RC1. (edited)
Andrea Giammarchi 25/09/2023 09:36
what do you mean reverted? AFAIK <mpy-config> and <py-config> work as expected ... don't these? I wasn't aware of any revert there ...
Avatar
Andrea Giammarchi 25/09/2023 10:00
never mind ... I've read the internal discussion ... I have no idea why I've missed that on Friday but the current state for multiple config is broken ... and I am pretty sad about it.
10:01
it was likely just a typo to fix but we went full revert ... I'll try to make it right today.
Avatar
Andrea Giammarchi 25/09/2023 10:28
it was a typo (actually a global implicit reference) the linter ddn't spot 🤦 https://github.com/pyscript/pyscript/pull/1753 (edited)
Description This MR re-revert needed changes to make multiple config working on current RC which is otherwise broken. Changes revert the removal of the code putting back TS definitions actually fi...
Avatar
Avatar
Andrea Giammarchi
I think we have that working already witohut needing to change coincident at all but maybe @antocuni can provide more details?
I think that what @hood added is the correct handling of CTRL-C, which Python is supposed to intercept and raise KeyboardInterrupt. E.g., try to go to my console demo and press CTRL-C: you can see that KeyboardInterrupt is not raised: https://antocuni.pyscriptapps.com/pyterminal-poc/latest/?console/ (edited)
Avatar
Avatar
antocuni
I think that what @hood added is the correct handling of CTRL-C, which Python is supposed to intercept and raise KeyboardInterrupt. E.g., try to go to my console demo and press CTRL-C: you can see that KeyboardInterrupt is not raised: https://antocuni.pyscriptapps.com/pyterminal-poc/latest/?console/ (edited)
Andrea Giammarchi 25/09/2023 11:40
I see ^C though which seems ... OK? is not that we can exit the terminal ... or should we? 🤔
Avatar
Avatar
Andrea Giammarchi
I see ^C though which seems ... OK? is not that we can exit the terminal ... or should we? 🤔
well no, it's not ok. See e.g. what happens on linux and what happens in my demo in this case:
Avatar
Avatar
antocuni
well no, it's not ok. See e.g. what happens on linux and what happens in my demo in this case:
Andrea Giammarchi 25/09/2023 11:45
what I mean is that you could catch that somehow ... or maybe not? the event has these details backed in (i.e. the ctrl is held down) which is why I think we could fix this somehow without needing to add ad-hoc or not-properly-handled key combinations ... specially because I think I would end up needing that anyway, but maybe Hood didn't have to deal with these and Atomics fail automatically out of CTRL+C ... that'd be urprising to me though.
Avatar
I agree with @antocuni and @hood CTRL-C should result in a KeyboardInterrupt. That's what Python folk expect. If you want to copy something from the "terminal" with out using CTRL-C the convention is SHIFT-CTRL-C for "copy".
Avatar
Andrea Giammarchi 25/09/2023 11:46
"I would end up needing that" I mean it's something I would nede to handle on the JS side anyway
Avatar
Also, can folks please chime in on this proposal about a new files configuration option: https://github.com/pyscript/pyscript/discussions/1755
The context I've just been drafting the documentation for the new release of PyScript. When it came to describing the fetch option, I realised it's complicated, to the extent that you need ...
👀 1
Avatar
Andrea Giammarchi 25/09/2023 11:46
we all agree there, what I am not sure I agree on is the needed change in coincidence ...
Avatar
Avatar
Andrea Giammarchi
we all agree there, what I am not sure I agree on is the needed change in coincidence ...
I don't know enough of the coincident internals to judge whether this can be implemented without changes, so I guess it's better to wait for @hood input
Avatar
So... what to do when PyScript is loading? 🧵 🔄
Avatar
Anyone here in the UK..? heads up - on the 24th October I'll be presenting a workshop about PyScript to the Oxford PUG. Details and sign-up coming soon.
Avatar
Avatar
ntoll
Anyone here in the UK..? heads up - on the 24th October I'll be presenting a workshop about PyScript to the Oxford PUG. Details and sign-up coming soon.
Jeff Glass 25/09/2023 14:06
Very cool! Maybe worth posting in chat or announcements as well when you get details, in case there are community members that can come 🥳
cooldoge 1
Avatar
Avatar
Jeff Glass
Very cool! Maybe worth posting in chat or announcements as well when you get details, in case there are community members that can come 🥳
👍 I have to admit I've been mostly occupied by (Anaconda) Slack - and this is my concerted effort to kill-off-Slack and do all the things on discord. Thanks for the heads up.
Avatar
Order of execution of tags 🧵
Avatar
I'd like to propose today as "can of worms" Monday... or perhaps "thread of worms"..? Some great discussions happening here... 👍
🪱 4
Avatar
Can someone review/approve this PR please? https://github.com/pyscript/pyscript/pull/1742 (edited)
This is another PR which aims to clean up a bit the testsuite and integration tests. Highlights: Some of the @skipped tests just worked -- I unskipped them some worked after some small tweak to ad...
Avatar
Avatar
antocuni
Can someone review/approve this PR please? https://github.com/pyscript/pyscript/pull/1742 (edited)
Jeff Glass 25/09/2023 16:56
Working on it and running its tests in the meantime 👍
Avatar
Avatar
Jeff Glass
Working on it and running its tests in the meantime 👍
thank you!
Avatar
Hi Folks, my youngest is 16 today, he's just back from school and we're about to do "opening presents" and a family meal - so I'll be clocking off early-ish (5pm UK time). Catch you lovely folks tomorrow. 👋 (edited)
👋 1
Avatar
Avatar
antocuni
I don't know enough of the coincident internals to judge whether this can be implemented without changes, so I guess it's better to wait for @hood input
It is necessary to modify coincident because it currently performs an Atomics.wait and blocks all activity. This has to be changed instead to have a timeout and periodically check for a keyboard interrupt.
👍 1
02:06
Otherwise the keyboard interrupt cannot be raised until whatever coincident is waiting on is resolved
Avatar
Yesterday & Today BOT 26/09/2023 08:00
📆 26 Sep 2023: Yesterday & Today 🧵
Avatar
Avatar
hood
Otherwise the keyboard interrupt cannot be raised until whatever coincident is waiting on is resolved
Andrea Giammarchi 26/09/2023 08:41
this is my point ... you decide what to wait for and for an input field you can decide to reject or resolve when CTRL+C is passed along.
08:43
the timeout approach, when we have scripts taking really long time to produce images or anything else, feels more like a slippery slope ... fine tuning the awaited promise gives us more control, not less, imho ... but maybe I am missing some particular scenario where waiting "forever" is not desired? at the end it's non-blocking waiting so I still don't see the issue, thanks for eventual further details.
Avatar
Avatar
Andrea Giammarchi
the timeout approach, when we have scripts taking really long time to produce images or anything else, feels more like a slippery slope ... fine tuning the awaited promise gives us more control, not less, imho ... but maybe I am missing some particular scenario where waiting "forever" is not desired? at the end it's non-blocking waiting so I still don't see the issue, thanks for eventual further details.
bugzpodder 26/09/2023 09:21
I’m running multiple python code blocks on the same worker. If one takes forever to run the others won’t get run so it’ll be nice to kill the execution. In general at least for my scenario I would like memory limit and time limit on these python code executions. Memory limit seems to be already enforced by wasm. For code carefully crafted by the author it’s probably a non-issue but as soon as user is involved all bets are off. (edited)
Avatar
Avatar
Andrea Giammarchi
this is my point ... you decide what to wait for and for an input field you can decide to reject or resolve when CTRL+C is passed along.
it's as usual a difference between the kind of environment that Python expects, and the environment that the browser offers.
10:04
On Linux/windows/mac, CTRL-C is handled through signals, but you don't have signals in the browser
10:07
so, if we want to have the "standard" CTRL+C behavior that python users expects, we need to emulate them somehow (in the very same way in which we use xworker.sync to emulte blocking syscalls). If I understand correctly, @hood 's approach is to emulate signals by checking "did the user press CTRL+C" every 50 ms or so. But this timeout is completely transparent to the end user, the end user-code will never timeout
10:11
CTRL+C and KeyboardInterrupt 🧵
Avatar
Quick question - what exactly is the status of work on a terminal-like version of the Python REPL..? Also, anything happening on the "notebook" style way of working with PyScript we used to call "the REPL"..? (edited)
antocuni started a thread. 26/09/2023 14:00
Avatar
tedpatrick 26/09/2023 15:50
Welcome @Josh (EduBlocks) . Josh is integrating PyScript into Edublocks
👋 2
🎉 3
Avatar
My PR for worker tests is ready for review: https://github.com/pyscript/pyscript/pull/1757
This PR re-enables tests on workers. Highlights: by default, each test is run twice: the main thread version uses <script type="py">, the worker version automatically turn the tags...
Avatar
Yesterday & Today BOT 27/09/2023 08:00
📆 27 Sep 2023: Yesterday & Today 🧵
Avatar
What to do with examples 🧵
Avatar
Custom github runner? 🧵
Avatar
Josh (EduBlocks) 27/09/2023 11:18
Fetch & MicroPython 🧵
Avatar
PR ready to review: this re-enables CI tests 🎉 https://github.com/pyscript/pyscript/pull/1760
This re-enables CI tests on every PR 🎉. This uses make test-integration, which runs tests sequentially. In theory, we also have test-integration-parallel but it seems to be very flaky: many tests r...
Avatar
I opened a PR to discuss if/how to fix the remaining skip on the main thread: https://github.com/pyscript/pyscript/issues/1761 (I'll do a similar one for workers soon)
After we merge #1760, we have 13 tests which are skipped when running pyscript on the main thread. I haven't investigated them in details yet, and I suspect/assume that some of them fail for th...
Avatar
test_report workflow not running 😤 🧵
Avatar
Yesterday & Today BOT 28/09/2023 08:00
📆 28 Sep 2023: Yesterday & Today 🧵
Avatar
py-terminal plugin 🧵
Avatar
leriomaggio (Valerio) 28/09/2023 16:03
🙋🏻‍♂️ I have a quick question: Is there any support in the latest RC1 to program event handlers (e.g. on_click) with Python functions using MicroPython ? Pls ignore. I solved the old-fashioned way using FFI and passing in a Python function directly 🙂 (edited)
Avatar
Josh (EduBlocks) 28/09/2023 17:52
Following up on my fetch & micropython query yesterday, not sure if i've found a bug or if i'm doing something wrong. Here's a much more simplified example than yesterday on pyscript.com. If it's an issue, I can file a github bug 🙂 https://pyscript.com/@joshualowe1002/config-with-micropython/latest
Avatar
Avatar
Josh (EduBlocks)
Following up on my fetch & micropython query yesterday, not sure if i've found a bug or if i'm doing something wrong. Here's a much more simplified example than yesterday on pyscript.com. If it's an issue, I can file a github bug 🙂 https://pyscript.com/@joshualowe1002/config-with-micropython/latest
Andrea Giammarchi 28/09/2023 19:53
oddly enough ... your "work" example doesn't work in here from that space
19:53
ooops, sorry, I've misread your example ... checking now
Avatar
Josh (EduBlocks) 28/09/2023 19:54
my bad, i should have been more clear! It's setup to not work, with a working example also in the file 😄
Avatar
Andrea Giammarchi 28/09/2023 19:58
fixed in current main, I've just checked it
Avatar
Josh (EduBlocks) 28/09/2023 20:01
cool! is it just a case of waiting for RC2 for me to be able to test (or is there a direct link to main which i can embed within the app)? (edited)
Avatar
Avatar
Josh (EduBlocks)
cool! is it just a case of waiting for RC2 for me to be able to test (or is there a direct link to main which i can embed within the app)? (edited)
Andrea Giammarchi 28/09/2023 20:16
we have unstable deployment but I don't want to mislead you with the wrong link
20:16
we're close to RC2 though ... so please bear with us
Avatar
Josh (EduBlocks) 28/09/2023 20:17
i'll wait, this is just me messing around, not urgent! 🙂
Avatar
Andrea Giammarchi 28/09/2023 20:29
well, that's an ugly error not existent in our main, I want to be sure at least you know that's been fixed 😄
Avatar
Yesterday & Today BOT 29/09/2023 08:00
📆 29 Sep 2023: Yesterday & Today 🧵
08:01
📆 29 Sep 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 29/09/2023 12:41
flaky tests 🧵
Avatar
Yesterday & Today BOT 02/10/2023 08:00
📆 02 Oct 2023: Yesterday & Today 🧵
08:01
📆 02 Oct 2023: Yesterday & Today 🧵
Avatar
leriomaggio (Valerio) 02/10/2023 12:54
I’ve found a very weird behaviour (i.e. a bug) happening when using display to show a matplotlib figure (i.e. image?) + append=False inside an event-handler! It seems that inside an handler function (regardless how you’ve programmed it, namely via explicit addEventListener + create_proxy combination or using @when) the display freezes and doesn’t work anymore. Everything works as expected when used outside the event_handler function. Since it’s quite niche, and difficult to explain I have it demonstrated here: https://pyscript.com/@leriomaggio/rough-bar/latest To replicate: (see also the console.log messages proving event handlers are actually working. 1) the display with text & matplotlib.plot work as expected when called during the main-thread execution. 2) if you click on display text button, display(..., append=False) works as expected with textual content 3) if you click on display plot it should be displaying a plt.plt on a randomly generated range every time you click (see also console.log msgs) instead only the first is shown, and others won't be displayed at all! (edited)
Avatar
A new language for polyscript 😅 https://joeyh.name/blog/entry/Haskell_webassembly_in_the_browser/ "Programming for the 0.0009%" 😂
😱 1
cooldoge 1
Avatar
Avatar
antocuni
A new language for polyscript 😅 https://joeyh.name/blog/entry/Haskell_webassembly_in_the_browser/ "Programming for the 0.0009%" 😂
Andrea Giammarchi 02/10/2023 14:57
it doesn't provide an interpreter for what I could tell ... it uses pre-built-as-WASM files such as Hello.wasm so it can't be ported to polyscript.
Avatar
Avatar
Andrea Giammarchi
it doesn't provide an interpreter for what I could tell ... it uses pre-built-as-WASM files such as Hello.wasm so it can't be ported to polyscript.
Andrea Giammarchi 02/10/2023 14:58
arguably, polyscript might be able to pass along already compiled .wasm files but we don't have yet a use case for that, so I won't spend time on it 😅
Avatar
sure... I was just joking 🙂
Avatar
Yesterday & Today BOT 03/10/2023 08:00
📆 03 Oct 2023: Yesterday & Today 🧵
Avatar
leriomaggio (Valerio) 03/10/2023 14:54
ICYMI: just submitted a PR (first to pyscript-next 🤩 ) to fix a few things in the display function (cc/ @antocuni @Jeff Glass ): https://github.com/pyscript/pyscript/pull/1784
Description This PR includes a more robust implementation of the display function, and appropriate exception raised. All changes to code are corroborated by corresponding test cases (see tests/int...
🎉 3
🥳 1
Avatar
@Jeff Glass @Fabio @Andrea Giammarchi @tedpatrick and anyone else interested in plugins 🔌 ⚡ I'd like to organise a Zoom call where we can "get our story straight". I.e. we have the "stuff" in place to make this work, we just need to be able to explain ourselves in a "how to do plugins" sort of a way. I want to figure out what this story is... please reply with availability and comments in the 🧵
Jeff Glass started a thread. 03/10/2023 18:38
Avatar
Heads up, just created a discussion for us to propose and align on what other features/tasks we should complete for the next 2023.10.1 release. https://github.com/pyscript/pyscript/discussions/1786
The goal of this discussion is to set a clear target for the 2023 Release. Given that #1653 is basically done, here's the list of pending features and tasks for us to complete the release: Rein...
🧡 2
Avatar
^^added a pointer and an associated PR for synclink removal
Avatar
Yesterday & Today BOT 04/10/2023 08:00
📆 04 Oct 2023: Yesterday & Today 🧵
Avatar
We need to talk about the top level Makefile in the PyScript repo... that's another "classic" that needs updating. 😉
14:52
(I'm just writing up developer set-up and trying all the things)
14:53
Also, I hope we can do a sweep of our code and annotate it with helpful comments.
Avatar
Avatar
ntoll
(I'm just writing up developer set-up and trying all the things)
a nice! Then let me make sure that you are aware of this: https://github.com/pyscript/pyscript/issues/1783
I open this issue so that we don't forget. The old docs contained some valuable information on how to setup the dev environment and how to run tests. In particular, there is a nice section whic...
Avatar
@antocuni exactly why I'm writing this stuff down. 😉
Avatar
Yesterday & Today BOT 05/10/2023 08:00
📆 05 Oct 2023: Yesterday & Today 🧵
Avatar
pre-commit.ci 🧵
Avatar
Top level Makefile 🧵
13:56
Writing the docs is a great way to highlight problem areas, questions and clarifications. (See ^^^)
Avatar
Jeff Glass 05/10/2023 21:47
@ntoll somewhat interest question over on Stack Overflow that involves your Piratcal Pyscript example. The asker is really making a Python mistake, not a PyScript mistake (trying to call a method of a class, instead of the method of an instance of that classs), which the comments address. Still, there may be something interesting there if you want to tweak anything in that example? https://stackoverflow.com/questions/77227153/pyscript-using-classes-in-the-python-source-code
I am trying to rewrite the Polyglot - Piratical PyScript application using in main.py a Pirate class instead of the original translate_english function. pyscript.json { "packages": [&...
👍 1
Avatar
Yesterday & Today BOT 06/10/2023 08:00
📆 06 Oct 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 06/10/2023 10:03
is slack down for you too? ... it's back ... (edited)
Avatar
Avatar
Jeff Glass
@ntoll somewhat interest question over on Stack Overflow that involves your Piratcal Pyscript example. The asker is really making a Python mistake, not a PyScript mistake (trying to call a method of a class, instead of the method of an instance of that classs), which the comments address. Still, there may be something interesting there if you want to tweak anything in that example? https://stackoverflow.com/questions/77227153/pyscript-using-classes-in-the-python-source-code
Interesting... I used a function precisely so I don't have to explain classes. 🙂 From the look of the SO thread, I guess this is all part of the asker's learning journey..? Also, I might be missing something, so I'm always open to suggestions.
Avatar
@here plugin meeting starting.
Avatar
Andrea Giammarchi 06/10/2023 16:01
Disambiguating Hooks for good 🧵
Avatar
OK folks, I'm outta here for the weekend. Have a good one and see you lovely folks on Monday.
👋 1
Avatar
Yesterday & Today BOT 09/10/2023 08:00
📆 09 Oct 2023: Yesterday & Today 🧵
Avatar
I think most maintainers are out tomorrow. So far, I think only @Andrea Giammarchi and I are around... @Jeff Glass where you planning on attending tomorrow? Either way, I think we should still keep the call up even if it may be brief. We can talk more details about the current status and be there if folks from the community join 🙂
Avatar
Avatar
Fabio
I think most maintainers are out tomorrow. So far, I think only @Andrea Giammarchi and I are around... @Jeff Glass where you planning on attending tomorrow? Either way, I think we should still keep the call up even if it may be brief. We can talk more details about the current status and be there if folks from the community join 🙂
Jeff Glass 09/10/2023 22:55
I think I should be available at 10:30a CST for the call tomorrow! Would gladly chat about the current status; Ted mentioned today he may hop on as well.
♥️ 1
Avatar
Perfect!
Avatar
Yesterday & Today BOT 10/10/2023 08:00
📆 10 Oct 2023: Yesterday & Today 🧵
Avatar
Avatar
Fabio
I think most maintainers are out tomorrow. So far, I think only @Andrea Giammarchi and I are around... @Jeff Glass where you planning on attending tomorrow? Either way, I think we should still keep the call up even if it may be brief. We can talk more details about the current status and be there if folks from the community join 🙂
Andrea Giammarchi 10/10/2023 08:39
FYI I am off today at 17:30 sharp so I won't make it for the call, I should've mentioned this in here too.
👍 2
Avatar
Yeah... I'm meeting a teacher with Josh, later this afternoon.
Avatar
No problem. 🙂
Avatar
Jeff Glass 10/10/2023 16:32
@Fabio I'm in the call and 'waiting for host to join'. Looks like @madhurt is here too
Avatar
was here, joining again
Avatar
Wait... I'm in the wrong call lol
🤣 1
Avatar
With the upcoming release of PyScript Next, it makes sense to think about the examples: All (or most examples) use the link: https://pyscript.net/latest/pyscript.js We should consider the following...
Avatar
Yesterday & Today BOT 11/10/2023 08:00
📆 11 Oct 2023: Yesterday & Today 🧵
Avatar
wooo, I managed to get the first prototype of a "stripped down" version of python.wasm which doesn't contain the parser. It can still run precompiled *.pyc files, but no .py files. So far it's only the parser, but it already saves 1MB, but the plan is to remove more stuff which is needed only for the .py case (e.g., the bytecode compiler and the ast module). I don't know why python-wasi is so much bigger than pyodide, I suspect that it didn't do any treeshaking
🥳 1
👍 1
Avatar
Jeff Glass 11/10/2023 20:27
Very cool!
Avatar
Avatar
antocuni
wooo, I managed to get the first prototype of a "stripped down" version of python.wasm which doesn't contain the parser. It can still run precompiled *.pyc files, but no .py files. So far it's only the parser, but it already saves 1MB, but the plan is to remove more stuff which is needed only for the .py case (e.g., the bytecode compiler and the ast module). I don't know why python-wasi is so much bigger than pyodide, I suspect that it didn't do any treeshaking
Andrea Giammarchi 11/10/2023 20:28
So far it's only the parser, but it already saves 1MB
how big is the whole thing, if I might ask?
Avatar
Avatar
Andrea Giammarchi
So far it's only the parser, but it already saves 1MB
how big is the whole thing, if I might ask?
python-wasi is 26 MB, see the screenshot above. I didn't investigate why it is so much bigger than pyodide: I'm using wasi just because it's easier to build&test, but the same technique should be applicable to pyodide without too much effort
Avatar
Avatar
antocuni
python-wasi is 26 MB, see the screenshot above. I didn't investigate why it is so much bigger than pyodide: I'm using wasi just because it's easier to build&test, but the same technique should be applicable to pyodide without too much effort
Andrea Giammarchi 11/10/2023 20:37
I've missed those two last lines, sorry ... it'd be cool to see on emscripten how things could improve ... but on the other hand, we're pushing so hard for content "on the page" I am not sure where this investigation would lead, although for explicit workers files having a faster bootstrap or bundle to download is surely ace and pre compiled files can easily be served too.
Avatar
what do you mean by "pushing so hard for content on the page"?
Avatar
Avatar
antocuni
what do you mean by "pushing so hard for content on the page"?
Andrea Giammarchi 11/10/2023 20:52
the fact we allow Python on scripts or tags since about ever so that an interpreter is needed
20:53
<py-script> print("content on the page") </py-script>
Avatar
yes sure, in those cases you need the "full" version. My long term plan is to introduce a pyscript build command (to run on your desktop) which takes an HTML page and turns it into an optimized one (e.g. by automatically byte-compiling all the things)
20:55
but this is still a long way
Avatar
Andrea Giammarchi 11/10/2023 20:55
so we're after a <script type="pyc"> ... I see 😄
Avatar
maybe 😅 👼
Avatar
Andrea Giammarchi 11/10/2023 20:56
well, that'd be cool to be honest, out of tooling and just embedded blobs on pages
20:56
or proper files at that point, but that's less portable
Avatar
it might be better to have proper files actually, because they can be binary
20:59
if we embed a pyc in the HTML, we must probably encode it in base64 or something like that, but then it becomes bigger
Avatar
Andrea Giammarchi 11/10/2023 21:02
compression helps there but yeah, if it's out of tooling I think having all things in a pyc/hash-1234.pyc folder and load these instead of having these on the page would be better, so we also should never have issues with PHP headers that encode everything as latin something instead of utf-8 (edited)
👍 1
Avatar
@antocuni this is very cool. Bravo matey.
🙏 1
Avatar
Yesterday & Today BOT 12/10/2023 08:00
📆 12 Oct 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 12/10/2023 14:29
PyTerminal 🧵
Avatar
Yesterday & Today BOT 13/10/2023 08:00
📆 13 Oct 2023: Yesterday & Today 🧵
Avatar
I was the only one in the room to raise my hand 🤣
😂 2
Avatar
Bravo @antocuni
15:52
I hope there wasn't anyone there from VW 😛
Avatar
OK folks... see you in or after Dubai. I'm likely to be AFK for much of next week and keeping (UAE) odd hours.
👋 1
Avatar
Yesterday & Today BOT 16/10/2023 08:00
📆 16 Oct 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 17/10/2023 08:00
📆 17 Oct 2023: Yesterday & Today 🧵
08:01
📆 17 Oct 2023: Yesterday & Today 🧵
Avatar
I'm watching the recording of the last week's PyScript FUN, and I'm laughing loud at @ntoll attempts to pronunce "segno" and "legno" in italian 😂 🇮🇹 🪵 (edited)
Avatar
You're welcome..! 🇮🇹 🇬🇧
Avatar
Andrea Giammarchi 17/10/2023 18:26
@ntoll today I've realized from string import Template throws in MicroPython ... please add this to the list of questions whenever you have some time .. you really missed out on today demos and no, nobody recorded, Hood was in the house too 🥳
Avatar
Ahhh... dang. OK. I'll try to get Damien on a call and we can discuss.
Avatar
Avatar
Andrea Giammarchi
@ntoll today I've realized from string import Template throws in MicroPython ... please add this to the list of questions whenever you have some time .. you really missed out on today demos and no, nobody recorded, Hood was in the house too 🥳
Jeff Glass 18/10/2023 00:49
I had a little extra time this evening - here's a Micropython-compatible version of Template https://github.com/JeffersGlass/mp-templates (edited)
An implementation of CPython's string.Template for Micropython - GitHub - JeffersGlass/mp-templates: An implementation of CPython's string.Template for Micropython
00:50
Or at least the start of one, I don't recall how deep into the internals of Python's Template class your demo got today Andrea
Avatar
Jeff Glass 18/10/2023 01:33
And if you can help fix the issue I just filed, I can give you the code as One Big File so you can just drop it in the src of an mpy tag 😅 https://github.com/pyscript/pyscript/issues/1804
Avatar
Hey hey.... This is a good summary of differences between MicroPython and CPython: https://docs.micropython.org/en/latest/genrst/index.html (apologies if I'm not making sense, I don't have the full context of the convo, but want to share stuff before I head off to today's conference mayhem).
04:57
This is also a good summary of the state of the libs in MicroPython: https://docs.micropython.org/en/latest/library/index.html
04:59
Also, if we create a version of Template for MicroPython, we should send it upstream and help out. Also, the "unix" port of MicroPython is the most "maximalist" version, and may already have a solution we need.
04:59
Finally, I feel we need a catch up with Damien to figure out what's going on, what's needed and where work can be done.
05:00
Anyway... off to the mayhem that is GITEX. 😄
05:01
05:01
Here's a flying car... one of the exhibits.
Avatar
Yesterday & Today BOT 18/10/2023 08:00
📆 18 Oct 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 18/10/2023 10:58
@antocuni @Jeff Glass during yesterday demo I removed the cache and still the result was like there was a cache ... well, I've learned yesterday evening that in Python [1, 2] in list or (1, 2) in list don't check by reference so my counter-cache was producing True even if the tutle was always a new one ... this is super interesting and I believe it helps avoiding duplicated lists of the same kind or with the same value, unless I am completely misunderstanding the feature, but basically the code was fine, the in operator was guarding upfront regrdless.
10:58
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.
11:00
tag`This is ${"some"} ${"value"}!` passes to the tag function a template, which is an immutable array like a tuple in Python, and one or more interpolated values ... as in tag(template, ...interpolations) and most UI libraries using this feature expects that signature to work, as it is for uhtml or lit-html too.
11:01
note the absence of the parenthesis when the tag is meant to be used as such and not as function
Avatar
Yesterday & Today BOT 19/10/2023 08:00
📆 19 Oct 2023: Yesterday & Today 🧵
antocuni started a thread. 19/10/2023 09:14
Avatar
Yesterday & Today BOT 20/10/2023 08:00
📆 20 Oct 2023: Yesterday & Today 🧵
08:02
📆 20 Oct 2023: Yesterday & Today 🧵
Josh (EduBlocks) started a thread. 20/10/2023 12:52
Avatar
Yesterday & Today BOT 23/10/2023 08:00
📆 23 Oct 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 24/10/2023 08:00
📆 24 Oct 2023: Yesterday & Today 🧵
Avatar
OK folks. Next release... RC3. I propose that once we land the work on py-terminal (https://github.com/pyscript/pyscript/pull/1801) we should do a new release of PyScript next, and assuming after a few days of exercising it "in the wild" promote that version to final - et voila, we have finally released PyScript next. Thoughts and feedback in a 🧵 please - and perhaps something to discuss on today's community call..?
Description This MR takes over previous attempt #1771 simplifying a couple of things, improving foreign dependencies import performance and using a standard custom-element. This MR makes the termin...
Avatar
Avatar
ntoll
OK folks. Next release... RC3. I propose that once we land the work on py-terminal (https://github.com/pyscript/pyscript/pull/1801) we should do a new release of PyScript next, and assuming after a few days of exercising it "in the wild" promote that version to final - et voila, we have finally released PyScript next. Thoughts and feedback in a 🧵 please - and perhaps something to discuss on today's community call..?
Andrea Giammarchi 24/10/2023 13:57
to be honest I am a bit lost in comments, ideas, and discussions in there ... should I just rebase it and fix stuff and merge it once approved? If not, what exactly was the agreement there? Right now as soon as there is a <py-terminal> Custom Element stuff works in the terminal ... is this OK or should I actually implement the terminal attribute instead? To me the current terminal works and it doesn't require to "change the world" around polyscript neither plus it's explicit when it runs from a worker and when it doesn't ... should we move forward with it?
Avatar
OK... I hear you @Andrea Giammarchi - there's a LOT of discussion. I propose that we nail this down in today's community call, so everyone is on the same page.
14:02
I rather like the terminal attribute myself (thus avoiding the need for a custom element). But others may disagree, and as you say, the outcome is lost in a forest of comments. I think @Jeff Glass 's terminal attribute suggestion was welcomed. Not sure what the status of a custom element <py-terminal> is.
Avatar
Andrea Giammarchi 24/10/2023 14:12
is it <script type="py" worker terminal> with eventually in the future the async attribute too or it's just terminal with no way to make it work on main?
Avatar
Andrea Giammarchi 24/10/2023 14:22
you know what, this is really something we should discuss today in the community so that it's clear, somehow written down, eventually agreed by the majority, and there's less guessing on how that MR should move forward. Meanwhile, I'll try to align it with current main regardless.
Avatar
Josh (EduBlocks) 24/10/2023 14:26
As a complete aside, but still on topic (and i realise this is a really selfish comment from me, so i apologise) but I think that having no visible error messages (by default and with terminal) when using workers is an issue and slightly confusing. I know this is a pyodide bug, but is there anything we can do to get something working 🙏 (edited)
Avatar
Yeah... so we can discuss in today's community call and I'll write it up onto the relevant GitHub PR as we discuss it so it's there for historical context.
Avatar
@here community meeting has just started.
👍 2
Avatar
Avatar
Josh (EduBlocks)
As a complete aside, but still on topic (and i realise this is a really selfish comment from me, so i apologise) but I think that having no visible error messages (by default and with terminal) when using workers is an issue and slightly confusing. I know this is a pyodide bug, but is there anything we can do to get something working 🙏 (edited)
bugzpodder 24/10/2023 22:20
i've worked around this by try/catch/xworker.sync.onError
Avatar
Avatar
Josh (EduBlocks)
As a complete aside, but still on topic (and i realise this is a really selfish comment from me, so i apologise) but I think that having no visible error messages (by default and with terminal) when using workers is an issue and slightly confusing. I know this is a pyodide bug, but is there anything we can do to get something working 🙏 (edited)
Is there a bug report about this on Pyodide? Can someone locate it for me? I thought there was a bug for it but I'm having trouble finding it.
Avatar
Avatar
hood
Is there a bug report about this on Pyodide? Can someone locate it for me? I thought there was a bug for it but I'm having trouble finding it.
bugzpodder 25/10/2023 01:43
https://github.com/pyodide/pyodide/issues/3938 also some discussions in https://github.com/pyscript/polyscript/issues/15 @Josh (EduBlocks) i found Andrea's proposal for how to handle this alternatively https://github.com/pyscript/polyscript/issues/21#issuecomment-1697830832 (edited)
Avatar
Yesterday & Today BOT 25/10/2023 08:00
📆 25 Oct 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 26/10/2023 08:00
📆 26 Oct 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 27/10/2023 08:00
📆 27 Oct 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 30/10/2023 07:00
📆 30 Oct 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 31/10/2023 07:00
📆 31 Oct 2023: Yesterday & Today 🧵
Avatar
@Jeff Glass Looks like google regenerates the short link when access changes?.... Anyway, here's the new link https://forms.gle/nrKpVBcf5Yo4YFJn8
Access Google Forms with a personal Google account or Google Workspace account (for business use).
Avatar
Avatar
Fabio
@Jeff Glass Looks like google regenerates the short link when access changes?.... Anyway, here's the new link https://forms.gle/nrKpVBcf5Yo4YFJn8
Jeff Glass 31/10/2023 16:19
Still not letting me in, sadly:
Avatar
Hi folks... I'm about to cut a 11.01.RC3 release. I'm following these steps: https://gist.github.com/tedpatrick/d60e4c224b6f2f9a89be8f298ce8c963
Snapshot Releases for PyScript. GitHub Gist: instantly share code, notes, and snippets.
🥳 3
16:22
OK... it's running.
Avatar
Josh (EduBlocks) 31/10/2023 16:24
ahh, playwright and github actions... have fun 😄
16:24
(unless they've made it easier now...)
Avatar
@Andrea Giammarchi any idea..? It's failing on the mpy tests.
Avatar
Josh (EduBlocks) 31/10/2023 16:26
Looks like it's a lot easier than when i last tried, you should just need to add this to the workflow so that it installs a browser to run those tests
👍 1
Avatar
Yeah... I was wondering about that.
Avatar
Jeff Glass 31/10/2023 16:29
Could also use make setup which will do npm install, install Python deps and playwright install
Avatar
Yeah... I was also wondering that too... that's why we have a Makefile. 😉
🐍 1
👆 1
16:30
Description Ensure playwright is installed. Changes To the publish-snapshot.yml action. Checklist All tests pass locally I have updated docs/changelog.md I have created documentation for this(...
16:30
OK... this PR "bodges" the change Josh mentioned. But we should use the Makefile IMHO.
16:30
I.e. this is a temporary sticking plaster to get us a release.
Avatar
Josh (EduBlocks) 31/10/2023 16:31
It's failing to build the main branch too for unstable, unless that's the same workflow
16:31
but yes that should hopefully get you over the line
Avatar
Ahh... that was the py-terminal branch that just landed.
16:32
OK... let's do this properly, rather than quickly.
👍 1
Avatar
Andrea Giammarchi 31/10/2023 16:34
I did, in fact, change recently our GitHub action to install playwright browsers in the folder too ... the elephant in the room is that we have a top level Makefile for tests related to a subfolder, but as I've fixed this before, I am sure this can be fixed in there too
Avatar
Riiiight, but the make setup should just install playwright, right..?
Avatar
Avatar
ntoll
Riiiight, but the make setup should just install playwright, right..?
Andrea Giammarchi 31/10/2023 16:37
no, it install it on the top level folder
16:38
we have mpy tests within the pyscript.core folder too ... playwright doesn't check upper instals, it's weird there ... it doesn't work like npm packages do
Avatar
OK... I'm in a meeting ATM... will take a look at this in 50mins or so. But my understanding is, we can't now use the make setup installation for playwright because "reasons" so the quickest solution is probably to cd pyscript.core && npx playwright install && npm run build
Avatar
Andrea Giammarchi 31/10/2023 16:39
in the long term (or not so long, hopefully) we need to move the playwright install thing only inside pyscript.core and move into that folder the current Python integration
Avatar
Avatar
ntoll
OK... I'm in a meeting ATM... will take a look at this in 50mins or so. But my understanding is, we can't now use the make setup installation for playwright because "reasons" so the quickest solution is probably to cd pyscript.core && npx playwright install && npm run build
Andrea Giammarchi 31/10/2023 16:40
no, the make setup works out of the box
16:40
GitHub Actions work out of the box too ... but you need 2 playwright install at the moment, one is an off-by-one folder.
Avatar
OK... I need to be in this meeting. Will get back to this soon.
Avatar
Andrea Giammarchi 31/10/2023 16:41
for developers and current branches this is not an issue, the release action needed an update, sorry for not thinking about it ... but you need just an extra command, nothing else.
Avatar
OK.... meeting just finished..!
Avatar
@Andrea Giammarchi updated the PR. Once approved I'll merge and release (probably tomorrow now). Thank you..!
Avatar
Andrea Giammarchi 31/10/2023 19:43
approved, sorry for the delay, I forgot my backpack in a pizza place (how Italian of me) and had to run back to see if they stole it ... I am writing from the laptop that was inside my backpack, so there was a happy ending 😅
19:44
after all, it's called after November, so I blame destiny about today late issues 😄 (edited)
Avatar
Yesterday & Today BOT 01/11/2023 07:00
📆 01 Nov 2023: Yesterday & Today 🧵
Avatar
@here the PR fixed the problem with the GitHub action, and the new release can be found here: https://pyscript.net/snapshots/2023.11.1.RC3/
👍 4
cooldoge 3
10:32
@madhurt please make sure the example apps are updated to use this version..! Thank you..! 🚀
👍🏼 1
Avatar
Josh (EduBlocks) 01/11/2023 11:32
looks good! 😄
🤩 3
Avatar
The new examples will live here: https://github.com/pyscript/examples I am gonna push some more soon, right now we have 3 basic ones, inspired from what we had earlier (but more cleaner)
Avatar
Avatar
Jeff Glass
Still not letting me in, sadly:
Sooooo weird. Had to create a new one on my personal Google account. Anyway, how about this? https://forms.gle/XzyarBCfkvJ8ueVv5
By responding to this project you can help us (core maintainers) prioritize the project direction
Avatar
Avatar
madhurt
The new examples will live here: https://github.com/pyscript/examples I am gonna push some more soon, right now we have 3 basic ones, inspired from what we had earlier (but more cleaner)
@madhurt I can help check and cleanup the examples account later today
Avatar
Thanks!
Avatar
Josh (EduBlocks) 01/11/2023 15:30
Where's the best place to report some bugs that I've found with RC3? GitHub Issues?
Avatar
Yes, issues, but maybe prefixed with [RC3]
Avatar
Josh (EduBlocks) 01/11/2023 15:31
got it, thanks!
👍🏼 1
Avatar
Avatar
Fabio
Sooooo weird. Had to create a new one on my personal Google account. Anyway, how about this? https://forms.gle/XzyarBCfkvJ8ueVv5
Jeff Glass 01/11/2023 15:40
It works! Thanks Fabio
🥳 1
Avatar
Avatar
Josh (EduBlocks)
Where's the best place to report some bugs that I've found with RC3? GitHub Issues?
Best way is to not find issues but if you really need to, opening a bug issue in the repo and prefixing it with [2023.11.01_RC3], like Madhur said, is best
Avatar
Josh (EduBlocks) 01/11/2023 16:45
Have opened https://github.com/pyscript/pyscript/issues/1831 It's not a release stopper, but I've found a fix (but probably not the cleanest solution) that seems quick to implement. Wanted to bring it up though 🙂
Checklist I added a descriptive title I searched for other issues and couldn't find a solution or duplication I already searched in Google and didn't find any good information or help What ...
Avatar
@Josh (EduBlocks) nice spot (and suggested fix, I'm sure @Andrea Giammarchi will be on it tomorrow).
💚 1
18:24
Also, RC3 docs PR update: https://github.com/pyscript/docs/pull/39 this looks like a big change, but much of it is because I've split the single page "user guide" into separate (and easier to read) pages. 👍
The PyScript docs are still a work in progress, but this PR makes the following changes to bring it inline with RC3: Bump the version of the docs to RC3 Bump the version in the examples to use RC3...
18:25
And with that... I'm off to Rome for a short holiday... ciao ciao! 🇮🇹
Avatar
Josh (EduBlocks) 01/11/2023 18:44
Have fun! @ntoll
👍 1
Avatar
Yesterday & Today BOT 02/11/2023 07:00
📆 02 Nov 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 03/11/2023 07:00
📆 03 Nov 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 06/11/2023 03:15
@Fabio and I got together on Friday and dug into what the 'py-cell' and 'py-notebook' ideas could look like - what we came up with is now up on a GitHub Discussion: https://github.com/pyscript/pyscript/discussions/1842
@fpliger and I had a great extended talk about the py-cell / py-notebook idea that's been kicking around for awhile - here's a proposal based on what we discussed. Note: This prposal assume...
03:16
We'd love to get that ball rolling and start collecting feedback! Please have a look.
03:16
I tried to keep that proposal focused on key behaviors of both - there are other features (e.g. autogenerate from classic) that we could add as well, but I think we should try to nail down the core behaviors before we layer more features in.
Avatar
Avatar
Jeff Glass
I tried to keep that proposal focused on key behaviors of both - there are other features (e.g. autogenerate from classic) that we could add as well, but I think we should try to nail down the core behaviors before we layer more features in.
Thank you @Jeff Glass !! Superstar!
Avatar
Yesterday & Today BOT 06/11/2023 07:00
📆 06 Nov 2023: Yesterday & Today 🧵
Avatar
Good morning folks! Starting the week active..... What's missing and preventing us from releasing? 🙂
Avatar
Avatar
Fabio
Good morning folks! Starting the week active..... What's missing and preventing us from releasing? 🙂
bugzpodder 06/11/2023 20:32
releasing == final version? it would be nice to check the docs are complete: https://docs.pyscript.net/2023.11.1.RC3/ for example the plugin section and pydom docs are missing some examples are great too. I did try to follow the get started guide and it's really hard for me to paste random snippets. Highly prefer examples you can edit on pyscript.com or elsewhere Also I had a question, if you have multiple worker tags (ie <script type="py" worker>) does it spawn a separate worker per tag? (edited)
20:37
also the new docs site isn't searchable
20:38
and my understanding is that new version is very different from old one? A migration guide would be highly appreciated
Avatar
Avatar
bugzpodder
releasing == final version? it would be nice to check the docs are complete: https://docs.pyscript.net/2023.11.1.RC3/ for example the plugin section and pydom docs are missing some examples are great too. I did try to follow the get started guide and it's really hard for me to paste random snippets. Highly prefer examples you can edit on pyscript.com or elsewhere Also I had a question, if you have multiple worker tags (ie <script type="py" worker>) does it spawn a separate worker per tag? (edited)
Yes. Releasing == final version. The pydom section in the docs has been added and just need to be deployed. +1 on the plugin section, which I think we already have some content in the many READMEs around ( @Andrea Giammarchi would you mind taking care of this tomorrow? ) but the docs are decouple from the release itself so we can also correct after.
Highly prefer examples you can edit on pyscript.com or elsewhere
Yes. +10 . Initially, when I was refactoring the docs I added a link to the same example on pyscript.com but we had to remove to focus on the bigger refactor first. +1 on readding that...
Also I had a question, if you have multiple worker tags (ie <script type="py" worker>) does it spawn a separate worker per tag?
Yes
also the new docs site isn't searchable
what do you mean? You should be able to reach them from https://docs.pyscript.net/ or going to pyscript.net and clicking on "documentation" (or maybe I'm misinterpreting your statement...)
and my understanding is that new version is very different from old one? A migration guide would be highly appreciated
I wouldn' say that, from a user perspective, it's "much different". The surface of PyScript itself is not that wide and we kept backwards compatibility on most thing but, with that said, the Release Blog Post should most definitely mention some of the non compatible things and offer some migration guidance (that, again, should be fairly small). @Jeff Glass on this last topic. Are you still wanting to take the blog post/change log(ish) task? If so, need any help?
(edited)
This PR adds minimal docs for PyDom. This is a starting point and, ideally, I'd like to add support for mkdocs-pyscript and have the examples be interactive so that users can play with it but i...
Avatar
Avatar
Fabio
Yes. Releasing == final version. The pydom section in the docs has been added and just need to be deployed. +1 on the plugin section, which I think we already have some content in the many READMEs around ( @Andrea Giammarchi would you mind taking care of this tomorrow? ) but the docs are decouple from the release itself so we can also correct after.
Highly prefer examples you can edit on pyscript.com or elsewhere
Yes. +10 . Initially, when I was refactoring the docs I added a link to the same example on pyscript.com but we had to remove to focus on the bigger refactor first. +1 on readding that...
Also I had a question, if you have multiple worker tags (ie <script type="py" worker>) does it spawn a separate worker per tag?
Yes
also the new docs site isn't searchable
what do you mean? You should be able to reach them from https://docs.pyscript.net/ or going to pyscript.net and clicking on "documentation" (or maybe I'm misinterpreting your statement...)
and my understanding is that new version is very different from old one? A migration guide would be highly appreciated
I wouldn' say that, from a user perspective, it's "much different". The surface of PyScript itself is not that wide and we kept backwards compatibility on most thing but, with that said, the Release Blog Post should most definitely mention some of the non compatible things and offer some migration guidance (that, again, should be fairly small). @Jeff Glass on this last topic. Are you still wanting to take the blog post/change log(ish) task? If so, need any help?
(edited)
bugzpodder 06/11/2023 21:44
searchable means a global search bar. eg i enter pydom and something shows up that i can navigate to
Avatar
Avatar
bugzpodder
searchable means a global search bar. eg i enter pydom and something shows up that i can navigate to
Jeff Glass 06/11/2023 22:10
I think the built in search plugin for mkdocs material would work well for this: https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/?h=search
Write your documentation in Markdown and create a professional static site in minutes – searchable, customizable, in 60+ languages, for all devices
Avatar
Avatar
bugzpodder
searchable means a global search bar. eg i enter pydom and something shows up that i can navigate to
Ah, yeah. Sorry, totally misread your comment. Makes sense
Avatar
Yesterday & Today BOT 07/11/2023 07:00
📆 07 Nov 2023: Yesterday & Today 🧵
Avatar
@ntoll @Andrea Giammarchi I'm not doing great this morning (old person's back pain misery 😅) so may not be able to attend the full call this morning. Can you guys drive?
Avatar
@here community call just started.
Avatar
Jeff Glass 07/11/2023 21:11
Dropped a tiny PR - our main README.md still says to link to /latest... we can update that to recommend the most recent actual version as soon as we release @ntoll
21:11
Our main README.md on here was still telling folks to use /latest. This PR changes that to specify using https://pyscript.net/releases/2023.11.1/core.js instead. To be merged... right before we rel...
Avatar
Avatar
Jeff Glass
Dropped a tiny PR - our main README.md still says to link to /latest... we can update that to recommend the most recent actual version as soon as we release @ntoll
Approved. Feel free to merge @Jeff Glass ! 🙂
22:51
Where's the docs/changelog.md ? 🧵
Avatar
Yesterday & Today BOT 08/11/2023 07:00
📆 08 Nov 2023: Yesterday & Today 🧵
07:01
📆 08 Nov 2023: Yesterday & Today 🧵
Avatar
OK... just waiting on some playwright related updates to our GH actions to create a release.
Avatar
OK... all the blocking PRs have been approved. Just doing the merge dance... and then I'll release 2023.11.1
Avatar
The new release is on GitHub here: https://github.com/pyscript/pyscript/releases/tag/2023.11.1 - watch all the automated GH actions do their thing here.... 🍿
A whole new world. Thank you to everyone who has contributed to this from-the-ground-up re-build of PyScript. New Contributors @Mr-Sunglasses made their first contribution in #1279 @WebReflection...
🚀 4
❤️ 2
13:45
Aaaaaaand.... it's alive!!!! https://pyscript.net/releases/2023.11.1/
13:45
@Jeff Glass give me a kick when/if you want to chat and coordinate about release notes / blog post. 👍
13:46
Bravo to everyone @here who helped make this happen. Special mention to @Andrea Giammarchi who rebuilt the universe. Onwards...! 🎉 🚀
Avatar
Josh (EduBlocks) 08/11/2023 13:47
Congrats to everyone involved, this is such a great release!! 🚀
❤️ 1
Avatar
Avatar
ntoll
Bravo to everyone @here who helped make this happen. Special mention to @Andrea Giammarchi who rebuilt the universe. Onwards...! 🎉 🚀
Andrea Giammarchi 08/11/2023 13:48
team effort 👍
Avatar
I get errors with 2023.11.1 🧵
Avatar
Jeff Glass 08/11/2023 14:51
Congrats all! @ntoll thanks for being the de-facto release manager on this one, and wrangling all the PRs and GitHub actions pieces 🤩
👆 1
👍 1
Avatar
@ntoll just noticed. I thought we agreed yesterday (during the team call) that we'd merge a change to show an error in the page if users were usint /latest . That PR wasn't merged before the release.... I don't think it's a big deal but it is a missed opportunity 😦
Avatar
@Fabio I thought it was..! 😕
16:19
Where's the PR for that, please..?
Avatar
Avatar
ntoll
Where's the PR for that, please..?
Description This PR adds a deprecation manager plugin that checks if scripts are being loaded from pyscript.net/latest and adds a notification to the page Changes Adds plugins/deprecation-manager ...
Avatar
Avatar
ntoll
Where's the PR for that, please..?
I also put another PR yesterday to remove when as we agreed
Avatar
OK... looks like we'll be releasing 2023.11.2 tomorrow. 🤦
16:23
I'm so sorry about this. I thought these had been reviewed and merged (clearly they hadn't). I'm definitely responsible for this oversight.
Avatar
no need to be worried, this is a very good way of testing our ability to release with agility 🙂
💨 1
Avatar
Yeah... that's what I'm telling myself.
16:29
It should be an "everyday" occurance, IYSWIM
Avatar
Jeff Glass 08/11/2023 16:43
Alrighty, the release blog post is now live: https://jeff.glass/post/whats-new-pyscript-2023-11-1/
🥳 1
16:49
As always, please let me know what I missed or goofed 😅
Avatar
Avatar
Jeff Glass
Alrighty, the release blog post is now live: https://jeff.glass/post/whats-new-pyscript-2023-11-1/
Josh (EduBlocks) 08/11/2023 16:58
Just finish reading, excellent work as always on this!
😊 1
antocuni started a thread. 08/11/2023 17:02
Avatar
Avatar
Josh (EduBlocks)
Just finish reading, excellent work as always on this!
Jeff Glass 08/11/2023 17:27
Thanks Josh!
Avatar
Avatar
antocuni
no need to be worried, this is a very good way of testing our ability to release with agility 🙂
We can wait a couple of days too... no big deal Also, can I point out that 💨 is very distracting since it looks like a fart emoji?
Avatar
Avatar
Fabio
We can wait a couple of days too... no big deal Also, can I point out that 💨 is very distracting since it looks like a fart emoji?
Jeff Glass 08/11/2023 17:36
It doesn't make you think of Agility and Speed and Rapid Development?
17:36
But now that you've said it... I can't unsee it
🤣 3
😂 1
Avatar
Heads up. I'll be posting the announcements later today
Avatar
Yesterday & Today BOT 09/11/2023 07:00
📆 09 Nov 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 10/11/2023 07:00
📆 10 Nov 2023: Yesterday & Today 🧵
Avatar
FYI, I just force merged https://github.com/pyscript/docs/pull/47 because the links to the release were wrong in the docs . I know we should avoid this but I didn't want the issue to blow while we all sleep or enjoy the weekend. It closes https://github.com/pyscript/pyscript/issues/1854 and https://github.com/pyscript/pyscript/issues/1855 🍻
Checklist I added a descriptive title I searched for other issues and couldn't find a solution or duplication I already searched in Google and didn't find any good information or help What ...
Checklist I added a descriptive title I searched for other issues and couldn't find a solution or duplication I already searched in Google and didn't find any good information or help What ...
Avatar
Avatar
Fabio
FYI, I just force merged https://github.com/pyscript/docs/pull/47 because the links to the release were wrong in the docs . I know we should avoid this but I didn't want the issue to blow while we all sleep or enjoy the weekend. It closes https://github.com/pyscript/pyscript/issues/1854 and https://github.com/pyscript/pyscript/issues/1855 🍻
related to PR 47, I think that it's "wrong" that we put RC under /snapshots and non-RC under /releases. They should all go under /releases
👍 1
👆 1
Avatar
Jeff Glass 11/11/2023 14:48
Thanks @Fabio! Think that was a good call.
👍 1
Avatar
Yesterday & Today BOT 13/11/2023 07:00
📆 13 Nov 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 14/11/2023 07:00
📆 14 Nov 2023: Yesterday & Today 🧵
Avatar
Is there any public page where we advertise our community calls so that people can find them and join? I couldn't find any
Avatar
There's a public calendar for sure, but Fabio might be the best one to ask this
Avatar
Avatar
madhurt
There's a public calendar for sure, but Fabio might be the best one to ask this
yes, I think the public calendar is owned by me, even. But if I want to invite someone and say "hey, come to the community call", I don't know where to point them to
Avatar
@madhurt @Andrea Giammarchi just added a quick draft of the Plugins section in our docs. Can you guys check it out, verify if it actually makes sense (I'm really running, it's late and I probably made a ton of mistakes 🙂 ) and add anything I'm missing? Andrea, can you also check the actual hooks? I did a quick copy of some of the Polyscript hooks but didn't fully verify the diffs... https://github.com/pyscript/docs/pull/48
Avatar
Avatar
Fabio
@madhurt @Andrea Giammarchi just added a quick draft of the Plugins section in our docs. Can you guys check it out, verify if it actually makes sense (I'm really running, it's late and I probably made a ton of mistakes 🙂 ) and add anything I'm missing? Andrea, can you also check the actual hooks? I did a quick copy of some of the Polyscript hooks but didn't fully verify the diffs... https://github.com/pyscript/docs/pull/48
bugzpodder 15/11/2023 05:42
where does import { hooks } from "<path_to_pyscript>/core.js"; come from? I looked at existing docs also did a github search and there are no such example that shows me how I get path_to_pyscript. Also it's unclear to me, is it only part of javascript modules? I would prefer something as close to working code as possible. (edited)
Avatar
Yesterday & Today BOT 15/11/2023 07:00
📆 15 Nov 2023: Yesterday & Today 🧵
Avatar
Avatar
bugzpodder
where does import { hooks } from "<path_to_pyscript>/core.js"; come from? I looked at existing docs also did a github search and there are no such example that shows me how I get path_to_pyscript. Also it's unclear to me, is it only part of javascript modules? I would prefer something as close to working code as possible. (edited)
Andrea Giammarchi 15/11/2023 09:03
core is a module so if you have: <script type="module" src="//cdn/@pyscript/core"> in your page, you can just refactor that as: <script type="module"> import { hooks } from "//cdn/@pyscript/core"; </script> that's it?
Avatar
Andrea Giammarchi 15/11/2023 10:30
late re-thinking your question ... but I wrote indeed a comment in the MR as I don't really like that path neither ... we should provide the right CDN in every example indeed
Avatar
Avatar
antocuni
Is there any public page where we advertise our community calls so that people can find them and join? I couldn't find any
Answering myself here: I created a PR to update the README and mention the community calls: https://github.com/pyscript/pyscript/pull/1858
Avatar
Avatar
bugzpodder
where does import { hooks } from "<path_to_pyscript>/core.js"; come from? I looked at existing docs also did a github search and there are no such example that shows me how I get path_to_pyscript. Also it's unclear to me, is it only part of javascript modules? I would prefer something as close to working code as possible. (edited)
fixed it in the PR
Avatar
Yesterday & Today BOT 16/11/2023 07:00
📆 16 Nov 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 17/11/2023 07:00
📆 17 Nov 2023: Yesterday & Today 🧵
07:01
📆 17 Nov 2023: Yesterday & Today 🧵
Avatar
Hey hey, PyData Global sprints (remote conference) are happening. Who is interested in helping to run a PyScript one? I've never done it remotely but it sounds like a good idea. I'm happy to support but we need >=3 people to support participants
Avatar
Avatar
Fabio
Hey hey, PyData Global sprints (remote conference) are happening. Who is interested in helping to run a PyScript one? I've never done it remotely but it sounds like a good idea. I'm happy to support but we need >=3 people to support participants
Jeff Glass 17/11/2023 17:22
Do you have more info on dates/times?
Avatar
Avatar
Jeff Glass
Do you have more info on dates/times?
Doh 🤦 Sorry. ~ Dec 6-8, 2023 PyData Global Sprints CFP : https://forms.gle/mwfasfnXvkV1ykjo6 Conference website: https://pydata.org/global2023 Here's their sprint guide notes: https://hackmd.io/lkkx0XCcQb2tZd_wO23WYw (edited)
If you're interested in organizing a sprint for an open source project that you are actively maintaining, please apply. Complete the registration with PyData organizers with the following information. Please email global@pydata.org with a Google Doc: Preferred time including duration. Project description including project logo to be used in t...
Avatar
Happy Friday Folks! 😉
💚 3
💜 3
🥳 3
Avatar
Yesterday & Today BOT 20/11/2023 07:00
📆 20 Nov 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 21/11/2023 07:00
📆 21 Nov 2023: Yesterday & Today 🧵
07:01
📆 21 Nov 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 22/11/2023 07:00
📆 22 Nov 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 23/11/2023 07:00
📆 23 Nov 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 24/11/2023 07:00
📆 24 Nov 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 24/11/2023 15:13
JS Module Interoperability 🧵
Avatar
Yesterday & Today BOT 27/11/2023 07:00
📆 27 Nov 2023: Yesterday & Today 🧵
Avatar
Avatar
Fabio
Doh 🤦 Sorry. ~ Dec 6-8, 2023 PyData Global Sprints CFP : https://forms.gle/mwfasfnXvkV1ykjo6 Conference website: https://pydata.org/global2023 Here's their sprint guide notes: https://hackmd.io/lkkx0XCcQb2tZd_wO23WYw (edited)
@Jeff Glass @ntoll @Andrea Giammarchi what do you say? Folks just pinged me and I need to give an answer soon. I'm down but we need more than 1 😉
Avatar
Avatar
Fabio
@Jeff Glass @ntoll @Andrea Giammarchi what do you say? Folks just pinged me and I need to give an answer soon. I'm down but we need more than 1 😉
I should be good to help out.
17:31
But on UK time (I have a concert and school parents' evening on a couple of the evenings of those dates).
👍 1
Avatar
Avatar
Fabio
@Jeff Glass @ntoll @Andrea Giammarchi what do you say? Folks just pinged me and I need to give an answer soon. I'm down but we need more than 1 😉
Jeff Glass 27/11/2023 17:32
Dec 6-8 are gonna be a little bonkers for me... I'd love to pop in where I can, but unfortunately I can't promise I'll be available, esp during US daytimes 😬
Avatar
Avatar
Jeff Glass
Dec 6-8 are gonna be a little bonkers for me... I'd love to pop in where I can, but unfortunately I can't promise I'll be available, esp during US daytimes 😬
No worries. No pressure at all. Mostly trying to understand the general availability to 👍 or 👎
Avatar
Yesterday & Today BOT 28/11/2023 07:00
📆 28 Nov 2023: Yesterday & Today 🧵
Avatar
Avatar
Fabio
No worries. No pressure at all. Mostly trying to understand the general availability to 👍 or 👎
Andrea Giammarchi 28/11/2023 10:09
I am actually off those days and in Sweden ... I should've sent detailed planned vacations already, my bad!
Avatar
Avatar
Andrea Giammarchi
I am actually off those days and in Sweden ... I should've sent detailed planned vacations already, my bad!
No worries. I'll check with the organizers to see if it's something we can handle in just 2 core devs (me and @ntoll ), assuming we find a decent time overlap, and report back
👍 1
Avatar
Yesterday & Today BOT 29/11/2023 07:00
📆 29 Nov 2023: Yesterday & Today 🧵
Avatar
Hi Folks... here's a (will be short lived) Zoom link to watch me cut the next release of PyScript. https://anaconda.zoom.us/j/95838323514?pwd=by9Oc2srMVVvbXZ2bHB4RkFlcVFydz09 This won't take very long... I'll also record it and share when I get access to the YouTube account.
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solution used around the world in board, conference, huddle, and training rooms, as well as ex...
12:46
I'll give it 5mins before I cut the release. It should all be done within about 2 mins. 😄
12:50
OK... starting to cut the next release...
12:56
Done. Latest release of PyScript can be found here: https://pyscript.net/releases/2023.11.2/ 🎉
🚀 4
Avatar
Avatar
ntoll
Done. Latest release of PyScript can be found here: https://pyscript.net/releases/2023.11.2/ 🎉
Jeff Glass 29/11/2023 22:00
And to go with it, a release post! Not too too much to say about big feature adds, so I focused on the deprecation (and soon removal) of /latest as an interesting topic https://jeff.glass/post/whats-new-pyscript-2023-11-2/
What's new and what's changed in PyScript 2023.11.2
🥳 1
Avatar
We also have migrated a lot of previous examples, compatible with the new release, they are present here: https://pyscript.com/@examples (more coming soon) (edited)
👍 1
🤩 1
Avatar
Yesterday & Today BOT 30/11/2023 07:00
📆 30 Nov 2023: Yesterday & Today 🧵
Avatar
Avatar
Jeff Glass
And to go with it, a release post! Not too too much to say about big feature adds, so I focused on the deprecation (and soon removal) of /latest as an interesting topic https://jeff.glass/post/whats-new-pyscript-2023-11-2/
As always @Jeff Glass thank you so much for writing this up. For those who are interested, here's the Zoom video of me pressing buttons to make the actual release: https://anaconda.zoom.us/rec/share/Pb4Z73WALD36VyY_EIt-cIYfuq3NutJbw56Xnm3SDbMUOOwxuwNJY8f_z1Q7VHJT.pMHcH72W-8EOG-JJ Passcode: Wb1O3=4z
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solution used around the world in board, conference, huddle, and training rooms, as well as ex...
ntoll started a thread. 30/11/2023 12:20
Avatar
Yesterday & Today BOT 01/12/2023 07:00
📆 01 Dec 2023: Yesterday & Today 🧵
07:01
📆 01 Dec 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 01/12/2023 15:40
PyEditor is out of draft and here you can see a screenshot: https://github.com/pyscript/pyscript/pull/1860#issuecomment-1836321250 /cc @Jeff Glass
Description This MR is mostly a rip-off of @JeffersGlass work https://github.com/JeffersGlass/mkdocs-pyscript/blob/main/mkdocs_pyscript/js/makeblocks.js but it does things in a slightly different w...
🎉 1
Avatar
Avatar
Andrea Giammarchi
PyEditor is out of draft and here you can see a screenshot: https://github.com/pyscript/pyscript/pull/1860#issuecomment-1836321250 /cc @Jeff Glass
Jeff Glass 01/12/2023 15:44
Awesome! Will take time to actually review, but initial reaction - I like the solution you found to showing the env, very clean and will be helpful
🙏 1
Avatar
Yesterday & Today BOT 04/12/2023 07:00
📆 04 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 05/12/2023 07:00
📆 05 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 06/12/2023 07:00
📆 06 Dec 2023: Yesterday & Today 🧵
Avatar
A PR to fix a few things with our README over on GitHub - please review. 👍 https://github.com/pyscript/pyscript/pull/1889
Description Fix broken links, and put community information at the top of our READE Changes Fix broken links to our official docs and examples. Move the sections on community engagement to the top...
👏 1
Avatar
Yesterday & Today BOT 07/12/2023 07:00
📆 07 Dec 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 07/12/2023 12:43
so ... following our developers guide we end up with this warning in console: [notice] A new release of pip is available: 23.2.1 -> 23.3.1
Avatar
Yeah... pip is always updating. This is a regular occurance in Python. 😕
Avatar
Avatar
ntoll
Yeah... pip is always updating. This is a regular occurance in Python. 😕
Andrea Giammarchi 07/12/2023 13:02
the moment I do that, everything breaks, I didn't get a chance to finish this
Avatar
IIRC you need to type something like: python -m pip install --upgrade pip To upgrade pip in your venv.
Avatar
Andrea Giammarchi 07/12/2023 13:03
the moment I do, it breaks everything!
Avatar
Hmm... in what way (error messages?)
13:03
It should just work ™️
Avatar
Andrea Giammarchi 07/12/2023 13:04
let me open a proper thread ... I got interrupted by random people asking me to quick call and stuff 😛 🤣
Avatar
Unless the PyPA have broken pip again
13:04
🤣
Avatar
Avatar
ntoll
It should just work ™️
Andrea Giammarchi 07/12/2023 13:04
it doesn't ... and ... don't do that!
13:05
Developer Guide 🧵
Avatar
Discussion about shared envs in differnt PyScript contexts here: https://github.com/pyscript/pyscript/discussions/1893 (Based upon earlier video call with @Andrea Giammarchi in which we explored these ideas). Please contribute to the discussion!
Jotting these ideas down after @WebReflection and I had a chat where such ideas were proposed and initially explored. Our conclusion: ask folks for feedback for future refinement or rejection of th...
Avatar
Draft docs updates for 2023.12.1 release: https://github.com/pyscript/docs/pull/52 (should not be merged until the release is out).
DO NOT MERGE UNTIL 2023.12.1 IS RELEASED Fixes broken links. Updates docs to reflect changes from older versions. Bump version to 2023.12.1 Revise terminal documentation. Add Python editor documen...
Avatar
Jeff Glass 07/12/2023 16:46
@ntoll @madhurt@Fabio @Andrea Giammarchi I'm sure I've just lost the thread on this... I'm putting a note in the release post about the examples folder being removed from the main repo. I'd like to add a note like "To see current examples, go to _______". What should I put there these days?
Avatar
pyscript.com/@examples
❤️ 1
16:48
And github.com/pyscript/examples
💚 1
Avatar
Avatar
Jeff Glass
@ntoll @madhurt@Fabio @Andrea Giammarchi I'm sure I've just lost the thread on this... I'm putting a note in the release post about the examples folder being removed from the main repo. I'd like to add a note like "To see current examples, go to _______". What should I put there these days?
What @madhurt said 🙂 I'd also add a note encouraging folks to copy and play with the examples now that it's very easy to do so...
Avatar
Avatar
ntoll
Draft docs updates for 2023.12.1 release: https://github.com/pyscript/docs/pull/52 (should not be merged until the release is out).
Heads up: pyscript.com has been updated so that new projects will use 2023.12.1 🙂
🥳 4
🎉 3
Avatar
Hurrah..! 🎉
Avatar
Yesterday & Today BOT 08/12/2023 07:00
📆 08 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 11/12/2023 07:00
📆 11 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 12/12/2023 07:00
📆 12 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 13/12/2023 07:00
📆 13 Dec 2023: Yesterday & Today 🧵
Avatar
@ntoll @Andrea Giammarchi , I've been working on camera support in pydom/pyweb and wanted to have it shipped in the next release on Friday but, while it works, I'd like to talk/discuss the API. One option is to release as is and not document it (to actually have people try it and give feedback) and the other is to not merge and not release it at all in the next release. I'd tend to do the former... I'll put the PR up for review later but we can align later today
👍 1
👀 1
Avatar
I prefer to release early and refine based on feedback. I guess we just need to flag it as a tech-preview and WiP (please give feedback!).
Avatar
Avatar
ntoll
I prefer to release early and refine based on feedback. I guess we just need to flag it as a tech-preview and WiP (please give feedback!).
Yeah, exactly. Cool. Are you still wanting to add the audio side of it?
Avatar
We'd need to compare notes first.
20:08
But the audio WiP is here: https://pyscript.com/@ntoll/tuftytunes/latest It uses JS under the hood with the Python code wrapping things.
Avatar
Avatar
ntoll
We'd need to compare notes first.
Awesome... Let me put my build on an example on pyscript.com
Avatar
Here: https://pyscript.com/@fpliger/square-breeze/ Don't pay too much attention at the 1000000s files (think there's some bug with the CLI). Focus on the main.py that is really the whole code for the app. Looking forward for feedback on the pydom and pyweb.media APIs.!
👀 1
Avatar
Avatar
ntoll
But the audio WiP is here: https://pyscript.com/@ntoll/tuftytunes/latest It uses JS under the hood with the Python code wrapping things.
Josh (EduBlocks) 13/12/2023 22:10
Very cool! Audio seems like a great eduvlocks extension candidate
Avatar
Avatar
Josh (EduBlocks)
Very cool! Audio seems like a great eduvlocks extension candidate
Really like the interface. Simple and clean
Avatar
Yesterday & Today BOT 14/12/2023 07:00
📆 14 Dec 2023: Yesterday & Today 🧵
Avatar
So the thing we need to refine and perhaps turn into a "pattern" is how we use JavaScript and expose it to Python. I think there are lots of strengths to this way of doing things:
  • JS modules just load and don't need to wait on the Python interpreter to be ready.
  • There's no hit of having to use the FFI as a broker between JS/Python during the actual work... only when we're calling functions or getting results.
  • JS modules work the same way for MicroPython AND Pyodide.
  • We get the benefit of web yoda advice. 😉
Avatar
However, during the writing of the audio API I notice differences in behaviour between MicroPython and Pyodide - which I have to take account of in the JS. For instance, in JavaScript, the MediaRecorder object's onstop is called before we call Python's await rec.audio() if we're using Pyodide. Yet this isn't the case in MicroPython... hence I had to add an event listener for stop in the promise returned by result.audio which resolves when (if using MicroPython) the stop event is dispatched. This feels smelly, and is one of the more esoteric things I want to chat about with Damien, so Pyodide and MicroPython don't work so differently in this respect.
Avatar
Yesterday & Today BOT 15/12/2023 07:00
📆 15 Dec 2023: Yesterday & Today 🧵
07:01
📆 15 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 18/12/2023 07:00
📆 18 Dec 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 18/12/2023 16:41
to whom it might concern, my early PyScript Xmas card has been published as stand-alone repository that shows how to import any JS module and use it in the py VS mpy world right now, hoping you can also have fun implementing your own Xmas card to deliver https://github.com/WebReflection/pyscript-xmas-2023?tab=readme-ov-file#pyscript-xmas-card
The PyScript Xmas card demo for 2023. Contribute to WebReflection/pyscript-xmas-2023 development by creating an account on GitHub.
🔥 1
Avatar
Yesterday & Today BOT 19/12/2023 07:00
📆 19 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 20/12/2023 07:00
📆 20 Dec 2023: Yesterday & Today 🧵
Avatar
Jeff Glass 20/12/2023 15:26
Hi y’all! I’m back from vacation and getting caught up. Saw some info in the community call last week about a release last week, I’m guessing we’ve punted on that? No worries either way, just figuring out how fast I need to write a post 😅
Avatar
Andrea Giammarchi 20/12/2023 18:07
This works ... but I need some Pythonic eyes to tell me this is fine too: https://github.com/pyscript/pyscript/pull/1902/files#diff-e61ee60583a47fe78f86c8331fd3705bd6cb3ea62f1e5b9519dad2a0d0ddc0ee ... it's about importing in PyScript same way one can import from Polyscript, except is done through Python code, not JS or JS related APIs. Thank you!
Description This MR fixes #1899 by registering a fake pyscript.js_modules within the stdlib so that both imports are valid: from pyscript import js_modules js_modules.xxx from pyscript.js_modules ...
18:08
if @Jeff Glass or @antocuni or @madhurt or whiever is still around could review that'd be awesome for the next release!
Avatar
Yesterday & Today BOT 21/12/2023 07:00
📆 21 Dec 2023: Yesterday & Today 🧵
07:01
📆 21 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 22/12/2023 07:00
📆 22 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 25/12/2023 07:00
📆 25 Dec 2023: Yesterday & Today 🧵
07:01
📆 25 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 26/12/2023 07:00
📆 26 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 27/12/2023 07:00
📆 27 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 28/12/2023 07:00
📆 28 Dec 2023: Yesterday & Today 🧵
07:01
📆 28 Dec 2023: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 29/12/2023 07:00
📆 29 Dec 2023: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 29/12/2023 20:26
Marry Xmas Yesterday & Today bot, and have a lovely NYE too 🥳
🎉 1
🤣 2
Avatar
Jeff Glass 29/12/2023 21:32
Perhaps we let this nice bot go on Sabatical in the new year 😅
👍 1
Avatar
Yesterday & Today BOT 01/01/2024 07:00
📆 01 Jan 2024: Yesterday & Today 🧵
07:01
📆 01 Jan 2024: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 02/01/2024 07:00
📆 02 Jan 2024: Yesterday & Today 🧵
Avatar
Community call starting in 5 mins here: https://anaconda.zoom.us/j/97901874828
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solution used around the world in board, conference, huddle, and training rooms, as well as ex...
Avatar
Yesterday & Today BOT 03/01/2024 07:00
📆 03 Jan 2024: Yesterday & Today 🧵
07:02
📆 03 Jan 2024: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 03/01/2024 16:18
How about a release ? 🧵
Avatar
Yesterday & Today BOT 04/01/2024 07:00
📆 04 Jan 2024: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 05/01/2024 07:00
📆 05 Jan 2024: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 08/01/2024 07:00
📆 08 Jan 2024: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 08/01/2024 10:45
Hey @Jeff Glass I hope you'll find some time (nothing urgnt though) to answer this https://github.com/JeffersGlass/mp-templates/issues/2
I had some issue in trying to use the packages = ["..."] feature with any of the files in this repository. A package.json seems to be missing too, so I ended up using the combined.mpy fil...
Avatar
@ntoll are we are doing the Community Call tomorrow on Zoom or Discord? I recall us saying to hold on the community call until we said "the process works".... but never explicitly talked about this week
Avatar
@Fabio that's exactly it. We'll have the community call in the usual place tomorrow, and assuming folks are happy (and my impression is they mostly are), then we'll migrate to discord. But final decision is tomorrow's meeting on Zoom in the usual place.
👍 2
Avatar
Yesterday & Today BOT 09/01/2024 07:00
📆 09 Jan 2024: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 09/01/2024 18:12
discussion around the currently imperfect, or broken, document.currentScript behavior: https://github.com/pyscript/pyscript/discussions/1930
While working on this issue I've noticed various problems regarding the current magic mokey-patching of the document.currentScript accessor: 3rd party scripts that might check, need, or use, su...
18:12
@Jeff Glass pinging you too in here, if you find time to read that
Avatar
Avatar
Andrea Giammarchi
@Jeff Glass pinging you too in here, if you find time to read that
Jeff Glass 09/01/2024 18:56
Thanks! Will hope to get to that (and the note you left on Micropython+Template) soon... we're gearing up to move homes, so time's a bit cramped 😅
😮 1
Avatar
Yesterday & Today BOT 10/01/2024 07:00
📆 10 Jan 2024: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 11/01/2024 07:00
📆 11 Jan 2024: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 11/01/2024 13:23
Jeff mentioned this already, I think this bot is only causing doom scrolling for all of us ... can we maybe get rid of it?
13:25
I mean, for whoever is curious, you can track me, Jeff, other contributors on GitHub activities already. We (bringing others also complaining before) don't feel like this is adding any value to this specific channel. Maybe, we should have a channel a part instead of having these constant updates in the core channel? Just thinking out loudly /cc @ntoll @Fabio
Avatar
Agreed. I looked into removing it, but I don't have perms to do so. 😕 @Fabio or perhaps @tedpatrick ???
14:22
Yeah, it was added by @tedpatrick and I don't have permissions to remove it from this server. However, I've been able to switch it off from this channel (I think?). Let's see what happens tomorrow. 👍
Avatar
Andrea Giammarchi 11/01/2024 15:18
to me it's just that these bots might only augment the FOMO feeling, out of a core channel, as opposite of providing any value to the team or even team's managers, or just members/followers. (edited)
15:19
not everyone in here is a maintainer neither, and I am not sure why they would ever care about these half-backed stand-ups, imho.
15:20
I mean ... I was joking not joking in here ... I had something to read in core, and it was nothing useful for my day: https://discord.com/channels/972017612454232116/1024755729820811334/1190390297490903200
🥳 1
Avatar
Jeff Glass 11/01/2024 15:21
Fingers crossed that@ntoll's got it switched off!
🤞 1
Avatar
Yesterday & Today BOT 12/01/2024 07:00
📆 12 Jan 2024: Yesterday & Today 🧵
Avatar
Dammit
10:41
Apparently this is @tedpatrick 's baby - I've reached out to him so I can have admin privs over the bot.
Avatar
Avatar
Andrea Giammarchi
I mean, for whoever is curious, you can track me, Jeff, other contributors on GitHub activities already. We (bringing others also complaining before) don't feel like this is adding any value to this specific channel. Maybe, we should have a channel a part instead of having these constant updates in the core channel? Just thinking out loudly /cc @ntoll @Fabio
+1 on killing it
Avatar
Yesterday & Today BOT 15/01/2024 07:00
📆 15 Jan 2024: Yesterday & Today 🧵
Avatar
Andrea Giammarchi 15/01/2024 08:35
I think Ted said we should be able to take over his admins rights form his anaconda account he no longer uses or has access to.
Avatar
Yes, we should. But how..? 😄
🤔 1
Avatar
Andrea Giammarchi 15/01/2024 14:44
@ntoll unrelated ... all our examples in the PyScript basic guide miss the style in the head ... I think that's mandatory to avoid surprises around py-config or mpy-config showed on the page when used + other things that are fixed via CSS.
Avatar
Ack. Lemme fix that.
Avatar
Yesterday & Today BOT 16/01/2024 07:00
📆 16 Jan 2024: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 17/01/2024 07:00
📆 17 Jan 2024: Yesterday & Today 🧵
Avatar
Yesterday & Today BOT 18/01/2024 07:00
📆 18 Jan 2024: Yesterday & Today 🧵
Avatar
OK... I just (finally) got admin privs and killed off the "Yesterday & Today" bot. 😉
🎉 1
🥳 1
Avatar
Andrea Giammarchi 18/01/2024 13:04
we'll celebrate tomorrow, eventually 🤣
Avatar
Andrea Giammarchi 19/01/2024 09:06
Farewell Yesterday & Today bot 👋
Avatar
Hurrah! I can confirm it was a painless and compassionate euthenasia. 😄
Avatar
Andrea Giammarchi 22/01/2024 13:08
the __terminal__ landed in here as discussed with both @Jeff Glass and @ntoll https://github.com/pyscript/pyscript/pull/1947 ... if it's green and approved and merged, I am confident we could release today or tomorrow.
Description This MR fixes in a more robust and elegant way #1923 by providing a "dunder terminal" reference out of the box that points at the currently running Xterm instance and as discu...
13:15
... and BTW, the contract now is one terminal per page ... I think during our conversation at some point we mentioned multiple terminals via multiple workers ... I think with pyodide only that's not a super interesting use case but if you think the time is right, I could sneak in multiple terminals only when the script has a worker attribute, and still throw an error if multiple main terminals are used. I am not sure for this release we want to rush this but ... hey ... it was worth mentioning the current state.
Avatar
👋 so multiple terminals were basically for technical docs (on the understanding that each terminal is its own environment).
👍 1
Avatar
Jeff Glass 22/01/2024 13:43
+1 What @ntoll said - I would use multiple terminals on given page, each in its own worker/env, to demo multiple features or examples.
Avatar
Andrea Giammarchi 22/01/2024 13:53
I think we should have an MR a part though ... as that's an "unbreaking change" that is not strictly related to the __terminal__ discussion ... but it needs __terminal__ in first.
13:54
the one terminal per page though, has always been the case, even in classic ... so the "now" I wrote referred to the "as it's always been" ... in case it was needed to clarify this part.
13:57
so ... @Jeff Glass and @ntoll would you be OK with a different issue for the multiple worker terminal situation?
13:57
current MR is green and it can (imho, should) land on main.
13:58
but of course ... it needs an approval ... 😅
Avatar
👍 LGTM them we can refine to multiple (independent) terminals
Avatar
Jeff Glass 22/01/2024 15:13
Agreed! A separate and new idea - thanks for getting __terminal__ together (edited)
Avatar
Andrea Giammarchi 23/01/2024 17:37
FWIW this meeting should be forwarded, once live and published, to the discussion we're having via email around create_proxy because I think it might be interesting for either Hood or Damien. It shows my earlier examples in practice, thanks! /cc @ntoll (edited)
Avatar
Andrea Giammarchi 24/01/2024 16:13
we have multiple PyTerminal with workers now 🥳 https://github.com/pyscript/pyscript/pull/1948 /cc @ntoll @Jeff Glass
Description As discussed with both @ntoll and @JeffersGlass, we'd love to be able to have multiple terminals on a page through worker attribute, as these are all fresh-new bootstrapped interpre...
🥳 1
Avatar
Yup... just seen it. 😉
16:13
Bravo (as always) @Andrea Giammarchi
Avatar
Andrea Giammarchi 24/01/2024 16:14
it's a joy to sse it working!
Avatar
Just. Need. MicroPython. 🙂
👍 1
Avatar
Andrea Giammarchi 24/01/2024 16:17
that's true but what's funny is that because of how workers work, I basically don't see any exponential bootstrap time ... they both do bootstrap almost exactly at the same time and such time is the equivalent of a regular worker or main bootstrap ... pretty cool indeed!
16:18
worth saying that of course, as soon as one terminal has plugins or a different config and/or the amount of CPUs is exhausted, we might see a delayed bootstrap aftert X terminals on the page ... also RAM might be a concern but ... hey ...
Avatar
Definitely. It feels like stuff is all heading in the right direction.
16:19
Right... but eventually if you run DOOM inside thousands of windows, you'll run out of power/memory. 🙂
Avatar
Andrea Giammarchi 24/01/2024 16:20
you also need to be an octopus crossed with a spider to make that ever useful too 😁
Avatar
Cthulhu?
Avatar
Andrea Giammarchi 24/01/2024 16:21
yeah, Cthulhu might be able to enjoy that experience
16:22
oh look ... it's all green 🥳
🎉 1
Avatar
Andrea Giammarchi 24/01/2024 16:34
it's in, and published on npm for early tests and whatnot 👍
🎉 2
16:36
if anyone would like to play around latest status here the test file used for both smoke-test and integration tests https://github.com/pyscript/pyscript/blob/main/pyscript.core/test/py-terminals.html
16:37
update to latest main, npm run server then reach http://localhost:8080/test/py-terminals.html and hack away 🥳
16:37
(maybe you need an npm run build before being able to see it)
Avatar
FYI, I've started working on fixing pydom and cleaning all the current mess. Got it working (at least somehow 😄 ) with micropython (both pydom and the when decorator) but there's a ton to do still. Initial work here https://github.com/pyscript/pyscript/pull/1954 .
Description This PR turns pydom and related features (for instance the when decorator) compatible with MicroPython Changes tbd Checklist All tests pass locally I have updated CHANGELOG.md I ha...
🎉 1
Avatar
Andrea Giammarchi 26/01/2024 10:05
should this go in polyscript? https://github.com/pyscript/polyscript/pull/79 my only concern is to make the flag explictly experimental so instead of create_proxy = "auto" in the TOML it would be experimental_create_proxy = "auto" ... is anyone against that? It does nothing if such flag is not enabled, it changes A LOT if it is.
Background Pyodide requires create_proxy not only for event listeners but also for any JS API that might use a callback that is not instantly invoked: GeoLocation watchPosition and others anything...
Avatar
@Fabio @antocuni @Jeff Glass ^^^
Avatar
I'm supportive of us trying that route as experimental as you are suggesting @Andrea Giammarchi . I think the benefits are prettu clear.... Now... there are some concerns for instance, like @antocuni mentioned earlier this week, this could create a code portability problem but I thnk it's a good bet right now
Avatar
I'm writing a detailed emails with my findings right now 🙂
Avatar
There you go 😄
Avatar
I suppose I should include also Jeff in the conversation
👍 1
🤗 1
Avatar
In the meantime... @Andrea Giammarchi @ntoll , can I get a solid here? https://github.com/pyscript/pyscript/pull/1901
Description This PR adds initial support for interacting with media devices. It allows interfacing audio or video devices based on the selectors supported by the related JS api. Changes Adds a medi...
Avatar
Avatar
antocuni
I'm writing a detailed emails with my findings right now 🙂
done 🙂
Avatar
Avatar
Fabio
In the meantime... @Andrea Giammarchi @ntoll , can I get a solid here? https://github.com/pyscript/pyscript/pull/1901
Apologies - was pairing with @Martin
👍 1
Avatar
Avatar
ntoll
Apologies - was pairing with @Martin
You are good!
Avatar
You should see the amazeballs work we did.
17:12
The Invent framework is coming alive.
Avatar
Avatar
antocuni
done 🙂
Andrea Giammarchi 26/01/2024 17:16
... aaaand answered ...
17:16
to me the question "should this go in as experimental feature that changes nothing unless enabled and with pyodide only?" has been answered by that email: yes is my conclusion.
💯 2
Avatar
Andrea Giammarchi 06/02/2024 11:18
to whom it might concern I've tried to demo down a SharedArrayBuffer polyfill but the conclusion is that: it's not possible to polyfill. When it comes to the sync worker -> main dance though, I would like to explore a ServiceWorker based approach but to me it looks like that might create even more issues or confusion or bloat (with less guarantees) compared to just setting headers or use mini-coi and, about latest, I am thinking, as we suggest mini-coi already in our docs, to make it both an utility and a CLI binary so that npx mini-coi ./ would start a server that does what npx static-handler --coi ./ does now, maybe helping further users and developers to have one module that does it all for testing purposes ... thoughts?
Avatar
Avatar
Andrea Giammarchi
to whom it might concern I've tried to demo down a SharedArrayBuffer polyfill but the conclusion is that: it's not possible to polyfill. When it comes to the sync worker -> main dance though, I would like to explore a ServiceWorker based approach but to me it looks like that might create even more issues or confusion or bloat (with less guarantees) compared to just setting headers or use mini-coi and, about latest, I am thinking, as we suggest mini-coi already in our docs, to make it both an utility and a CLI binary so that npx mini-coi ./ would start a server that does what npx static-handler --coi ./ does now, maybe helping further users and developers to have one module that does it all for testing purposes ... thoughts?
Josh (EduBlocks) 06/02/2024 13:19
Well I’m very grateful that you tried!
Avatar
Andrea Giammarchi 06/02/2024 13:48
I am sad I haven't tried harder enough but the fact the SW is needed regardless makes me wonder if I should really spend a lot of time there as tons of new issues might arise ... that being said, at least I've had an easier life to make mini-coi a binary / CLI utility too so that it's much easier to bootstrap a local env that allows SharedArrayBuffer, as well as it's much easier to explain how to copy mini-coi.js Service Worker in any folder: https://github.com/WebReflection/mini-coi#readme
A minimalistic version of coi-serviceworker. Contribute to WebReflection/mini-coi development by creating an account on GitHub.
Avatar
Josh (EduBlocks) 22/02/2024 11:16
@Andrea Giammarchi good morning (or afternoon!), wondering if you knew any solutions to this problem. When I have an error on line 1 of main.py, it says the error is on line 33. My guess is that because we have codeBeforeRun hooks in pyscript core and it's counting those lines too? Is there a flag or anything that I can do/enable so that the reported line numbers are correct? https://pyscript.com/@joshualowe1002/error-line-numbers/latest
Avatar
Avatar
Josh (EduBlocks)
@Andrea Giammarchi good morning (or afternoon!), wondering if you knew any solutions to this problem. When I have an error on line 1 of main.py, it says the error is on line 33. My guess is that because we have codeBeforeRun hooks in pyscript core and it's counting those lines too? Is there a flag or anything that I can do/enable so that the reported line numbers are correct? https://pyscript.com/@joshualowe1002/error-line-numbers/latest
Andrea Giammarchi 22/02/2024 14:05
https://github.com/pyscript/polyscript/pull/81 ... we need a release /cc @ntoll
In issue pyscript/pyscript#1972 it's been brought up that line errors when code gets executed are off by the amount of hooks around. Specially when it comes to before running sync or async inte...
Avatar
Happy to release. Any highlights to put in the release notes..?
Avatar
Josh (EduBlocks) 22/02/2024 14:11
Perfect! Of course you already had it sorted 🙂 thank you @Andrea Giammarchi! 🎉
❤️ 1
14:12
(and swapping to latest from npm fixes it on my example)
Avatar
Avatar
ntoll
Happy to release. Any highlights to put in the release notes..?
Andrea Giammarchi 22/02/2024 14:12
In more than one occasion we've been loud about ESM support and a way to load both the module and the related WASM file from the very same npm published module. As things never went the way we ...
Description This MR brings in latest polyscript after this change landed in there: pyscript/polyscript#81 This MR fixes #1972 by executing users' code in a separate evaluation/invoke from the i...
Description This MR is a follow up integration of pyscript/polyscript#80 Beside fixing the exported JS' PyWorker, which was fully broken and not smoke-tested properly, these changes allow the u...
Description This MR fixes #1974 by explicitly setting utf-8 as text encoding. Please ignore TypeScript entries as these were a leftover from another version and should not affect the project at all...
Avatar
Hahaha... perfect Josh..! You've just been "Andrea"-ed 😛
😂 1
14:13
@Andrea Giammarchi Thank you!
👍 1
Avatar
Andrea Giammarchi 22/02/2024 14:14
there are other minor changes but these are all internal so not worth a release note, imho.
👍 1
Avatar
Release notes: Removed Ruby support due issues with mainstream way to publish the module: pyscript/polyscript#83 Improved error reporting line to report correct line with or without our prepended ...
Avatar
Avatar
ntoll
@Andrea Giammarchi Thank you!
Andrea Giammarchi 22/02/2024 14:15
btw, the Ruby thing is rather polyscript but as that's inevitably available when importing PyScript too maybe we should mention it, but not as top thing to be aware of?
Avatar
It'll be fine.
14:16
😉
14:16
I've mentioned it's in the polyscript layer.
Avatar
Andrea Giammarchi 22/02/2024 14:17
excelent, you have my axe 🪓
Avatar
Andrea Giammarchi 22/02/2024 14:17
please do remember, if not automated yet, to update the docs too 😉
🤦 1
Avatar
Josh (EduBlocks) 22/02/2024 14:18
Thank you for the release! I’ll get on with updating EduBlocks 🎉
Avatar
OK... gimme 15mins for the docs (in the middle of something)
Avatar
@Andrea Giammarchi ^^^
✅ 1
15:24
Thank you. done
Avatar
@here PyScript fun about to start
Avatar
Jeff Glass 30/03/2024 23:46
I'm finally trying to catch up on all the missed released posts. @Andrea Giammarchi question for you when you're back online - if I understand right, #1967 is supposed to allow the use of workers even when SharedArrayBuffer is not available. Does this only apply to workers created with PyWorker/MPyWorker? Using the worker attribute on a pyscript tag without the right CORS headers still throws up on me about SharedArrayBuffer not being available in an insecure environment. EDIT: OH! I missed that adding the sync_main_only = True param to the config was necessary. Please disregard. (edited)
👍 1
Avatar
Jeff Glass 31/03/2024 21:02
The release megapost is (just about) ready to release! Here's a pre-release draft version for your perusal: https://dev.jeff.glass/whats-new-pyscript-2024-q1/index.html I've just finished writing it all and am heading to Easter dinner - I haven't given any thought yet to re-arranging/organizing the sections, which should probably move around some. If y'all have time to glance through and tell me what I've missed or messed up, I'm hoping to put this out publically on Wednesday monring Chicago time. 🤗
What's new and what's changed in PyScript in the first part of 2024
Avatar
Avatar
Jeff Glass
I'm finally trying to catch up on all the missed released posts. @Andrea Giammarchi question for you when you're back online - if I understand right, #1967 is supposed to allow the use of workers even when SharedArrayBuffer is not available. Does this only apply to workers created with PyWorker/MPyWorker? Using the worker attribute on a pyscript tag without the right CORS headers still throws up on me about SharedArrayBuffer not being available in an insecure environment. EDIT: OH! I missed that adding the sync_main_only = True param to the config was necessary. Please disregard. (edited)
Andrea Giammarchi 02/04/2024 09:01
I will read that post ASAP but sync_main_only was a requirement for these use cases:
  • it's not possible to modify backend headers and the mini-coi either doesn't work or it's not super welcome (due other SW or reasons ...)
  • you delegate to the worker tasks, not vice-versa ... the SAB (SharedArrayBuffer) is needed from the Worker to interact seamlessly with the main thread, but even with SAB, the main thread must always use await when it calls sync operations from the worker ... accordingly, if you expose utilities form the worker and you await these on the main, SAB is not needed, you add that flag to the config, and you can delegate to the worker anything you like.
Avatar
Avatar
Jeff Glass
The release megapost is (just about) ready to release! Here's a pre-release draft version for your perusal: https://dev.jeff.glass/whats-new-pyscript-2024-q1/index.html I've just finished writing it all and am heading to Easter dinner - I haven't given any thought yet to re-arranging/organizing the sections, which should probably move around some. If y'all have time to glance through and tell me what I've missed or messed up, I'm hoping to put this out publically on Wednesday monring Chicago time. 🤗
Andrea Giammarchi 02/04/2024 09:28
I did read it ... too bad the pyscript module in the py-editor didn't make it for the release, it's a bit weird as that was already merged by the time we released but it's not in ... about the rest, only a few points from my side:
  • the sync_main_only removes the ability from the worker to run DOM APIs (and others from main) synchronously ... I need to double check though if that means nothing can be used, but I think your example and message is clear
  • I would still use the official URL to grab PyScript from the CDN ... that has pinned versions and is way more stable than that npm direct package ... so instead of this https://cdn.jsdelivr.net/npm/@pyscript/core@0.4.11/+esm I would suggest using the https://pyscript.net/releases/2024.3.2/core.js one
  • the fetch example is spot-on but I would add the following:
  • MicroPython doesn't have (yet?) asyncio so in general it's always preferable to use async attribute within the script if top-level await is desired
  • the current API allows you to forward the response result so that you could also do: await pyscript.fetch("https://reqres.in/api/users/2").text() directly, which fails if the response was not ok (not in the 200-299 range)
  • the example is cool but it returns .json() which is not mentioned ... the fetch API returns proper Python dictionaries when .json() is used, instead of JS proxies ...
  • on top of JSON, we have .bytearray() which returns a Python result too ... as a matter of fact, all fetch methods in PyScript namespace return Pythonic references instead of JS proxies ... I think that might be interesting/important to mention
Last, but not least, thanks again and thanks a lot for this awesome summary 🥰
(edited)
Avatar
Avatar
Andrea Giammarchi
I did read it ... too bad the pyscript module in the py-editor didn't make it for the release, it's a bit weird as that was already merged by the time we released but it's not in ... about the rest, only a few points from my side:
  • the sync_main_only removes the ability from the worker to run DOM APIs (and others from main) synchronously ... I need to double check though if that means nothing can be used, but I think your example and message is clear
  • I would still use the official URL to grab PyScript from the CDN ... that has pinned versions and is way more stable than that npm direct package ... so instead of this https://cdn.jsdelivr.net/npm/@pyscript/core@0.4.11/+esm I would suggest using the https://pyscript.net/releases/2024.3.2/core.js one
  • the fetch example is spot-on but I would add the following:
  • MicroPython doesn't have (yet?) asyncio so in general it's always preferable to use async attribute within the script if top-level await is desired
  • the current API allows you to forward the response result so that you could also do: await pyscript.fetch("https://reqres.in/api/users/2").text() directly, which fails if the response was not ok (not in the 200-299 range)
  • the example is cool but it returns .json() which is not mentioned ... the fetch API returns proper Python dictionaries when .json() is used, instead of JS proxies ...
  • on top of JSON, we have .bytearray() which returns a Python result too ... as a matter of fact, all fetch methods in PyScript namespace return Pythonic references instead of JS proxies ... I think that might be interesting/important to mention
Last, but not least, thanks again and thanks a lot for this awesome summary 🥰
(edited)
Jeff Glass 02/04/2024 21:10
Thanks Andrea! I've incorporated all those very helpful notes into the post. That'll go live tomorrow morning, assuming all goes well. 😁
Avatar
Andrea Giammarchi 03/04/2024 13:42
the MicroPython terminal is landing with both main and worker capabilities ... it's a REPL, it just takes 10x less time to bootstrap than the Pyodide one 🥳
🚀 1
Avatar
Andrea Giammarchi 03/04/2024 13:50
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>MicroPython Terminal</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@pyscript/core@0.4.12/dist/core.css"> <script type="module" src="https://cdn.jsdelivr.net/npm/@pyscript/core@0.4.12/dist/core.js"></script> <style>.xterm { padding: .5rem; }</style> </head> <body> <script type="mpy" worker terminal> import code code.interact() </script> </body> </html> it's been already published to npm so it's possible to try it already. This version fixes lazy terminal (or runtime) initialization and allows MicroPython too.
13:53
please remember for the worker attribute to work properly, as the input is mandatory/needed in here, you need to enable COOP and headers to allow SharedArrayBuffer. npx mini-coi ./ would do ... save that code as index.html in any folder you like, go into that folder and run that command ... you should be in a REPL like this one:
🥳 3
Avatar
Andrea Giammarchi 03/04/2024 15:22
uhm ... and btw, CTRL-A and others don't work, but I don't think it's my fault, rather readline package not understanding, or forwarding, those 😅 (edited)
😅 1
Avatar
Jeff Glass 03/04/2024 15:46
I was gonna ask if those worked! Probably something we'd want to either hide from the user or figure out how to patch/upstream, I guess
15:53
live on coincident mini-coi based GitHub space
15:54
works on my iPhone too 🎉
👀 1
❤️ 1
Avatar
That's awesome!!!
17:40
In the meantime, @Andrea Giammarchi , I had some time to look into https://github.com/pyscript/pyscript/pull/1960/ and what's blocking it. Basicaly, elements.py seems to really make MicroPython unhappy (triggers a memory access out of bounds exception). Think this is probably upstream..
Description This is a POC PR exploring a UI creation API on top of pydom Changes added pyweb.ui package added demo example added gallery example with real apps examples added docs added tes...
Avatar
Avatar
Fabio
In the meantime, @Andrea Giammarchi , I had some time to look into https://github.com/pyscript/pyscript/pull/1960/ and what's blocking it. Basicaly, elements.py seems to really make MicroPython unhappy (triggers a memory access out of bounds exception). Think this is probably upstream..
Andrea Giammarchi 11/04/2024 16:38
I'll try to reproduce on Monday, apologies first time I've got a notification about this
Avatar
@ntoll @Andrea Giammarchi just a heads up for coordination.... @chris.laffra and I met this morning to start migrating ltk to the pyscript github org.
🚀 1
🤩 1
Avatar
Avatar
Fabio
In the meantime, @Andrea Giammarchi , I had some time to look into https://github.com/pyscript/pyscript/pull/1960/ and what's blocking it. Basicaly, elements.py seems to really make MicroPython unhappy (triggers a memory access out of bounds exception). Think this is probably upstream..
Andrea Giammarchi 15/04/2024 14:38
OK, found the culprit ... yes, it's a MicroPython issue with too big content to run 😥
❤️ 1
Avatar
Avatar
Andrea Giammarchi
OK, found the culprit ... yes, it's a MicroPython issue with too big content to run 😥
Too big content (as in too much code?)
14:55
Damien tells me this shouldn't be a problem, although he wanted a reproducable exmple so he could test. Perhaps this is it?
Avatar
Avatar
ntoll
Damien tells me this shouldn't be a problem, although he wanted a reproducable exmple so he could test. Perhaps this is it?
Andrea Giammarchi 15/04/2024 14:58
Checks I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone. I've searched for existing issues matching this bug, and didn't find any. Port, ...
❤️ 1
Avatar
Bravo!
Avatar
Andrea Giammarchi 15/04/2024 15:00
that code is passed as runPython, not as vFS content to parse ... maybe this is the difference Damien wasn't thinking about. It's generated out of @Fabio branch and as soon as I drop one file there everything is fine. It might as well be a path issue but I always get just memory out of bound so I can reproduce that every single time. The file we run as code is attached.
Avatar
Perfect. He'll find that very useful.
15:00
(Damien I mean)
Avatar
Avatar
ntoll
Perfect. He'll find that very useful.
Andrea Giammarchi 15/04/2024 15:11
I've added an easy to save and run test case https://github.com/micropython/micropython/issues/14307#issuecomment-2056958691 ... it's super weird because even just commenting that big line MicroPython bails out ... it really needs to be removed. This is weird but surely fixable, imho.
Checks I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone. I've searched for existing issues matching this bug, and didn't find any. Port, ...
Avatar
Andrea Giammarchi 15/04/2024 15:19
@ntoll @Fabio gotta be honest ... I think a workaround would be to actually create a .zip folder of our stdlib and produce a base64 based artifact that would unpack in the FS the whole content, as opposite of manually creating a huge string with all our current and future stdlib in there as single runPython command. However, this not only would need quite some time to be implemented, it won't solve the underlying issue that MicroPython runPython (and I believe runPythonAsync too) is incapable of handling biggfer inputs so I'd rather go to fix that and think about improvements later on. After all, our files behind the CDN get already compressed, and compressing the compression feels off to me.
Avatar
Avatar
Andrea Giammarchi
@ntoll @Fabio gotta be honest ... I think a workaround would be to actually create a .zip folder of our stdlib and produce a base64 based artifact that would unpack in the FS the whole content, as opposite of manually creating a huge string with all our current and future stdlib in there as single runPython command. However, this not only would need quite some time to be implemented, it won't solve the underlying issue that MicroPython runPython (and I believe runPythonAsync too) is incapable of handling biggfer inputs so I'd rather go to fix that and think about improvements later on. After all, our files behind the CDN get already compressed, and compressing the compression feels off to me.
Andrea Giammarchi 15/04/2024 15:22
last, but not least, as I think it's not common practice, I was super surprised by finding out that nothing in npm is able, from JS, to minify Python and all Python minifiers for Python itself look abandoned or not super reliable for what I could find out there. That could be another alternative but it feels like it might open more issues due criptic errors on the Python side too, as source maps can't really work out of the box in Python in the way these work on JS. (edited)
Avatar
@Andrea Giammarchi minifying Python is an interesting problem. @chrislaffra has done some interesting work in this direction. But I agree with you, in the first instance it feels like it should be something Damien could fix in upstream MicroPython, and your issue is a welcome way to reproduce the problem.
Avatar
Avatar
ntoll
@Andrea Giammarchi minifying Python is an interesting problem. @chrislaffra has done some interesting work in this direction. But I agree with you, in the first instance it feels like it should be something Damien could fix in upstream MicroPython, and your issue is a welcome way to reproduce the problem.
Andrea Giammarchi 15/04/2024 17:03
agreed and interested in Chris' work there ... my goal was to actually unlock the PyDOM (or PyWeb) work Fabio is doing but also I start wondering if Chris' project is now part of PyScript, shouldn't we actually ditch PyWeb / PyDom and promote that work instead? I would find it a bit confusing we have our own library that doesn't offer everything Chris' one does and still consider LTK part of the project ... I'd rather have LTK backed in, now that would be cool if it works on both runtimes!
👍 1
Avatar
@chrislaffra ^^^ @Fabio ^^^
Avatar
Would love feedback on this proposal: https://github.com/pyscript/pyscript/discussions/2031
Related to #1987 - we should add a consistent and well supported Pythonic means of using web sockets to the pyscript namespace. As with our approach to fetch, we should try to come up with an unopi...
Avatar
Hi folks, next week we want to work on our docs. You're ALL invited to submit issues, proposals and ideas via https://github.com/pyscript/docs/issues so we can work together to make our docs as helpful, well written and compassionate as possible. Thank you!
Contribute to pyscript/docs development by creating an account on GitHub.
Avatar
Andrea Giammarchi 07/05/2024 08:54
PyScript 0.4.31 has been published on npm featuring latest MicroPython which works now with iterables JS instances (i.e. File.new([blob])) so it's possible to create downloads from the virtual FS too ... plus other fixes landed these days ... please feel free to test it via https://cdn.jsdelivr.net/npm/@pyscript/core@0.4.31/dist/core.js and https://cdn.jsdelivr.net/npm/@pyscript/core@0.4.31/dist/core.css respective JS and CSS urls, thank you!
👍 1
🔥 1
Avatar
Andrea Giammarchi 07/05/2024 09:27
also worth mentioning latest MicroPython should have asyncio native support now.
Avatar
@here A WHOPPER of a brand new version of PyScript 2024.5.1 has just landed. Details here: https://pyscript.net/releases/2024.5.1/ Release notes here: https://github.com/pyscript/pyscript/releases/tag/2024.5.1 and pretty much a complete docs rewrite here: https://docs.pyscript.net/2024.5.1/ 🚀 Note the docs has search enabled, url fixes in place, plenty more examples in code, and many pages have been completely re-written, simplified and corrected. Call out to @Andrea Giammarchi for such amazing work in this respect.
Release notes / changes: Added lazy_py_modules to allow users to lazily import packages within their code, rather than needing to pre-fetch all of them via config packages entry. E.g.: from pyscri...
🚀 1
🔥 1
Avatar
Jeff Glass 12/05/2024 22:14
Would love another set of eyes on this: it seems py-editor is always showing an error in the new release (2024.5.1): https://github.com/pyscript/pyscript/issues/2056
Avatar
@Jeff Glass good spot. This has been fixed and we've added tests to ensure it doesn't happen again. 😉 We're going to cut a new release so it's all fixed for PyCon. By the time you wake up and read this, it'll probably already be out.
Avatar
@Jeff Glass all fixed. 🎉 See the announcement about the latest release in #chat etc...
❤️ 1
Avatar
Avatar
ntoll
@Jeff Glass good spot. This has been fixed and we've added tests to ensure it doesn't happen again. 😉 We're going to cut a new release so it's all fixed for PyCon. By the time you wake up and read this, it'll probably already be out.
Jeff Glass 13/05/2024 12:39
What a treat to wake up to! Thanks for the quick fix y’all.
Avatar
Service with a smile. 😉
Avatar
Hey folks! I'm going over my slides for the updates at the WASM Summit tomorrow and want to make sure I cover/mention anything that you all consider important. So, please lmk the things you consider the most important improvements/updates over the past year, pain points we should focus on as a community (broader community here, not necessarily PyScript only) and anything else you consider important topics we should do mention. We'll probably all overlap a lot but I want to make sure I speak for all of us and not just from my personal perspective
Avatar
@Andrea Giammarchi @ntoll https://github.com/pyscript/pyscript/pull/1960 is finally ready and adds pyweb.ui.elements . I'll add a couple of quick PRs to change and bring pyweb.ui.elements to pyweb.elements and avoid too deep nesting. There are also a couple of small improvements in the interface that I'll land tomorrow as well. Rest will be adding docs.
Description This is a POC PR exploring a UI creation API on top of pydom Changes added pyweb.ui package added demo example added gallery example with real apps examples added docs added tes...
👍 1
Avatar
Avatar
Fabio
@Andrea Giammarchi @ntoll https://github.com/pyscript/pyscript/pull/1960 is finally ready and adds pyweb.ui.elements . I'll add a couple of quick PRs to change and bring pyweb.ui.elements to pyweb.elements and avoid too deep nesting. There are also a couple of small improvements in the interface that I'll land tomorrow as well. Rest will be adding docs.
Andrea Giammarchi 04/06/2024 09:12
two minor comments, rather questions, but it looks good to me.
Avatar
@Fabio yeah, just minor aides-memoire for me as comments. Otherwise... shipit!
🍻 3
Avatar
@ntoll @Andrea Giammarchi @Jeff Glass @FabioRosado @Martin @chris.laffra Just a heads up. During the community engagement call, we decided to actually start an initiative to record short videos for the community (how to.... type of videos) and that the maintainers (actually active ones 🙂 ) should be reviewers, with at least one approval needed for publishing. Just wanted to give a heads up and check if there are any objections
👍 6
🎉 3
❤️ 1
Avatar
No objections at all... we totally need this.
Avatar
Andrea Giammarchi 05/06/2024 22:31
same here, sounds like a good idea
Avatar
Andrea Giammarchi 31/03/2025 15:37
to whom it might concern ... there are issues I need to solve, mostly around pyscript.web tests and latest media but I've fixed much more and this is the current state when SharedArrayBuffer is enabled: https://youtu.be/jz7CX8xgRNA
❤️ 1
15:39
if you don't have 2 minutes + to waste, the TL;DR is that there are still gotchas and I haven't fully optimized the library, I just introduced 1 step Atomics VS 2 ways and Pyodide time went down from ~12 seconds to ~7 ... if we consider Pyodide takes ~2 seconds to bootstrap anyway, that's 50% of the time to do the same.
🙌 1
❤️ 1
15:39
I will hopefully showcase more tomorrow but I think it's great I have numbers I can compare and see that this effort was kinda worth it ... imho
❤️ 1
Exported 3,313 message(s)
Timezone: UTC+0