Release Testing 2023.05.1 - RC1 #1489
Replies: 6 comments 6 replies
-
tried pyscript.min.js, lgtm |
Beta Was this translation helpful? Give feedback.
-
Works perfectly well on my side: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PyScript</title>
<link rel="stylesheet" href="https://pyscript.net/snapshots/2023.05.1.RC1/pyscript.css"/>
<script defer src="https://pyscript.net/snapshots/2023.05.1.RC1/pyscript.js"></script>
</head>
<body>
<div>Viper max: <span id="manual-write"></span></div>
<py-config type="toml">
packages = [
"pandas"
]
</py-config>
<py-script>
import js
import pandas as pd
js.console.log( "Console: 2023.05.1.RC1" )
js.document.title = "The PyScript version: 2023.05.1.RC1"
print( "Volla says: 2023.05.1.RC1" )
sep = "-" * 40
print( pd.show_versions() )
print(sep)
df = pd.DataFrame([[1, 2], [4, 5], [7, 8]],
index=['cobra', 'viper', 'sidewinder'],
columns=['max_speed', 'shield'])
print(df)
print(sep)
print(df.iloc[2])
print(sep)
viper_max_speed = df.loc['viper', 'max_speed']
manual_div = Element("manual-write")
manual_div.element.innerHTML = viper_max_speed
</py-script>
</body>
</html> |
Beta Was this translation helpful? Give feedback.
-
py-* attributes that execute async python functions are no longer awaited. <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PyScript</title>
<link rel="stylesheet" href="https://pyscript.net/snapshots/2023.05.1.RC1/pyscript.css"/>
<script defer src="https://pyscript.net/snapshots/2023.05.1.RC1/pyscript.js"></script>
</head>
<body>
<button id="py-button-to-click" py-click="hello()" type="button">Click Me!</button>
<py-script>
import js
import asyncio
async def hello():
js.console.log("Hello")
</py-script>
</body>
</html> Running the above and clicking the button will result in the following error.
Adding await to the call results in a await outside of async function error. The solution that I have found to work is to wrap the function call in asyncio.create_task(), like so. <button id="py-button-to-click" py-click="asyncio.create_task(hello())" type="button">Click Me!</button> This results in the expected execution of the async hello function. |
Beta Was this translation helpful? Give feedback.
-
pyscript.runtime.globals.get('foo') syntax no longer works to execute python code from the javascript enviroment <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PyScript</title>
<link rel="stylesheet" href="https://pyscript.net/snapshots/2023.05.1.RC1/pyscript.css"/>
<script defer src="https://pyscript.net/snapshots/2023.05.1.RC1/pyscript.js"></script>
</head>
<body>
<py-script>
async def foo(data):
print("Data")
</py-script>
<button onclick="pyscript.runtime.globals.get('foo')('Hello, world!')">Hello world?</button>
</body>
</html> running the previous code in the RC results in the following error.
In the previous versions this resulted in expected execution of the python function. |
Beta Was this translation helpful? Give feedback.
-
@tedpatrick I would like to have @JeffersGlass MR part of the release, if Jeff is confident in merging it, as the work done in there is pretty awesome and it feels that it could sleep for long just for a couple of days / delay. Thanks for considering this, I'd be OK if it's too late too though, hoping next release with that in would be sooner than later. |
Beta Was this translation helpful? Give feedback.
-
PyScript 2023.05.1.RC2 #1498 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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
Thank you for your ongoing support and contribution to PyScript.
2023.05.1.RC1 Example:
Beta Was this translation helpful? Give feedback.
All reactions