Skip to content

Commit 0a77e4e

Browse files
committed
update dev guide
1 parent 8f8b5be commit 0a77e4e

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

DEVELOPER_GUIDE.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ This guide provides technical details for developing, testing, and troubleshooti
2424
poetry run python -m grpc_tools.protoc -I./proto --python_out=./src/generated --grpc_python_out=./src/generated ./proto/plugin.proto
2525
```
2626

27-
> Note: `gRPC`'s generated files often incorrectly import using `import plugin_pb2 as plugin__pb2`, so should be manually switched to `from . import plugin_pb2 as plugin__pb2`
28-
2927
## 2. The Handshake Contract
3028

3129
`boot-code` discovers and communicates with plugins based on a simple, strict contract:
3230

3331
* **First line on `stdout`**: Must be the handshake string in the format `1|1|tcp|HOST:PORT|grpc`.
34-
* **All other output**: All logs, warnings, and errors **must** be sent to `stderr`. This keeps `stdout` clean so the handshake is not corrupted. The `main.py` file is already configured to do this.
32+
* **All other output**: All logs, warnings, and errors must be sent to `stderr`. This keeps `stdout` clean so the handshake is not corrupted. The `main.py` file is already configured to do this.
3533

3634
## 3. Testing the Plugin Locally
3735

@@ -109,4 +107,26 @@ The most common issue is that the plugin's virtual environment is not in your sh
109107

110108
* **`Invalid handshake` / `not enough values to unpack`**: This means the plugin wrote something to `stdout` before the handshake string. Ensure all logging and print statements in the Python code use `logging` or write to `sys.stderr`.
111109

112-
* **`ModuleNotFoundError`**: If the plugin fails with this error, it's likely an issue with relative vs. absolute imports within the plugin's `src` directory. Ensure all intra-package imports use the relative `.` syntax (e.g., `from .server import ...`).
110+
* **`ModuleNotFoundError`**: If the plugin fails with this error, it's likely an issue with relative vs. absolute imports within the `src` directory. Ensure all intra-package imports use the relative `.` syntax (e.g., `from .server import ...`).
111+
112+
## 7. Creating a Release
113+
114+
Unlike the Rust plugin which is a compiled binary, the Python plugin is an interpreted package. The standard way to create a release is to build a source distribution (sdist) and a wheel (.whl).
115+
116+
### Build the Release Artifacts
117+
118+
1. **Run the Poetry build command**: From the root of your `boot-python` project, run:
119+
120+
```bash
121+
poetry build
122+
```
123+
124+
2. **Find the artifacts**: This command will create a `dist/` directory containing two files:
125+
* `boot-python-0.1.0.tar.gz` (the source distribution)
126+
* `boot_python-0.1.0-py3-none-any.whl` (the wheel)
127+
128+
### Upload to GitHub
129+
130+
Create a new release on your plugin's GitHub repository and upload both the `.tar.gz` and `.whl` files from your `dist/` directory as the release assets.
131+
132+
**Note**: The `boot plugin install` command is designed to download compiled binaries and will not use these Python artifacts. This release process is the standard way to version and distribute Python packages for sharing and potential future installation via `pip`.

0 commit comments

Comments
 (0)