8000 Allow pyscript package to contain multiple files by hoodmane · Pull Request #1309 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

Allow pyscript package to contain multiple files #1309

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

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

hoodmane
Copy link
Contributor

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.

Checklist

  • All tests pass locally

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
Copy link
Contributor Author

@WebReflection @antocuni would appreciate if you could review this one.

@antocuni
Copy link
Contributor

I'm confused. This PR adds the ability of having multiple files in src/python/pyscript/, but it doesn't actually use this ability and all the code still lives in __init__.py?

@hoodmane
Copy link
Contributor Author

Yes. My thought was to split up __init__.py in a followup. I can open another PR on top of this that splits it up into several files. Then if the tests pass on that branch it shows that this works.

Copy link
Contributor
@antocuni antocuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, got it.
Technically speaking, this PR lacks a test because we don't know whether a package with multiple files actually works, but I'm fine waiting until the follow up PR to discover :)

@hoodmane
Copy link
Contributor Author

Thanks for the review!

@hoodmane hoodmane merged commit 26f0724 into pyscript:main Mar 29, 2023
@hoodmane hoodmane deleted the pyscript-package-3 branch March 29, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make pyscript.py into a Python package
2 participants
0