You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPER_GUIDE.md
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,14 +24,12 @@ This guide provides technical details for developing, testing, and troubleshooti
24
24
poetry run python -m grpc_tools.protoc -I./proto --python_out=./src/generated --grpc_python_out=./src/generated ./proto/plugin.proto
25
25
```
26
26
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
-
29
27
## 2. The Handshake Contract
30
28
31
29
`boot-code` discovers and communicates with plugins based on a simple, strict contract:
32
30
33
31
***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.
35
33
36
34
## 3. Testing the Plugin Locally
37
35
@@ -109,4 +107,26 @@ The most common issue is that the plugin's virtual environment is not in your sh
109
107
110
108
***`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`.
111
109
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