Begin making pyscript.py into a Python package#1232
Merged
Conversation
hoodmane
commented
Feb 27, 2023
| logger.info('importing pyscript'); | ||
|
|
||
| // Save and load pyscript.py from FS | ||
| interpreter.interface.FS.writeFile('pyscript.py', pyscript, { encoding: 'utf8' }); |
Contributor
Author
There was a problem hiding this comment.
writeFile does not take an option called encoding.
FabioRosado
approved these changes
Feb 27, 2023
40da6b1 to
d0d5237
Compare
Contributor
|
We're getting a bunch of test failing and shouldn't approve this one yet :) I think Hood is still working on it |
Contributor
Author
|
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 |
Contributor
|
Sounds good merged, on the follow up can you add an entry in the changelog.md in the docs folder? 😄 |
Contributor
Author
|
Okay, will do. Thanks! |
hoodmane
added a commit
to hoodmane/pyscript
that referenced
this pull request
Mar 8, 2023
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.
hoodmane
added a commit
to hoodmane/pyscript
that referenced
this pull request
Mar 8, 2023
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.
hoodmane
added a commit
to hoodmane/pyscript
that referenced
this pull request
Mar 25, 2023
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.
hoodmane
added a commit
to hoodmane/pyscript
that referenced
this pull request
Mar 25, 2023
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.
1 task
hoodmane
added a commit
to hoodmane/pyscript
that referenced
this pull request
Mar 27, 2023
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.
hoodmane
added a commit
that referenced
this pull request
Mar 29, 2023
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.