From 389aef100289beb56706f66c1fe1fb468cb05707 Mon Sep 17 00:00:00 2001 From: Frans Allen Date: Wed, 18 Nov 2026 19:05:42 +0700 Subject: [PATCH 1/3] feat(cli): switch the project file from pyo.toml to pyo.jsonc pyo.jsonc is JSON with comments and trailing commas, with camelCase keys that match the API (autoRollback, serveAs, build.dockerfilePath). pyo link writes a new file with "$schema" and "service", and changes only "service" in an existing one, keeping its comments and layout. Unknown settings still fail, naming the setting and the file. The JSON Schema comes from the config types. A test checks that pyo-docs/schema/pyo.json matches it, and PYO_WRITE_SCHEMA=1 rewrites it. A pyo.toml found before any pyo.jsonc stops with one line that points to pyo link. --- Cargo.lock | 12 + crates/pyo-cli/Cargo.toml | 6 + crates/pyo-cli/src/config.rs | 476 ++++++++++++++++++++++++++++------ crates/pyo-cli/src/main.rs | 10 +- crates/pyo-cli/src/service.rs | 102 +++++--- 5 files changed, 474 insertions(+), 132 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 478a1c5..8be571c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2411,6 +2411,15 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "jsonc-parser" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ecded084f9b9a718d39668a42657c32253663d1f6afb3fbb9134f0305f73f48" +dependencies = [ + "serde", +] + [[package]] name = "jsonpath-rust" version = "1.0.12" @@ -3441,11 +3450,14 @@ dependencies = [ "crossterm", "futures", "hex", + "jsonc-parser", "pyo-proto", "rand 0.10.3", "reqwest", + "schemars 1.2.3", "serde", "serde_json", + "serde_path_to_error", "sha2 0.11.1", "tokio", "tokio-tungstenite", diff --git a/crates/pyo-cli/Cargo.toml b/crates/pyo-cli/Cargo.toml index 8c09495..264a250 100644 --- a/crates/pyo-cli/Cargo.toml +++ b/crates/pyo-cli/Cargo.toml @@ -16,12 +16,18 @@ clap = { version = "4.5", features = ["derive", "env"] } crossterm = "0.29" futures = "0.3.34" hex = "0.4.3" +jsonc-parser = { version = "0.34.0", features = ["cst", "serde"] } rand = "0.10.3" reqwest = { version = "0.13.5", default-features = false, features = ["json", "query", "rustls", "stream"] } serde = { version = "1.0.229", features = ["derive"] } serde_json = "1.0.154" +serde_path_to_error = "0.1.20" sha2 = "0.11.1" tokio = { version = "1.54.1", features = ["rt-multi-thread", "macros", "net", "io-util", "io-std", "time", "sync", "fs"] } tokio-tungstenite = { version = "0.29", features = ["rustls-tls-native-roots"] } toml = "0.9" pyo-proto = { version = "0.4.3", path = "../pyo-proto" } + +[dev-dependencies] +# The JSON Schema of pyo.jsonc, written from the config types by a test. +schemars = "1.2.3" diff --git a/crates/pyo-cli/src/config.rs b/crates/pyo-cli/src/config.rs index 18395a6..c564b6d 100644 --- a/crates/pyo-cli/src/config.rs +++ b/crates/pyo-cli/src/config.rs @@ -1,19 +1,25 @@ //! Where the CLI keeps things: your sign-in (`~/.config/pyo/config.toml`, //! readable only by you, or `%APPDATA%\pyo\config.toml` on Windows, in -//! your user profile) and the service a folder deploys (`pyo.toml`, found +//! your user profile) and the service a folder deploys (`pyo.jsonc`, found //! in the current folder or the nearest one above it). use std::{ + collections::BTreeMap, fs, path::{Path, PathBuf}, }; use anyhow::{Context, Result, bail}; use serde::{Deserialize, Serialize}; +use serde_json::Value; use crate::api::Api; -pub const FILE: &str = "pyo.toml"; +pub const FILE: &str = "pyo.jsonc"; +/// The file Pyo read before pyo.jsonc. Finding one only points to pyo link. +const OLD_FILE: &str = "pyo.toml"; +/// pyo.jsonc's JSON Schema, for editors. pyo-web serves it from pyo-docs. +pub const SCHEMA_URL: &str = "https://pyo.dev/schema/pyo.json"; #[derive(Debug, Default, Serialize, Deserialize)] pub struct Credentials { @@ -107,119 +113,229 @@ pub fn client(url: Option<&str>, token: Option<&str>) -> Result { Api::new(&url, &token) } -// ── pyo.toml ────────────────────────────────────────────────────────── +// ── pyo.jsonc ───────────────────────────────────────────────────────── +// +// JSON with comments and trailing commas. The doc comments on these types +// are the descriptions editors show on hover: they go into the JSON Schema +// at https://pyo.dev/schema/pyo.json (see `schema` in the tests below). -/// What a folder deploys and how. Every setting is optional: what's set -/// here wins on `pyo deploy`; the rest stays as the dashboard has it. +/// Settings for a Pyo service, kept next to its code. pyo link writes this file, and pyo deploy applies it. Every setting is optional. What's set here wins, and the rest stays as it is in the dashboard. #[derive(Debug, Default, Deserialize)] -#[serde(deny_unknown_fields)] +#[cfg_attr(test, derive(schemars::JsonSchema))] +#[cfg_attr(test, schemars(title = "pyo.jsonc"))] +#[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct ServiceFile { - /// The service's id, written by `pyo link`. + /// The JSON Schema for this file. Editors use it to complete and check your settings. + #[serde(rename = "$schema")] + #[allow(dead_code, reason = "for editors: Pyo only allows it")] + pub schema: Option, + /// The service this folder deploys, by id. Written by pyo link. pub service: Option, - /// Image services: "ghcr.io/acme/api:1.2" (tag or @sha256 digest). + /// Image services only. The image to deploy, with a tag or an @sha256 digest, like ghcr.io/acme/api:1.2. pub image: Option, + /// How the service is built. Services built from Git only. #[serde(default)] pub build: Build, + /// How the service runs. #[serde(default)] pub deploy: Deploy, + /// The most CPU and memory each replica can use. #[serde(default)] pub resources: Resources, - /// Variables. Secrets stay in Pyo: `pyo env set --secret`. + /// Variables, as text, numbers or true and false. Not secrets, because this file is usually committed. Keep secrets in Pyo with pyo env set --secret. #[serde(default)] - pub env: toml::Table, + #[cfg_attr(test, schemars(schema_with = "scalars"))] + pub env: BTreeMap, } #[derive(Debug, Default, Deserialize)] -#[serde(deny_unknown_fields)] +#[cfg_attr(test, derive(schemars::JsonSchema))] +#[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct Build { + /// The Git branch to build. pub branch: Option, - pub dockerfile: Option, + /// The Dockerfile to build, like Dockerfile or docker/api.Dockerfile. + pub dockerfile_path: Option, + /// The folder whose files are sent to the build, like . or apps/web. pub context: Option, - /// Build arguments, used by the next build: Dockerfile ARGs, or - /// Railpack settings like RAILPACK_BUILD_CMD. They can end up in the - /// image, so no secrets. + /// Build arguments, used on the next deploy: Dockerfile ARGs, or Railpack settings like RAILPACK_SPA_OUTPUT_DIR. They can end up in the image, so keep secrets out. #[serde(default)] - pub args: toml::Table, + #[cfg_attr(test, schemars(schema_with = "scalars"))] + pub args: BTreeMap, } #[derive(Debug, Default, Deserialize)] -#[serde(deny_unknown_fields)] +#[cfg_attr(test, derive(schemars::JsonSchema))] +#[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct Deploy { + /// How many replicas run. A replica is one running copy of the service. + #[cfg_attr(test, schemars(range(min = 0, max = 2147483647)))] pub replicas: Option, /// The port the service listens on for HTTP. + #[cfg_attr(test, schemars(range(min = 1, max = 65535)))] pub port: Option, - /// When a replica is ready: an HTTP path ("/healthz"), "tcp" for its - /// port accepting connections, or "none" to not wait. + /// Checked before traffic moves over: an HTTP path like /healthz, "tcp" for its port accepting connections, or "none" to not wait. + #[cfg_attr(test, schemars(extend("examples" = ["/healthz", "tcp", "none"])))] pub health: Option, + /// Put the previous version back when a deploy fails. On by default. pub auto_rollback: Option, - /// A build Pyo detects as a static site: "static" serves its files - /// from the cluster's shared static server (the default), "service" - /// runs it as a service of its own. - pub serve: Option, + /// A static site's build: "static" serves its files, "service" runs it as a service of its own. + #[cfg_attr(test, schemars(extend("enum" = ["static", "service"])))] + pub serve_as: Option, } #[derive(Debug, Default, Deserialize)] -#[serde(deny_unknown_fields)] +#[cfg_attr(test, derive(schemars::JsonSchema))] +#[serde(deny_unknown_fields, rename_all = "camelCase")] pub struct Resources { - /// Limit: "500m" or "1" (cores). + /// The CPU limit: "500m" or "1" (cores). + #[cfg_attr(test, schemars(extend("examples" = ["500m", "1"])))] pub cpu: Option, - /// Limit: "512Mi" or "1Gi". + /// The memory limit: "512Mi" or "1Gi". + #[cfg_attr(test, schemars(extend("examples" = ["512Mi", "1Gi"])))] pub memory: Option, } -/// The nearest pyo.toml: this folder, or the closest one above it. -pub fn find() -> Option { - let mut dir = std::env::current_dir().ok()?; - loop { - let p = dir.join(FILE); +/// env and build.args: names to text, numbers or true and false. +#[cfg(test)] +fn scalars(_: &mut schemars::SchemaGenerator) -> schemars::Schema { + schemars::json_schema!({ + "type": "object", + "additionalProperties": { "type": ["string", "number", "boolean"] }, + }) +} + +/// What the nearest folder with settings has. +#[derive(Debug, PartialEq)] +pub enum Found { + /// A pyo.jsonc. + File(PathBuf), + /// Only a pyo.toml, which Pyo no longer reads. + Old(PathBuf), +} + +/// The nearest pyo.jsonc (or pyo.toml) in `dir` or the closest folder above it. +pub fn find_from(dir: &Path) -> Option { + dir.ancestors().find_map(|d| { + let p = d.join(FILE); if p.is_file() { - return Some(p); - } - if !dir.pop() { - return None; + return Some(Found::File(p)); } + let old = d.join(OLD_FILE); + old.is_file().then_some(Found::Old(old)) + }) +} + +/// The nearest pyo.jsonc: this folder, or the closest one above it. +pub fn find() -> Result> { + match std::env::current_dir() { + Ok(dir) => find_in(&dir), + Err(_) => Ok(None), + } +} + +/// The nearest pyo.jsonc from `dir`. A pyo.toml found first is an error +/// that points to pyo link. +fn find_in(dir: &Path) -> Result> { + match find_from(dir) { + Some(Found::File(p)) => Ok(Some(p)), + Some(Found::Old(_)) => bail!("Pyo now uses pyo.jsonc instead of pyo.toml. Run: pyo link"), + None => Ok(None), + } +} + +/// What pyo.jsonc may hold beyond plain JSON: comments and trailing commas. +fn parse_options() -> jsonc_parser::ParseOptions { + jsonc_parser::ParseOptions { + allow_comments: true, + allow_trailing_commas: true, + allow_loose_object_property_names: false, + allow_missing_commas: false, + allow_single_quoted_strings: false, + allow_hexadecimal_numbers: false, + allow_unary_plus_numbers: false, + allow_bare_decimal_point_numbers: false, + allow_non_finite_numbers: false, + allow_extended_string_escapes: false, } } pub fn load(path: &Path) -> Result { let s = fs::read_to_string(path).with_context(|| format!("Can't read {}", path.display()))?; - toml::from_str(&s).map_err(|e| anyhow::anyhow!("{}: {}", path.display(), e.message())) + parse(&s).map_err(|e| anyhow::anyhow!("{}: {e}", path.display())) +} + +/// pyo.jsonc's text as settings. Errors name the setting they're about. +pub fn parse(text: &str) -> Result { + let value: Option = jsonc_parser::parse_to_serde_value(text, &parse_options())?; + let value = value.unwrap_or_else(|| Value::Object(Default::default())); + serde_path_to_error::deserialize(value).map_err(|e| { + let path = e.path().to_string(); + let inner = e.into_inner().to_string(); + // serde says "unknown field `x`, expected one of ...". + if let Some(rest) = inner.strip_prefix("unknown field `") { + let key = rest.split('`').next().unwrap_or(rest); + let at = match path.rsplit_once('.') { + Some((parent, _)) if path != "." => format!("{parent}.{key}"), + _ => key.to_owned(), + }; + return anyhow::anyhow!("unknown setting \"{at}\""); + } + if path == "." { + anyhow::anyhow!("{inner}") + } else { + anyhow::anyhow!("{path}: {inner}") + } + }) +} + +/// A new pyo.jsonc, linked to the service `id`. +fn new_file(id: &str) -> String { + let id = Value::from(id); + format!("{{\n \"$schema\": \"{SCHEMA_URL}\",\n \"service\": {id}\n}}\n") } -/// Set `service = ""` in pyo.toml, keeping everything else; make the -/// file in the current folder when there's none. -pub fn write_service(path: Option<&Path>, id: &str, label: &str) -> Result { +/// Set `"service": ""` in pyo.jsonc, keeping everything else as it +/// is, comments too. Without a file, make one in the current folder. +pub fn write_service(path: Option<&Path>, id: &str) -> Result { let path = path .map(Path::to_path_buf) .unwrap_or_else(|| PathBuf::from(FILE)); - let line = format!("service = \"{id}\" # {label}"); let text = match fs::read_to_string(&path) { - Ok(s) => { - let mut done = false; - let mut out: Vec = s - .lines() - .map(|l| { - if !done && l.trim_start().starts_with("service") && l.contains('=') { - done = true; - line.clone() - } else { - l.to_owned() - } - }) - .collect(); - if !done { - out.insert(0, line); - } - out.join("\n") + "\n" - } - Err(_) => format!( - "{line}\n\n# Settings here win on `pyo deploy`. Anything left out stays as\n# the dashboard has it. Secrets: `pyo env set --secret KEY=value`.\n\n# [deploy]\n# replicas = 1\n# port = 8080\n# health = \"/healthz\" # or \"tcp\" or \"none\"\n# serve = \"static\" # a static site's files, or \"service\"\n\n# [build.args]\n# RAILPACK_SPA_OUTPUT_DIR = \"dist\"\n\n# [resources]\n# cpu = \"500m\"\n# memory = \"512Mi\"\n\n# [env]\n# LOG_LEVEL = \"info\"\n" - ), + Ok(s) => set_service(&s, id).map_err(|e| anyhow::anyhow!("{}: {e}", path.display()))?, + Err(_) => new_file(id), }; fs::write(&path, text)?; Ok(path) } +/// `text` with its service set to `id`, and nothing else changed. +fn set_service(text: &str, id: &str) -> Result { + use jsonc_parser::cst::{CstInputValue, CstRootNode}; + if text.trim().is_empty() { + return Ok(new_file(id)); + } + let root = CstRootNode::parse(text, &parse_options())?; + let Some(obj) = root.object_value() else { + bail!("the file isn't an object, like {{ \"service\": \"...\" }}"); + }; + let value = CstInputValue::String(id.to_owned()); + match obj.get("service") { + Some(prop) => prop.set_value(value), + None => { + // After "$schema" when it's first, else at the top. + let at = usize::from( + obj.properties() + .first() + .and_then(|p| p.name()?.decoded_value().ok()) + .is_some_and(|n| n == "$schema"), + ); + obj.insert(at, "service", value); + } + } + Ok(root.to_string()) +} + /// "500m" → 500, "1.5" or "1.5 cores" → 1500 (millicores). pub fn parse_cpu(s: &str) -> Result { let s = s.trim(); @@ -265,35 +381,227 @@ mod tests { assert!(parse_memory("12").is_err()); } + const FULL: &str = r#"{ + "$schema": "https://pyo.dev/schema/pyo.json", + "service": "svc_abc", // written by pyo link + /* Git services */ + "build": { + "dockerfilePath": "Dockerfile", + "args": { "RAILPACK_BUILD_CMD": "npm run build", }, + }, + "deploy": { "replicas": 2, "port": 8080, "health": "/healthz", "autoRollback": false, "serveAs": "service" }, + "resources": { "cpu": "500m", "memory": "1Gi" }, + "env": { "LOG_LEVEL": "info", "WORKERS": 4 }, +} +"#; + #[test] fn full_file_parses() { - let f: ServiceFile = toml::from_str( - r#" - service = "svc_abc" - [build] - dockerfile = "Dockerfile" - [build.args] - RAILPACK_BUILD_CMD = "npm run build" - [deploy] - replicas = 2 - port = 8080 - health = "/healthz" - [resources] - cpu = "500m" - memory = "1Gi" - [env] - LOG_LEVEL = "info" - WORKERS = 4 - "#, - ) - .unwrap(); + let f = parse(FULL).unwrap(); assert_eq!(f.service.as_deref(), Some("svc_abc")); + assert_eq!(f.build.dockerfile_path.as_deref(), Some("Dockerfile")); assert_eq!(f.deploy.replicas, Some(2)); + assert_eq!(f.deploy.auto_rollback, Some(false)); + assert_eq!(f.deploy.serve_as.as_deref(), Some("service")); assert_eq!(f.env.len(), 2); + assert_eq!(f.build.args["RAILPACK_BUILD_CMD"], "npm run build"); + // An empty file is no settings. + assert!(parse("").unwrap().service.is_none()); + assert!(parse("{}").unwrap().service.is_none()); + } + + #[test] + fn unknown_settings_are_named() { + let e = parse(r#"{ "replicas": 2 }"#).unwrap_err().to_string(); + assert_eq!(e, "unknown setting \"replicas\""); + let e = parse(r#"{ "deploy": { "replica": 2 } }"#) + .unwrap_err() + .to_string(); + assert_eq!(e, "unknown setting \"deploy.replica\""); + // The TOML spelling isn't taken either. + let e = parse(r#"{ "deploy": { "auto_rollback": true } }"#) + .unwrap_err() + .to_string(); + assert_eq!(e, "unknown setting \"deploy.auto_rollback\""); + let e = parse(r#"{ "deploy": { "replicas": "2" } }"#) + .unwrap_err() + .to_string(); + assert!(e.starts_with("deploy.replicas: invalid type"), "{e}"); + // load says which file. + let dir = temp("unknown"); + fs::write(dir.join(FILE), r#"{ "servic": "svc_a" }"#).unwrap(); + let e = load(&dir.join(FILE)).unwrap_err().to_string(); + assert_eq!( + e, + format!("{}: unknown setting \"servic\"", dir.join(FILE).display()) + ); + fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn only_comments_and_trailing_commas_beyond_json() { + assert!(parse("// a comment\n{ \"service\": \"svc_a\", /* here */ }").is_ok()); + assert!(parse("{ service: \"svc_a\" }").is_err()); + assert!(parse("{ \"service\": 'svc_a' }").is_err()); + assert!(parse("{ \"service\": \"svc_a\" \"image\": \"x\" }").is_err()); + assert!(parse("[]").is_err()); + } + + /// An empty folder of its own for a test. + fn temp(name: &str) -> PathBuf { + let dir = std::env::temp_dir().join(format!("pyo-cli-{name}-{}", std::process::id())); + let _ = fs::remove_dir_all(&dir); + fs::create_dir_all(&dir).unwrap(); + dir + } + + #[test] + fn found_in_this_folder_or_above() { + let dir = temp("walk"); + let deep = dir.join("a/b"); + fs::create_dir_all(&deep).unwrap(); + assert_eq!(find_from(&deep), None); + fs::write(dir.join(FILE), "{}").unwrap(); + assert_eq!(find_from(&deep), Some(Found::File(dir.join(FILE)))); + fs::write(dir.join("a").join(FILE), "{}").unwrap(); assert_eq!( - f.build.args["RAILPACK_BUILD_CMD"].as_str(), - Some("npm run build") + find_from(&deep), + Some(Found::File(dir.join("a").join(FILE))) + ); + // A pyo.toml nearer than any pyo.jsonc points to pyo link. + fs::write(deep.join(OLD_FILE), "").unwrap(); + assert_eq!(find_from(&deep), Some(Found::Old(deep.join(OLD_FILE)))); + assert_eq!( + find_in(&deep).unwrap_err().to_string(), + "Pyo now uses pyo.jsonc instead of pyo.toml. Run: pyo link" + ); + // Next to a pyo.jsonc, it's ignored. + fs::write(deep.join(FILE), "{}").unwrap(); + assert_eq!(find_from(&deep), Some(Found::File(deep.join(FILE)))); + assert_eq!(find_in(&deep).unwrap(), Some(deep.join(FILE))); + fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn link_writes_a_new_file() { + let dir = temp("link-new"); + let path = write_service(Some(&dir.join(FILE)), "svc_new").unwrap(); + let text = fs::read_to_string(&path).unwrap(); + assert_eq!( + text, + "{\n \"$schema\": \"https://pyo.dev/schema/pyo.json\",\n \"service\": \"svc_new\"\n}\n" + ); + let f = load(&path).unwrap(); + assert_eq!(f.schema.as_deref(), Some(SCHEMA_URL)); + assert_eq!(f.service.as_deref(), Some("svc_new")); + fs::remove_dir_all(dir).unwrap(); + } + + #[test] + fn link_changes_only_the_service() { + let text = set_service(FULL, "svc_new").unwrap(); + assert_eq!(text, FULL.replace("\"svc_abc\"", "\"svc_new\"")); + + // No service yet: it goes after "$schema", or first. + let text = set_service( + "{\n \"$schema\": \"https://pyo.dev/schema/pyo.json\",\n // Port\n \"deploy\": { \"port\": 80 },\n}\n", + "svc_new", + ) + .unwrap(); + let f = parse(&text).unwrap(); + assert_eq!(f.service.as_deref(), Some("svc_new")); + assert_eq!(f.deploy.port, Some(80)); + assert!(text.contains("// Port"), "{text}"); + let schema = text.find("$schema").unwrap(); + let service = text.find("\"service\"").unwrap(); + let deploy = text.find("\"deploy\"").unwrap(); + assert!(schema < service && service < deploy, "{text}"); + + let text = set_service("{ \"deploy\": { \"port\": 80 } }", "svc_new").unwrap(); + assert!(text.find("\"service\"").unwrap() < text.find("\"deploy\"").unwrap()); + assert_eq!(parse(&text).unwrap().service.as_deref(), Some("svc_new")); + + assert_eq!(set_service(" \n", "svc_new").unwrap(), new_file("svc_new")); + assert!(set_service("[]", "svc_new").is_err()); + } + + /// The JSON Schema, from the types above: draft 7, which editors know + /// best, with each object's settings inline so their descriptions show. + fn schema_json() -> String { + let mut settings = schemars::generate::SchemaSettings::draft07(); + settings.inline_subschemas = true; + let mut schema = settings + .into_generator() + .into_root_schema_for::(); + no_null(&mut schema); + let mut out = serde_json::Map::new(); + out.insert("$schema".into(), schema.get("$schema").unwrap().clone()); + out.insert("$id".into(), SCHEMA_URL.into()); + for (k, v) in schema.as_object().unwrap() { + out.entry(k.clone()).or_insert(v.clone()); + } + let mut s = serde_json::to_string_pretty(&out).unwrap(); + s.push('\n'); + s + } + + /// Unset settings are left out, not null: `type: ["string", "null"]` + /// becomes `type: "string"`. + fn no_null(schema: &mut schemars::Schema) { + if let Some(Value::Array(types)) = schema.get("type") { + let types: Vec = types.iter().filter(|t| *t != "null").cloned().collect(); + let t = match <[Value; 1]>::try_from(types) { + Ok([one]) => one, + Err(many) => Value::Array(many), + }; + schema.insert("type".into(), t); + } + schemars::transform::transform_subschemas(&mut no_null, schema); + } + + /// pyo-docs/schema/pyo.json, beside this repository (or in + /// PYO_DOCS_DIR), is what https://pyo.dev/schema/pyo.json serves. Write + /// it with: PYO_WRITE_SCHEMA=1 cargo test -p pyo-cli schema + #[test] + fn schema_is_current() { + let docs = std::env::var_os("PYO_DOCS_DIR") + .map(PathBuf::from) + .unwrap_or_else(|| Path::new(env!("CARGO_MANIFEST_DIR")).join("../../../pyo-docs")); + let path = docs.join("schema/pyo.json"); + let want = schema_json(); + if std::env::var_os("PYO_WRITE_SCHEMA").is_some() { + fs::create_dir_all(path.parent().unwrap()).unwrap(); + fs::write(&path, &want).unwrap(); + return; + } + let Ok(have) = fs::read_to_string(&path) else { + return; + }; + assert!( + have == want, + "{} is out of date: run PYO_WRITE_SCHEMA=1 cargo test -p pyo-cli schema", + path.display() ); - assert!(toml::from_str::("replicas = 2").is_err()); + } + + #[test] + fn schema_allows_what_the_cli_reads() { + let schema: Value = serde_json::from_str(&schema_json()).unwrap(); + let props = &schema["properties"]; + assert_eq!(schema["additionalProperties"], false); + assert_eq!(props["$schema"]["type"], "string"); + assert_eq!(props["deploy"]["additionalProperties"], false); + assert!(props["deploy"]["properties"]["autoRollback"].is_object()); + assert!(props["build"]["properties"]["args"].is_object()); + assert_eq!(props["deploy"]["properties"]["port"]["maximum"], 65535); + // Every setting says what it is. + fn described(path: &str, s: &Value) { + for (k, v) in s["properties"].as_object().into_iter().flatten() { + let at = format!("{path}{k}"); + assert!(v["description"].is_string(), "{at} has no description"); + described(&format!("{at}."), v); + } + } + described("", &schema); } } diff --git a/crates/pyo-cli/src/main.rs b/crates/pyo-cli/src/main.rs index 5b7d495..86cb699 100644 --- a/crates/pyo-cli/src/main.rs +++ b/crates/pyo-cli/src/main.rs @@ -1,6 +1,6 @@ //! `pyo`, the command line for Pyo: link a folder to a service, then //! deploy, follow logs, manage its environment and roll back from a -//! terminal or CI. Settings live in pyo.toml (see config.rs). +//! terminal or CI. Settings live in pyo.jsonc (see config.rs). mod api; mod backup; @@ -51,7 +51,7 @@ struct Cli { #[derive(Args)] struct Which { - /// The service: a name ("api", "shop/api") or id. Default: pyo.toml's. + /// The service: a name ("api", "shop/api") or id. Default: pyo.jsonc's. // Global: taken before or after a subcommand (`pyo env -s api set`, // `pyo env set -s api`). #[arg(long, short, global = true)] @@ -86,12 +86,12 @@ enum Command { #[arg(value_parser = ["on", "off"])] state: Option, }, - /// Link this folder to a service (writes pyo.toml). + /// Link this folder to a service (writes pyo.jsonc). Link { /// "api", "shop/api" or "team/shop/api". Without it, pick from a list. service: Option, }, - /// Apply pyo.toml and deploy, then follow it to the end. With -f, import + /// Apply pyo.jsonc and deploy, then follow it to the end. With -f, import /// a Docker Compose file instead: see what it makes, then deploy it. Deploy { #[command(flatten)] @@ -110,7 +110,7 @@ enum Command { #[arg(long)] cluster: Option, /// Don't ask: import the Compose file, or go ahead with a very - /// large replica change from pyo.toml. + /// large replica change from pyo.jsonc. #[arg(long, short = 'y')] yes: bool, }, diff --git a/crates/pyo-cli/src/service.rs b/crates/pyo-cli/src/service.rs index c25597c..8f80ffb 100644 --- a/crates/pyo-cli/src/service.rs +++ b/crates/pyo-cli/src/service.rs @@ -1,5 +1,5 @@ //! Commands on one service: which one comes from `--service`, else the -//! nearest pyo.toml. Changes save the service's whole configuration the +//! nearest pyo.jsonc. Changes save the service's whole configuration the //! way the dashboard does (`saveService`); secrets' values never come back //! from the API, and the API keeps them when they're sent back blank. @@ -14,7 +14,7 @@ use crate::{ ui, }; -/// The service a command acts on, with the pyo.toml that named it. +/// The service a command acts on, with the pyo.jsonc that named it. pub struct Target { pub state: State, pub id: String, @@ -28,7 +28,7 @@ impl Target { } pub async fn target(api: &Api, service: Option<&str>) -> Result { - let file = match config::find() { + let file = match config::find()? { Some(p) => Some((p.clone(), config::load(&p)?)), None => None, }; @@ -92,7 +92,16 @@ pub async fn link(api: &Api, service: Option) -> Result<()> { }; let service = state.service(&id)?; let label = state.path_of(service); - let path = config::write_service(config::find().as_deref(), &id, &label)?; + // The nearest pyo.jsonc, or one next to a pyo.toml found instead. + let path = match std::env::current_dir() + .ok() + .and_then(|d| config::find_from(&d)) + { + Some(config::Found::File(p)) => Some(p), + Some(config::Found::Old(p)) => Some(p.with_file_name(config::FILE)), + None => None, + }; + let path = config::write_service(path.as_deref(), &id)?; ui::ok(&format!( "Linked {} in {}", ui::bold(&label), @@ -254,7 +263,7 @@ fn print_line(l: &Value) { println!("{at} {msg}"); } -/// Put pyo.toml's settings on the service; what it changed, in words. +/// Put pyo.jsonc's settings on the service; what it changed, in words. pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { let mut changes = vec![]; let kind = service["source"]["type"].as_str().unwrap_or("").to_owned(); @@ -262,7 +271,7 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { if let Some(image) = &f.image { if kind != "image" { bail!( - "pyo.toml: `image` is for services deployed from an image. This one is from {kind}." + "pyo.jsonc: image is for services deployed from an image. This one is from {kind}." ); } let (name, reference) = split_image(image); @@ -280,9 +289,13 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { ); } let b = &f.build; - if b.branch.is_some() || b.dockerfile.is_some() || b.context.is_some() || !b.args.is_empty() { + if b.branch.is_some() + || b.dockerfile_path.is_some() + || b.context.is_some() + || !b.args.is_empty() + { if kind != "git" { - bail!("pyo.toml: [build] is for services built from Git. This one is from {kind}."); + bail!("pyo.jsonc: build is for services built from Git. This one is from {kind}."); } if let Some(v) = &b.branch { set( @@ -292,7 +305,7 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { format!("branch {v}"), ); } - if let Some(v) = &b.dockerfile { + if let Some(v) = &b.dockerfile_path { set( &mut changes, &mut service["source"]["dockerfilePath"], @@ -310,14 +323,12 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { } for (key, v) in &b.args { let value = match v { - toml::Value::String(s) => s.clone(), - toml::Value::Integer(_) | toml::Value::Float(_) | toml::Value::Boolean(_) => { - v.to_string() - } - _ => bail!("pyo.toml: build argument {key} must be text, a number or true/false."), + Value::String(s) => s.clone(), + Value::Number(_) | Value::Bool(_) => v.to_string(), + _ => bail!("pyo.jsonc: build argument {key} must be text, a number or true/false."), }; if key.is_empty() || key.contains(['=', ' ']) { - bail!("pyo.toml: build argument {key:?} isn't a name."); + bail!("pyo.jsonc: build argument {key:?} isn't a name."); } let src = &mut service["source"]; if !src["buildArgs"].is_array() { @@ -344,11 +355,11 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { let d = &f.deploy; if let Some(n) = d.replicas { if n < 0 { - bail!("pyo.toml: replicas can't be below 0."); + bail!("pyo.jsonc: replicas can't be below 0."); } if n > i64::from(i32::MAX) { bail!( - "pyo.toml: that's more replicas than Kubernetes can count. The most is 2147483647." + "pyo.jsonc: that's more replicas than Kubernetes can count. The most is 2147483647." ); } set( @@ -360,7 +371,7 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { } if let Some(port) = d.port { if !(1..=65535).contains(&port) { - bail!("pyo.toml: port is 1 to 65535."); + bail!("pyo.jsonc: port is 1 to 65535."); } let ports = service["ports"] .as_array_mut() @@ -382,7 +393,7 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { let kind = match path.as_str() { "tcp" | "none" => path.as_str(), p if p.starts_with('/') => "http", - _ => bail!("pyo.toml: health is a path like \"/healthz\", or \"tcp\" or \"none\"."), + _ => bail!("pyo.jsonc: health is a path like \"/healthz\", or \"tcp\" or \"none\"."), }; let port = d .port @@ -402,9 +413,9 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { }); set(&mut changes, h, new, format!("health check {path}")); } - if let Some(serve) = &d.serve { + if let Some(serve) = &d.serve_as { if !matches!(serve.as_str(), "static" | "service") { - bail!("pyo.toml: serve is \"static\" (a static site's files) or \"service\"."); + bail!("pyo.jsonc: serveAs is \"static\" (a static site's files) or \"service\"."); } set( &mut changes, @@ -454,11 +465,9 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { for (key, v) in &f.env { let value = match v { - toml::Value::String(s) => s.clone(), - toml::Value::Integer(_) | toml::Value::Float(_) | toml::Value::Boolean(_) => { - v.to_string() - } - _ => bail!("pyo.toml: env {key} must be text, a number or true/false."), + Value::String(s) => s.clone(), + Value::Number(_) | Value::Bool(_) => v.to_string(), + _ => bail!("pyo.jsonc: env {key} must be text, a number or true/false."), }; let env = service["env"] .as_array_mut() @@ -466,7 +475,7 @@ pub fn apply(service: &mut Value, f: &ServiceFile) -> Result> { match env.iter_mut().find(|e| e["key"] == json!(key)) { Some(e) if e["secret"] == json!(true) => { eprintln!( - "{} {key} is a secret in Pyo, so pyo.toml doesn't change it.", + "{} {key} is a secret in Pyo, so pyo.jsonc doesn't change it.", ui::yellow("!") ); } @@ -1016,6 +1025,10 @@ mod tests { }) } + fn file(text: &str) -> ServiceFile { + config::parse(text).unwrap() + } + #[test] fn stages_in_words() { assert_eq!(stage_label("waiting_ready"), "Running health check"); @@ -1026,13 +1039,16 @@ mod tests { #[test] fn applies_only_whats_set() { let mut a = service(); - let f: ServiceFile = toml::from_str("[deploy]\nreplicas = 1\n").unwrap(); + let f = file(r#"{ "deploy": { "replicas": 1 } }"#); assert!(apply(&mut a, &f).unwrap().is_empty()); - let f: ServiceFile = toml::from_str( - "[deploy]\nreplicas = 3\nport = 8080\nhealth = \"/healthz\"\n[resources]\nmemory = \"128Mi\"\n[env]\nTOKEN = \"x\"\nLOG = \"info\"\n", - ) - .unwrap(); + let f = file( + r#"{ + "deploy": { "replicas": 3, "port": 8080, "health": "/healthz" }, + "resources": { "memory": "128Mi" }, + "env": { "TOKEN": "x", "LOG": "info" }, + }"#, + ); let c = apply(&mut a, &f).unwrap(); assert_eq!(a["replicas"], json!(3)); assert_eq!(a["ports"][0]["containerPort"], json!(8080)); @@ -1049,24 +1065,24 @@ mod tests { fn health_can_be_tcp_or_none() { let mut a = service(); a["healthCheck"]["auto"] = json!("static"); - let f: ServiceFile = toml::from_str("[deploy]\nhealth = \"tcp\"\n").unwrap(); + let f = file(r#"{ "deploy": { "health": "tcp" } }"#); apply(&mut a, &f).unwrap(); assert_eq!(a["healthCheck"]["type"], json!("tcp")); assert_eq!(a["healthCheck"]["port"], json!(3000)); assert!(a["healthCheck"].get("auto").is_none()); - let f: ServiceFile = toml::from_str("[deploy]\nhealth = \"none\"\n").unwrap(); + let f = file(r#"{ "deploy": { "health": "none" } }"#); apply(&mut a, &f).unwrap(); assert_eq!(a["healthCheck"]["type"], json!("none")); - let f: ServiceFile = toml::from_str("[deploy]\nhealth = \"healthz\"\n").unwrap(); + let f = file(r#"{ "deploy": { "health": "healthz" } }"#); assert!(apply(&mut a, &f).is_err()); } #[test] fn sets_build_arguments() { let mut a = service(); - let f: ServiceFile = - toml::from_str("[build.args]\nRAILPACK_SPA_OUTPUT_DIR = \"dist\"\nNODE_VERSION = 22\n") - .unwrap(); + let f = file( + r#"{ "build": { "args": { "RAILPACK_SPA_OUTPUT_DIR": "dist", "NODE_VERSION": 22 } } }"#, + ); let c = apply(&mut a, &f).unwrap(); assert_eq!(c.len(), 2); assert_eq!( @@ -1093,23 +1109,23 @@ mod tests { #[test] fn replicas_have_no_cap_but_kubernetes_limit() { let mut a = service(); - let f: ServiceFile = toml::from_str("[deploy]\nreplicas = 500\n").unwrap(); + let f = file(r#"{ "deploy": { "replicas": 500 } }"#); apply(&mut a, &f).unwrap(); assert_eq!(a["replicas"], json!(500)); - let f: ServiceFile = toml::from_str("[deploy]\nreplicas = -1\n").unwrap(); + let f = file(r#"{ "deploy": { "replicas": -1 } }"#); assert!(apply(&mut a, &f).is_err()); - let f: ServiceFile = toml::from_str("[deploy]\nreplicas = 3000000000\n").unwrap(); + let f = file(r#"{ "deploy": { "replicas": 3000000000 } }"#); assert!(apply(&mut a, &f).is_err()); } #[test] fn a_static_build_is_served_as_files_or_runs_as_a_service() { let mut a = service(); - let f: ServiceFile = toml::from_str("[deploy]\nserve = \"service\"\n").unwrap(); + let f = file(r#"{ "deploy": { "serveAs": "service" } }"#); assert_eq!(apply(&mut a, &f).unwrap(), ["serve as service"]); assert_eq!(a["serveAs"], json!("service")); assert!(apply(&mut a, &f).unwrap().is_empty()); - let f: ServiceFile = toml::from_str("[deploy]\nserve = \"files\"\n").unwrap(); + let f = file(r#"{ "deploy": { "serveAs": "files" } }"#); assert!(apply(&mut a, &f).is_err()); } From 034a6d627a722e68932390158378bb8181f0feb1 Mon Sep 17 00:00:00 2001 From: Frans Allen Date: Wed, 18 Nov 2026 19:06:23 +0700 Subject: [PATCH 2/3] docs(contributing): say how to regenerate the pyo.jsonc schema --- CONTRIBUTING.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5901443..6c9c697 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -216,6 +216,13 @@ Some pages are generated from the code, so don't edit them by hand: - **MCP tools and CLI commands:** these come from `crates/pyo-api/src/mcp.rs` and the CLI's help. Run `cargo build -p pyo-cli` here, then `bun run generate` in `pyo-docs`. +- **pyo.jsonc schema:** the JSON Schema editors use for `pyo.jsonc` comes + from the config types in `crates/pyo-cli/src/config.rs`, and their doc + comments are its descriptions. Regenerate it with + `PYO_WRITE_SCHEMA=1 cargo test -p pyo-cli schema`, which writes it to + `../pyo-docs/schema/pyo.json`. pyo.dev serves it at + `https://pyo.dev/schema/pyo.json`. Like the API reference, `cargo test` + fails if that copy is out of date. See [RELEASING.md](RELEASING.md#api-reference) for details. From 0ca8d6e1f318442004229626d0551e7c29a0d2e3 Mon Sep 17 00:00:00 2001 From: Frans Allen Date: Wed, 18 Nov 2026 21:25:09 +0700 Subject: [PATCH 3/3] chore(release): 0.4.4 --- Cargo.lock | 24 ++++++++++++------------ Cargo.toml | 2 +- crates/pyo-agent/Cargo.toml | 2 +- crates/pyo-api/Cargo.toml | 2 +- crates/pyo-builder/Cargo.toml | 2 +- crates/pyo-cli/Cargo.toml | 2 +- crates/pyo-envd/Cargo.toml | 2 +- crates/pyo-flows/Cargo.toml | 2 +- crates/pyo-sandbox/Cargo.toml | 2 +- crates/pyo-static/Cargo.toml | 2 +- deploy/release-notices.json | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8be571c..6ae052a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3354,7 +3354,7 @@ dependencies = [ [[package]] name = "pyo-agent" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "base64 0.23.1", @@ -3375,7 +3375,7 @@ dependencies = [ [[package]] name = "pyo-api" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "argon2 0.6.0", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "pyo-builder" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "base64 0.23.1", @@ -3443,7 +3443,7 @@ dependencies = [ [[package]] name = "pyo-cli" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "clap", @@ -3466,7 +3466,7 @@ dependencies = [ [[package]] name = "pyo-db-controller" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "base64 0.23.1", @@ -3488,7 +3488,7 @@ dependencies = [ [[package]] name = "pyo-envd" -version = "0.4.3" +version = "0.4.4" dependencies = [ "libc", "pyo-proto", @@ -3497,7 +3497,7 @@ dependencies = [ [[package]] name = "pyo-flows" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "libc", @@ -3511,7 +3511,7 @@ dependencies = [ [[package]] name = "pyo-kv" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "axum", @@ -3528,7 +3528,7 @@ dependencies = [ [[package]] name = "pyo-proto" -version = "0.4.3" +version = "0.4.4" dependencies = [ "base64 0.23.1", "regex", @@ -3542,7 +3542,7 @@ dependencies = [ [[package]] name = "pyo-resp" -version = "0.4.3" +version = "0.4.4" dependencies = [ "futures", "socket2", @@ -3551,7 +3551,7 @@ dependencies = [ [[package]] name = "pyo-sandbox" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "axum", @@ -3581,7 +3581,7 @@ dependencies = [ [[package]] name = "pyo-static" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "axum", diff --git a/Cargo.toml b/Cargo.toml index 12bb862..3ae91e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = ["crates/pyo-proto", "crates/pyo-api", "crates/pyo-agent", "crates/pyo-builder", "crates/pyo-cli", "crates/pyo-flows", "crates/pyo-resp", "crates/pyo-kv", "crates/pyo-db-controller", "crates/pyo-static", "crates/pyo-envd", "crates/pyo-sandbox"] [workspace.package] -version = "0.4.3" +version = "0.4.4" edition = "2024" license = "Apache-2.0" publish = false diff --git a/crates/pyo-agent/Cargo.toml b/crates/pyo-agent/Cargo.toml index b27f21e..b2f9c74 100644 --- a/crates/pyo-agent/Cargo.toml +++ b/crates/pyo-agent/Cargo.toml @@ -7,7 +7,7 @@ publish.workspace = true [dependencies] anyhow = "1.0.104" -pyo-proto = { version = "0.4.3", path = "../pyo-proto" } +pyo-proto = { version = "0.4.4", path = "../pyo-proto" } futures = "0.3.34" http = "1.5.0" k8s-openapi = { version = "0.28.0", features = ["latest"] } diff --git a/crates/pyo-api/Cargo.toml b/crates/pyo-api/Cargo.toml index 4fe63c5..43ab97a 100644 --- a/crates/pyo-api/Cargo.toml +++ b/crates/pyo-api/Cargo.toml @@ -12,7 +12,7 @@ axum = { version = "0.8.9", features = ["ws"] } axum-extra = { version = "0.12.6", features = ["cookie", "typed-header"] } base64 = "0.23.1" cookie = "0.18" -pyo-proto = { version = "0.4.3", path = "../pyo-proto", features = ["openapi", "sandbox-token"] } +pyo-proto = { version = "0.4.4", path = "../pyo-proto", features = ["openapi", "sandbox-token"] } hex = "0.4.3" hmac = "0.13.0" hyper = { version = "1.12.0", features = ["client", "http1"] } diff --git a/crates/pyo-builder/Cargo.toml b/crates/pyo-builder/Cargo.toml index 74e0524..4bdeb4e 100644 --- a/crates/pyo-builder/Cargo.toml +++ b/crates/pyo-builder/Cargo.toml @@ -10,7 +10,7 @@ anyhow = "1.0.104" base64 = "0.23.1" futures = "0.3.34" hex = "0.4.3" -pyo-proto = { version = "0.4.3", path = "../pyo-proto" } +pyo-proto = { version = "0.4.4", path = "../pyo-proto" } reqwest = { version = "0.13.5", default-features = false, features = ["json", "rustls", "stream"] } serde = "1.0.229" serde_json = "1.0.154" diff --git a/crates/pyo-cli/Cargo.toml b/crates/pyo-cli/Cargo.toml index 264a250..de2b65e 100644 --- a/crates/pyo-cli/Cargo.toml +++ b/crates/pyo-cli/Cargo.toml @@ -26,7 +26,7 @@ sha2 = "0.11.1" tokio = { version = "1.54.1", features = ["rt-multi-thread", "macros", "net", "io-util", "io-std", "time", "sync", "fs"] } tokio-tungstenite = { version = "0.29", features = ["rustls-tls-native-roots"] } toml = "0.9" -pyo-proto = { version = "0.4.3", path = "../pyo-proto" } +pyo-proto = { version = "0.4.4", path = "../pyo-proto" } [dev-dependencies] # The JSON Schema of pyo.jsonc, written from the config types by a test. diff --git a/crates/pyo-envd/Cargo.toml b/crates/pyo-envd/Cargo.toml index 48eabdb..ffaf419 100644 --- a/crates/pyo-envd/Cargo.toml +++ b/crates/pyo-envd/Cargo.toml @@ -12,5 +12,5 @@ publish.workspace = true [dependencies] libc = "0.2.191" -pyo-proto = { version = "0.4.3", path = "../pyo-proto" } +pyo-proto = { version = "0.4.4", path = "../pyo-proto" } serde_json.workspace = true diff --git a/crates/pyo-flows/Cargo.toml b/crates/pyo-flows/Cargo.toml index 958aab3..ce0c66f 100644 --- a/crates/pyo-flows/Cargo.toml +++ b/crates/pyo-flows/Cargo.toml @@ -8,7 +8,7 @@ publish.workspace = true [dependencies] anyhow = "1.0.104" libc = "0.2.191" -pyo-proto = { version = "0.4.3", path = "../pyo-proto" } +pyo-proto = { version = "0.4.4", path = "../pyo-proto" } reqwest = { version = "0.13.5", default-features = false, features = ["json", "rustls"] } serde_json = "1.0.154" tokio = { version = "1.54.1", features = ["rt-multi-thread", "macros", "time", "sync"] } diff --git a/crates/pyo-sandbox/Cargo.toml b/crates/pyo-sandbox/Cargo.toml index c83c6a1..d716f3d 100644 --- a/crates/pyo-sandbox/Cargo.toml +++ b/crates/pyo-sandbox/Cargo.toml @@ -16,7 +16,7 @@ http-body-util = "0.1.5" hyper = { version = "1.12.0", features = ["client", "http1", "server"] } hyper-util = { version = "0.1.21", features = ["tokio"] } libc = "0.2.191" -pyo-proto = { version = "0.4.3", path = "../pyo-proto", features = ["sandbox-token"] } +pyo-proto = { version = "0.4.4", path = "../pyo-proto", features = ["sandbox-token"] } serde.workspace = true serde_json.workspace = true tokio.workspace = true diff --git a/crates/pyo-static/Cargo.toml b/crates/pyo-static/Cargo.toml index 8708aa9..77aa477 100644 --- a/crates/pyo-static/Cargo.toml +++ b/crates/pyo-static/Cargo.toml @@ -11,7 +11,7 @@ anyhow.workspace = true axum = { version = "0.8.9", default-features = false, features = ["http1", "tokio", "json"] } futures.workspace = true hex = "0.4.3" -pyo-proto = { version = "0.4.3", path = "../pyo-proto" } +pyo-proto = { version = "0.4.4", path = "../pyo-proto" } reqwest = { version = "0.13.5", default-features = false, features = ["json", "rustls", "stream"] } serde.workspace = true serde_json.workspace = true diff --git a/deploy/release-notices.json b/deploy/release-notices.json index bd05518..217ad87 100644 --- a/deploy/release-notices.json +++ b/deploy/release-notices.json @@ -1,5 +1,5 @@ { - "version": "0.4.3", + "version": "0.4.4", "minFrom": null, "manualOnly": false, "beforeYouUpdate": []