# Description
This PR allows to codegen without worrying about your environment and
dependencies for consistent outcomes in what code is generated from
openapi and envd protobuf spec. Will generate files for `js-sdk` and
`python-sdk`
- [x] create Docker image with all the pinned deps needed to codegen
- [x] create codegen script using this container with mapped volumes
- [x] adapt Makefiles to this new approach
- [x] adapt where we install the connect-python protobuf binary for this
to work
# Test
```sh
make codegen # this command is similar to `make generate` but w/o the hassle
Generating SDK code from openapi and envd spec
cd packages/js-sdk && pnpm generate
> e2b@1.2.1 generate /workspace/packages/js-sdk
> python ./../../spec/remove_extra_tags.py sandboxes templates && openapi-typescript ../../spec/openapi_generated.yml -x api_key --arr
ay-length --alphabetize --output src/api/schema.gen.ts
✨ openapi-typescript 7.6.1
🚀 ../../spec/openapi_generated.yml → src/api/schema.gen.ts [44.2ms]
cd packages/js-sdk && pnpm generate-envd-api
> e2b@1.2.1 generate-envd-api /workspace/packages/js-sdk
> openapi-typescript ../../spec/envd/envd.yaml -x api_key --array-length --alphabetize --output src/envd/schema.gen.ts
✨ openapi-typescript 7.6.1
🚀 ../../spec/envd/envd.yaml → src/envd/schema.gen.ts [22.7ms]
[...]
cd packages/python-sdk && make generate-api
All done! ✨🍰✨
```
---------
Co-authored-by: Jiri Sveceny <jiri.sveceny@icloud.com>
# Description
- Installed and configured
[pydoc-markdown](https://niklasrosenstein.github.io/pydoc-markdown/).
- Created a script that generates and cleans markdown files with a
configurable package list.
- Added docstrings to relevant public methods of the various sdk classes
in order for pydoc to detect them.
# Test
```bash
cd packages/python-sdk
./scripts/generate_api_ref.sh
ls ./api_ref
```
# Considerations
This could eventually be used directly as `.mdx` in the docs nextjs app,
it would look like this with current styling:
<img width="836" alt="Screenshot 2024-09-17 at 17 22 43"
src="https://github.com/user-attachments/assets/a23e954f-2834-4fb6-88a6-d87747a0cf49">