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

Ressurrect our pyodide support #509

Merged
merged 11 commits into from
Nov 3, 2024
Merged

Conversation

alcarney
Copy link
Collaborator

@alcarney alcarney commented Oct 27, 2024

This PR requires #508 to be merged first

The existing "support" for pyodide hasn't received much attention since it was originally merged (sorry! 😅). This PR should finally fix that!

  • All of the existing pyodide specific code has been ripped out.
  • When pygls detects that it is running in a WASM environment, the start_io method will by default, now fallback to a synchronous main loop which is actually all we need to get it to work
  • The old selenium based pyodide test suite has also been removed
  • Rather than try and run the entire test suite in pyodide, we can now pass a --lsp-runtime pyodide and pytest will try and run just the end-to-end tests in pyodide. (See tests/pyodide/run_server.js for the details of getting the server up and running)

TODO

  • Add some notes to the docs on how to run a pygls server in pyodide
    • Via NodeJS
    • Via the browser
  • Create a contributors section to the docs and add a few notes on how to get the pyodide test suite up and running

Code review checklist (for code reviewer to complete)

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Commit messages are meaningful (see this for details)
  • Tests have been included and/or updated, as appropriate
  • Docstrings have been included and/or updated, as appropriate
  • Standalone docs have been updated accordingly

Automated linters

You can run the lints that are run on CI locally with:

poetry install --all-extras --with dev
poetry run poe lint

@alcarney alcarney force-pushed the pyodide branch 2 times, most recently from 26ed8db to 425f36d Compare October 28, 2024 18:59
This should be all we need to add basic support for both pyodide and
wasi WASM runtimes
This adds a new `pyodide` value for the option `--lsp-runtime`
argument to the test suite. When given pytest will attempt to use
a (pre-setup) pyodide environment to run the end-to-end tests in.

This should resolve all the issues we had with the old pyodide test
suite as we are not trying to shove pytest, pytest-asyncio etc and all
of their complexity into pyodide.
This should resolve all the deprecation warnings
This commit attempts to add a bit more structure to the documentation,
hopefully making it easier to navigate as the number of articles
slowly grows
@alcarney alcarney marked this pull request as ready for review November 2, 2024 18:10
@alcarney alcarney requested a review from tombh November 2, 2024 18:10
Copy link
Collaborator

@tombh tombh left a comment

Choose a reason for hiding this comment

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

Great!

@alcarney
Copy link
Collaborator Author

alcarney commented Nov 3, 2024

Thanks! :)

@alcarney alcarney merged commit a075820 into openlawlibrary:main Nov 3, 2024
16 checks passed
@alcarney alcarney deleted the pyodide branch November 3, 2024 13:56
@alcarney alcarney mentioned this pull request Nov 3, 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.

2 participants