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

Python documentation #31

Closed
gadomski opened this issue Oct 8, 2024 · 2 comments · Fixed by #36
Closed

Python documentation #31

gadomski opened this issue Oct 8, 2024 · 2 comments · Fixed by #36
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@gadomski
Copy link
Collaborator

gadomski commented Oct 8, 2024

We should flesh out the Python documentation. We could use readthedocs, but I'd personally recommend mkdocs-material deployed as Github Pages to https://developmentseed.github.io/cql2-rs, with top-level docs about the entire workspace and then Python docs underneath.

Per #30 (comment), we should discuss where we prefer to put Python docs for this sort of project.

@gadomski gadomski added the documentation Improvements or additions to documentation label Oct 8, 2024
@gadomski gadomski added this to the v0.2 milestone Oct 8, 2024
@gadomski gadomski mentioned this issue Oct 8, 2024
@kylebarron
Copy link
Member

I'm glad we're on the same page about mkdocs-material 😄 (sphinx 🤮)

with top-level docs about the entire workspace and then Python docs underneath.

You can see how I do it in geoarrow-rs. A top-level mkdocs website, plus another separate mkdocs deployment for the Python API. This has its own mkdocs.yml and is deployed with --deploy-prefix python/ https://github.com/geoarrow/geoarrow-rs/blob/87992ccb5e2b78a3b9975f2e29afbc9fa3a63ccf/.github/workflows/python-docs.yml#L83

where we prefer to put Python docs for this sort of project.

It's not just a choice of where is most convenient to put docs, it's that that choice changes which tools are able to see docs.

If you document your #[pyfunction] functions with /// style docstrings, those will get assigned to the Python __doc__ attribute, but will not be available to static code analysis. So for example it will work with the ? operator in IPython/Jupyter to see the docstring, but it won't show in VSCode.

Alternatively, if you put the docstrings in the pyi file, then those docstrings will be available to all static code analyzers, but not put on the __doc__ attribute, and so won't be available at runtime.

As far as I know, the only way to have both is to have a full Python shim around the Rust code

@gadomski
Copy link
Collaborator Author

gadomski commented Oct 8, 2024

As far as I know, the only way to have both is to have a full Python shim around the Rust code

Yuk. It's a small package so we probably can do the lift to do both, but 🤞🏼 that gets sorted at some point.

@gadomski gadomski self-assigned this Oct 9, 2024
@gadomski gadomski mentioned this issue Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants