Skip to content

Commit a26d84d

Browse files
committed
fix: huh
1 parent b70d8e2 commit a26d84d

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

docs/metatype.dev/docs/reference/metagen/index.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ This generator supports:
170170
- Python classes that map to typegraph types
171171
- Decorators for custom functions implementors that require adherance to typegraph function types.
172172
- By default, all functions from the `PythonRuntime` get stub types.
173-
- TODO: `stubbed_runtimes` for `fdk_py`
174-
- TODO: types for interacting with the typegate from within custom functions.
173+
- Use `stubbed_runtimes` to select which runtimes get stubs.
174+
- [`client_py`](#client_py) based typegraph client
175+
- Special `HostcallTransport` implementation
175176

176177
If the referenced module for the custom function is not found, the generator will also output stub implementation (in addition to the types) at the given type. It will not replace our code on a second run.
177178

@@ -214,7 +215,8 @@ To be more specific, it supports:
214215
- By default, all functions from the `WasmRuntime` get stub types.
215216
- The generator assumes the `wire` based wasm interface is being targetted.
216217
- `stubbed_runtimes` key can be used to configure stub generation from additional runtimes.
217-
- Types for interacting with the typegate from within custom functions.
218+
- [`client_rs`](#client_py) based typegraph client
219+
- Special `HostcallTransport` implementation.
218220
- Glue code for setting up the wasm component to be run within the `WasmRuntime`.
219221

220222
By default the generator will also output a library crate entrypoint and a functional Cargo.toml with all the required dependencies. These additional files wlil not be overwritten on a second run. The generator can also be configured to avoid generating them even if not present.

src/metagen/src/client_rs/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ pub fn gen_cargo_toml(crate_name: Option<&str>) -> String {
487487
let is_test = std::env::var("METAGEN_CLIENT_RS_TEST").ok().as_deref() == Some("1");
488488

489489
#[cfg(debug_assertions)]
490-
let dependency = if is_test {
490+
let dependency = {
491491
use normpath::PathExt;
492492
let client_path = Path::new(env!("CARGO_MANIFEST_DIR"))
493493
.join("../metagen-client-rs")
@@ -497,8 +497,6 @@ pub fn gen_cargo_toml(crate_name: Option<&str>) -> String {
497497
r#"metagen-client = {{ path = "{client_path}" }}"#,
498498
client_path = client_path.as_path().to_str().unwrap()
499499
)
500-
} else {
501-
"metagen-client.workspace = true".to_string()
502500
};
503501

504502
#[cfg(not(debug_assertions))]

src/metagen/src/fdk_rs/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,9 @@ impl FdkRustTemplate {
310310
fn gen_cargo_toml(crate_name: Option<&str>, hostcall: bool) -> String {
311311
let crate_name = crate_name.unwrap_or("fdk_rs");
312312

313-
#[cfg(debug_assertions)]
314-
let is_test = std::env::var("METAGEN_CLIENT_RS_TEST").ok().as_deref() == Some("1");
315-
316313
let dependency = if hostcall {
317314
#[cfg(debug_assertions)]
318-
if is_test {
315+
{
319316
use normpath::PathExt;
320317
let client_path = Path::new(env!("CARGO_MANIFEST_DIR"))
321318
.join("../metagen-client-rs")
@@ -325,8 +322,6 @@ fn gen_cargo_toml(crate_name: Option<&str>, hostcall: bool) -> String {
325322
r#"metagen-client = {{ path = "{client_path}", default-features = false }}"#,
326323
client_path = client_path.as_path().to_str().unwrap()
327324
)
328-
} else {
329-
"metagen-client = { workspace = true, default-features = false }".to_string()
330325
}
331326

332327
#[cfg(not(debug_assertions))]

0 commit comments

Comments
 (0)