-
Notifications
You must be signed in to change notification settings - Fork 28
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
Start of executable docs #777
base: main
Are you sure you want to change the base?
Conversation
ff2f51e
to
08341c9
Compare
Ahh annoyingly this requires readthedocs to know how to install the dev version of icechunk, otherwise it won't be able to properly execute the docs. may take some figuring out to make that happen in readthedocs with poetry etc |
@@ -57,7 +67,7 @@ However, you can also create a repo on your local filesystem. | |||
|
|||
=== "Local Storage" | |||
|
|||
```python | |||
```python exec="on" session="quickstart" source="above" | |||
import icechunk | |||
storage = icechunk.local_filesystem_storage("./icechunk-local") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
storage = icechunk.local_filesystem_storage(tempfile.mkdtemp()))
so we don't have to clear the local folder above?
@@ -14,7 +15,11 @@ build: | |||
- poetry config virtualenvs.create false | |||
post_install: | |||
# Install deps and build using poetry | |||
- . "$READTHEDOCS_VIRTUALENV_PATH/bin/activate" && cd docs && poetry install | |||
- . "$READTHEDOCS_VIRTUALENV_PATH/bin/activate" && cd docs && poetry install && cd ../icechunk-python && maturin develop && cd ../docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can directly install from github with pip too if we know the commit ID. example:
pip install git+https://github.com/earth-mover/icechunk.git@COMMIT#subdirectory=icechunk-python
This will require maturin in the env, which we seem to have.
By making docs executable we will be able to automatically pick up errors. Currently I'm doing this using
markdown-exec
because that was the only way to integrate into the existing markdown docs while also preserving the tabbing that exists in several pages. This has the downside of currently being a bit verbose in adding to the start of each executable codeblock. However I think this is fixable with some issues I've opened upstream (pawamoy/markdown-exec#77, pawamoy/markdown-exec#76 (comment)). There are two alternatives:mkdocs-jupyter
Woudl allow for writing documentation in jupyter notebooks. however, we would lose some of the pymdownx extensions (e.g. tabbing)
Have doc build fail on unexpected error:
markdown-exec currently warns on an unexpected error. We can make the docs fail by passing
--strict
tomkdocs build
(pawamoy/markdown-exec#75)Alternatively
mkdocs-jupyter
provides this already, or we can achieve the same with myst/jupyterbook