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

Include unit examples in codegen output #2509

Closed
teh-cmc opened this issue Jun 26, 2023 · 0 comments · Fixed by #2590
Closed

Include unit examples in codegen output #2509

teh-cmc opened this issue Jun 26, 2023 · 0 comments · Fixed by #2590
Labels
codegen/idl 📖 documentation Improvements or additions to documentation 🐍 Python API Python logging API 🦀 Rust API Rust logging API

Comments

@teh-cmc
Copy link
Member

teh-cmc commented Jun 26, 2023

We now have really nice unit examples for both Python & Rust in docs/code-examples; it would be great to provide a way to automatically include them as docstrings in the codegen output for both SDKs.

@teh-cmc teh-cmc added 📖 documentation Improvements or additions to documentation 🐍 Python API Python logging API 🦀 Rust API Rust logging API codegen/idl labels Jun 26, 2023
teh-cmc added a commit that referenced this issue Jul 5, 2023
**Easier to review commit by commit**

This PR makes it so that our nice examples in docs/code-examples
automagically end up in docstrings for both Python & Rust.

Fixes #2509 

UPDATE: This also fixes a pretty serious bug in the versioning code...
I'm not entirely how anything worked at all actually (??).

TL;DR: given this:

https://github.com/rerun-io/rerun/blob/0fc2a9fad2616bb3580176df37c488fc76a9a2ca/crates/re_types/definitions/rerun/archetypes/points2d.fbs#L16-L33

You get this

![image](https://github.com/rerun-io/rerun/assets/2910679/e36af2b6-5ae7-4790-9048-8816c140b8d0)

and this

![image](https://github.com/rerun-io/rerun/assets/2910679/feaf0b17-bc38-47c9-8f4f-0b476b54315b)


### What

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2590) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/2590)
- [Docs
preview](https://rerun.io/preview/pr%3Acmc%2Fhope_docstring_examples/docs)
- [Examples
preview](https://rerun.io/preview/pr%3Acmc%2Fhope_docstring_examples/examples)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen/idl 📖 documentation Improvements or additions to documentation 🐍 Python API Python logging API 🦀 Rust API Rust logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant