From fdbcc087e2ba84cbddc37ac6d99b8ca42878705c Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Thu, 22 Dec 2022 11:24:28 +0100 Subject: [PATCH] Add Pyodide CLI documentation (#3367) Co-authored-by: Gyeongjae Choi --- docs/conf.py | 1 + docs/requirements-doc.txt | 3 +++ docs/usage/api-reference.md | 1 + docs/usage/api/pyodide-build-cli.md | 4 ++++ docs/usage/api/pyodide-cli.md | 13 +++++++++++++ pyodide-build/setup.cfg | 2 +- requirements.txt | 1 + 7 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 docs/usage/api/pyodide-cli.md diff --git a/docs/conf.py b/docs/conf.py index fd51bd0730e..b29acd41be2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -39,6 +39,7 @@ "sphinxcontrib.napoleon", "myst_parser", "sphinx_js", + "sphinx_click", "autodocsumm", "sphinx_panels", "sphinx_pyodide", diff --git a/docs/requirements-doc.txt b/docs/requirements-doc.txt index 033a9598498..d796ef6a4b8 100644 --- a/docs/requirements-doc.txt +++ b/docs/requirements-doc.txt @@ -10,7 +10,10 @@ sphinx-issues==2.0.0 sphinx-js==3.1 sphinx-version-warning~=1.1.2 sphinx-panels +sphinx-click markupsafe<2.1.0 pydantic +# Packages that we want to document as part of the Pyodide CLI +./pyodide-build/ # Version should be consistent with packages/micropip/meta.yaml micropip==0.2.0 diff --git a/docs/usage/api-reference.md b/docs/usage/api-reference.md index f71fe12e2d3..4835b569fcc 100644 --- a/docs/usage/api-reference.md +++ b/docs/usage/api-reference.md @@ -7,5 +7,6 @@ api/js-api.md api/python-api.md Micropip API + api/pyodide-cli.md api/pyodide-build-cli.md ``` diff --git a/docs/usage/api/pyodide-build-cli.md b/docs/usage/api/pyodide-build-cli.md index 28d17e5b725..a12800ca2d4 100644 --- a/docs/usage/api/pyodide-build-cli.md +++ b/docs/usage/api/pyodide-build-cli.md @@ -2,6 +2,10 @@ # pyodide-build CLI +```{note} +This CLI is being deprecated in favor of the {ref}`pyodide-cli` and will be removed in the future +``` + ```{eval-rst} .. sphinx_argparse_cli:: :module: pyodide_build.__main__ diff --git a/docs/usage/api/pyodide-cli.md b/docs/usage/api/pyodide-cli.md new file mode 100644 index 00000000000..cd2a7f8e5f6 --- /dev/null +++ b/docs/usage/api/pyodide-cli.md @@ -0,0 +1,13 @@ +(pyodide-cli)= + +# pyodide CLI + +This page documents the Pyodide Command Line Interface (CLI) interface. In addition to the commands defined by `pyodide-build`, documented below, other subcommands are defined in external packages (which can be installed with pip): + +- `pyodide pack`, defined in [pyodide-pack](https://github.com/pyodide/pyodide-pack) is a package bundler for Pyodide + +```{eval-rst} +.. click:: pyodide_cli.app:typer_click_object + :prog: pyodide + :nested: full +``` diff --git a/pyodide-build/setup.cfg b/pyodide-build/setup.cfg index 17216162e9c..0f90ab6ba6a 100644 --- a/pyodide-build/setup.cfg +++ b/pyodide-build/setup.cfg @@ -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 cmake unearth~=0.6 requests diff --git a/requirements.txt b/requirements.txt index 97f1a71f7ad..3e69db992ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ pre-commit # testing build==0.7.0 + sphinx-click hypothesis pytest pytest-asyncio