-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Begin making pyscript.py into a Python package #1232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -213,7 +213,8 @@ export class PyScriptApp { | |||
logger.info('importing pyscript'); | |||
|
|||
// Save and load pyscript.py from FS | |||
interpreter.interface.FS.writeFile('pyscript.py', pyscript, { encoding: 'utf8' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writeFile
does not take an option called encoding
.
40da6b1
to
d0d5237
Compare
We're getting a bunch of test failing and shouldn't approve this one yet :) I think Hood is still working on it |
Okay now it's passing. Please merge @FabioRosado. I will open a followup which uses rollup to inject all files in the pyscript directory (currently only the |
Sounds good merged, on the follow up can you add an entry in the changelog.md in the docs folder? 😄 |
Okay, will do. Thanks! |
Followup to pyscript#1232. Closes pyscript#1226. Use node to make a manifest of the src/python dir and then use terser to inject it into the bundle as a variable called pyscript_package. This means we need to always use the terser plugin even when not minifying. In the non-minify case, we disable terser minification and mangling and enable terser beautification. Note that we bundle mangled versions of many upstream npm dependencies, so even in debug/nonminified builds, these do not include symbol names.
Followup to pyscript#1232. Closes pyscript#1226. Use node to make a manifest of the src/python dir and then use terser to inject it into the bundle as a variable called pyscript_package. This means we need to always use the terser plugin even when not minifying. In the non-minify case, we disable terser minification and mangling and enable terser beautification. Note that we bundle mangled versions of many upstream npm dependencies, so even in debug/nonminified builds, these do not include symbol names.
Followup to pyscript#1232. Closes pyscript#1226. Use node to make a manifest of the src/python dir and then use an esbuild plugin to resolve an import called `pyscript_python_package.esbuild_injected.json` to an object indicating the directories and files in the package folder. This object is then used to govern runtime installation of the package.
Followup to pyscript#1232. Closes pyscript#1226. Use node to make a manifest of the src/python dir and then use an esbuild plugin to resolve an import called `pyscript_python_package.esbuild_injected.json` to an object indicating the directories and files in the package folder. This object is then used to govern runtime installation of the package.
Followup to pyscript#1232. Closes pyscript#1226. Use node to make a manifest of the src/python dir and then use an esbuild plugin to resolve an import called `pyscript_python_package.esbuild_injected.json` to an object indicating the directories and files in the package folder. This object is then used to govern runtime installation of the package.
Followup to #1232. Closes #1226. Use node to make a manifest of the src/python dir and then use an esbuild plugin to resolve an import called `pyscript_python_package.esbuild_injected.json` to an object indicating the directories and files in the package folder. This object is then used to govern runtime installation of the package.
This doesn't quite do the full job because we also need to make sure that the rest of the files in the new pyscript folder also get included. Will do this in a followup.