Skip to content
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

Fix #1997 - Bring pyscript stdlib to the PyEditor #2010

Merged
merged 4 commits into from Mar 28, 2024

Conversation

WebReflection
Copy link
Contributor

@WebReflection WebReflection commented Mar 27, 2024

Description

Fixes #1997


This MR should fully solve this discussion #1997 by providing, from core itself, our stdlib within the PyEditor custom type (both py-editor and mpy-editor).

All concerns are likely premature as users never had a chance to use our module in there, so this is a starting point that still will require some documentation update.

Changes

  • use a codeBeforeRun hook that executes on XWorker bootstrap once and includes our stdlib artifact, as that's exactly what any other PyScript tags uses anyway
  • add a check for config attribute, and, if there:
    • if no env was specified, use that config
    • if an env was specified and known:
      • if the env had a config, throw an duplicated config for env: ...
      • if the env had no config, throw an unable to add a config to the env: ...
    • bootstrap the worker for that env with that config otherwise
  • flag the env as known regardless
  • remove the async nature of the MO callback as that backfires with tons of errors otherwise and it wasn't needed anyway
  • test everything works as expected

Checklist

  • All tests pass locally
  • I have updated CHANGELOG.md
  • I have created documentation for this(if applicable)

@WebReflection WebReflection force-pushed the py-editor-stdlib branch 2 times, most recently from 41d949a to 18a8cb6 Compare March 27, 2024 16:52
@WebReflection WebReflection force-pushed the py-editor-stdlib branch 2 times, most recently from cbd177e to dcfa4be Compare March 27, 2024 17:16
Copy link
Member

@ntoll ntoll left a comment

Choose a reason for hiding this comment

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

:shipit: Bravo!

@WebReflection
Copy link
Contributor Author

Published as npm:

Once green again, I'll merge into main, thank you.

@WebReflection WebReflection merged commit 1447cb3 into pyscript:main Mar 28, 2024
2 checks passed
WebReflection added a commit to WebReflection/pyscript that referenced this pull request Apr 2, 2024
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.

None yet

2 participants