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

Switch to GitHub Pages for hosting the documentation #777

Open
agriyakhetarpal opened this issue Nov 19, 2024 · 9 comments
Open

Switch to GitHub Pages for hosting the documentation #777

agriyakhetarpal opened this issue Nov 19, 2024 · 9 comments

Comments

@agriyakhetarpal
Copy link
Collaborator

As stated in the issue title, I'd like to propose moving the hosted documentation away from Read the Docs and using GitHub Pages instead for hosting. This was last discussed in #706 (comment) and, probably, a few times elsewhere.

Some of the advantages and reasons for this suggestion are as follows:

  • We receive greater control over the build process and we can modify it as we like, instead of having to configure extra build steps we might end up needing in a .readthedocs.yaml file
  • For enabling the rest of the interactive documentation for PyWavelets on latest versions, it is then possible to embed a custom Pyodide distribution, which seems to me should be the best approach for reusing the docs. I've previously tried a similar approach, but this new one that I propose should work better, since it would work without the need for nightly WASM wheels.
  • One less GitHub App to configure for this repository/organisation and fewer finicky permissions to handle.
  • and so on

Some things to be thought about:

  • PyWavelets is a package that has been present for almost nineteen years now, and a lot of links will get subjected to link rot if we don't preserve the style of the Read the Docs links, i.e., to link to the "stable" documentation and "latest" documentation under /en/stable/ and /en/latest/ respectively. Setting redirects for broken links is possible under the Read the Docs admin dashboard, but it's difficult to do the same thing on GitHub Pages.
  • How to best navigate "stable" and "latest" documentation updates on GitHub Pages. For the latter, it would be through a GitHub Actions job that gets triggered on pushes to the master branch and uses a fine-grained PAT to update the rebuilt docs in the gh-pages branch for a PyWavelets/docs repository
  • The features enabled via the Read the Docs add-ons will be lost. Not a big bummer, though, considering we host only the "latest" and "stable" versions and the version switcher has been the most useful one, IO. The version warning on an "unstable" version can be natively re-implemented using admonitions by customising the conf.py file.
  • and more things I might have missed at the time of writing this issue.
@rgommers
Copy link
Member

In principle I'm perfectly fine with migrating to GitHub Pages. We don't need the multi-version support that RTD provides, and we also don't need a latest/stable split but can always just deploy the latest dev version of the docs. New features are rare and will anyway be marked with a .. versionadded:: directive.

Don't worry about the redirects either, we can quite easily set those up even with URL rewriting that would (for example) drop the stable/ part of each link (I've done it for meson-python recently).

For enabling the rest of the interactive documentation for PyWavelets on latest versions, it is then possible to embed a custom Pyodide distribution, which seems to me should be the best approach for reusing the docs. I've previously tried a similar approach, but this new one that I propose should work better, since it would work without the need for nightly WASM wheels.

This is the key part, let's focus on that. I think it's a separate issue, one of the existing ones that deals with nightly wheels probably. I doubt we want to be in the business of hosting a whole distribution, since that doesn't scale very well. I'm still not 100% sure how the recent work by @Carreau et al. gets deployed to get us an up-to-date and working set of packages when loading JupyterLite inside the PyWavelets docs.

@Carreau
Copy link

Carreau commented Nov 22, 2024

I'm also in favor of trying to find a solution that would favor nightly wheels instead of building a whole distribution; It in general better for the ecosystem as it's more flexible and reusable across projects. I'll try to investigate how this ties into JupyterLite.

I think we should also be able to build the wasm32 wheel on RTD as well if we don't want to go upload the wheel to the scientific Python nightly.

@rgommers
Copy link
Member

I think we should also be able to build the wasm32 wheel on RTD as well if we don't want to go upload the wheel to the scientific Python nightly.

We're already uploading the nightly wheels to https://anaconda.org/scientific-python-nightly-wheels/pywavelets and don't plan to stop, so I think we're fine in that respect.

@Carreau
Copy link

Carreau commented Nov 22, 2024

We're already uploading the nightly wheels to anaconda.org/scientific-python-nightly-wheels/pywavelets and don't plan to stop, so I think we're fine in that respect.

Oh, yeah, I missed that; then we shoudl just pull from there indeed.

@Carreau
Copy link

Carreau commented Nov 22, 2024

Meh, I there is a bug in micorpip that actually mark the wasm32 wheels as incompatible...

@Carreau
Copy link

Carreau commented Nov 22, 2024

Ok, so forcing micropip to accept *_wasm32 works

Screenshot 2024-11-22 at 12 25 50

I think that's because emscripten_3_1_58_wasm32 and pyodide_2024_0_wasm32 are considered different platforms, but are compatible ? Am I wrong ?

@agriyakhetarpal
Copy link
Collaborator Author

Both of them are supposed to be the same platform actually – the rename from the Emscripten version to Pyodide + Year + build number in the platform tag was just to indicate that the built wheels are meant to work with the Pyodide distribution rather than purely wheels that are compiled with Emscripten/for WASM.

@agriyakhetarpal
Copy link
Collaborator Author

It might be a bug, micropip should accept both of them

@agriyakhetarpal
Copy link
Collaborator Author

agriyakhetarpal commented Nov 22, 2024

I'll try to investigate how this ties into JupyterLite.

I think we should also be able to build the wasm32 wheel on RTD as well if we don't want to go upload the wheel to the scientific Python nightly.

With JupyterLite, the way forward would be that we use https://jupyterlite.readthedocs.io/en/stable/howto/pyodide/packages.html#installing-packages-at-runtime to install the nightly wheels with a new piplite command (and maybe modify jupyterlite-sphinx to insert that command into a cell automatically). But I think the neater way would be that we do build the wasm32 wheel with RTD (or switch to GitHub Pages like with this proposal), so that we have it installed beforehand (https://jupyterlite.readthedocs.io/en/stable/howto/pyodide/packages.html#bundling-additional-packages-by-default) since the issue to hide a particular cell in a notebook from execution—in this case, the cell at the top of the notebook which would install the nightly wheels—hasn't received much traction: jupyterlite/jupyterlite#508.

A custom Pyodide distribution with GitHub Pages would not scale very well, but should be fine for a package like PyWavelets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants