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

Add Pyodide CLI documentation #3367

Merged
merged 16 commits into from
Dec 22, 2022
Merged

Add Pyodide CLI documentation #3367

merged 16 commits into from
Dec 22, 2022

Conversation

rth
Copy link
Member

@rth rth commented Dec 18, 2022

This adds an auto-generate section about the Pyodide CLI.

Requires pyodide/pyodide-cli#17. There is no typer plugin for sphinx, so we have to use sphinx-click (since typer is a wrapper around click it's not an issue).

The question is what we should do about other packages that register subcommands in the Pyodide CLI (e.g. emscripten-auditwheel, pyodide-pack etc):

  • either we do nothing but they are a bit harder to discover.
  • or we add them to docs/requirements-doc.txt and the corresponding CLI docs are generated. But then,
    • a) it's a bit unclear how to manage versions of these packages
    • b) the corresponding subcommands don't explicitly indicate that they need this external package. We should probably fix this in any case.
  • or maybe something in the middle, where we additionally link to the home page of those packages and let them document this. Probably the best solution, I'll go with it for now.

About pyodide venv we need to document it in a separate PR, tag it as experimental, and explain the current limitations. Probably the command description needs updating, but maybe also add a section somewhere in "How to use Pyodide".

Also opened a few issues in https://github.com/ryanking13/auditwheel-emscripten/issues related to this.

@rth rth added this to the 0.22.0 milestone Dec 18, 2022
@rth rth mentioned this pull request Dec 18, 2022
10 tasks
@rth rth changed the title Add Pyodide CLI documentation Draft: Add Pyodide CLI documentation Dec 18, 2022
@rth
Copy link
Member Author

rth commented Dec 18, 2022

what we should do about other packages that register subcommands in the Pyodide CLI (e.g. emscripten-auditwheel)

Though actually since emscripten-auditwheel is now a dependency of pyodide-build it means it will be installed and auto-documented here. This still raises the question of how to manage its version and that we should be more explicit about where each command is defined in.

@rth
Copy link
Member Author

rth commented Dec 18, 2022

OK, to fix CI we would need to merge pyodide/pyodide-cli#17 and make a pyodide-cli release. As for some reason, pip is not happy with installing from a git branch, as a temporary solution, and it's not worth investigating.

@hoodmane
Copy link
Member

There are some minimal docs on virtual environments here:
https://pyodide.org/en/latest/development/building-and-testing-packages.html
probably a more detailed explanation of the capabilities and limitations would be good...

@ryanking13
Copy link
Member

Though actually since emscripten-auditwheel is now a dependency of pyodide-build it means it will be installed and auto-documented here. This still raises the question of how to manage its version and that we should be more explicit about where each command is defined in.

Hmm, probably we need to find a way to "not" auto-document those packages.

@rth rth changed the title Draft: Add Pyodide CLI documentation Add Pyodide CLI documentation Dec 20, 2022
@rth
Copy link
Member Author

rth commented Dec 20, 2022

RTD CI failure due to #3375 but otherwise this is ready. You can see the last working build in https://pyodide--3367.org.readthedocs.build/en/3367/ before I merged with main which introduced the failure.

Hmm, probably we need to find a way to "not" auto-document those packages.

If the users see these commands when they install pyodide-build it's also a bit strange not to document them. I was thinking we could maybe just improve the CLI subcommand docs as to where a given subcommand is defined pyodide/pyodide-cli#18 but this could also be done later.

@rth
Copy link
Member Author

rth commented Dec 22, 2022

Can anyone review, please? It's one one of the few remaining blockers for v0.22 #3340

Copy link
Member

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

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

Thanks, @rth! and sorry for the slow feedback. I have some minor comments otherwise LGTM.

docs/usage/api/pyodide-cli.md Outdated Show resolved Hide resolved
markupsafe<2.1.0
pydantic
pyodide-cli~=0.2.1
# Packages that we want to document as part of the Pyodide CLI
./pyodide-build/
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to specify both pyodide-cli and pyodide-build here? I guess installing pyodide-build will install the proper version of pyodide-cli.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Removed. Thanks for the review!

@@ -29,7 +29,7 @@ install_requires =
build==0.7.0
virtualenv
pydantic>=1.10.2
pyodide-cli>=0.2.0
pyodide-cli~=0.2.1
Copy link
Member

Choose a reason for hiding this comment

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

Probably let's release pyodide-cli 0.2.2 including #20. We can also update auditwheel-emscripten to 0.0.9 which renamed the entrypoint to pyodide auditwheel.

Copy link
Member Author

@rth rth Dec 22, 2022

Choose a reason for hiding this comment

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

Agreed. ~=0.2.1 is equivalent to >=0.2.1,<0.3.0 so we can still merge this and it will use the latest versions once those releases are made.

@rth rth merged commit fdbcc08 into pyodide:main Dec 22, 2022
@rth rth deleted the add-pyodide-cli branch December 22, 2022 10:24
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.

3 participants