diff --git a/oxen/Cargo.lock b/oxen/Cargo.lock index 2c6cc31..e51864b 100644 --- a/oxen/Cargo.lock +++ b/oxen/Cargo.lock @@ -3065,9 +3065,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "liboxen" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278dec93798898bcb0ca4f135642099ae5d35850b594aa50e6e19d9482efd97d" +checksum = "ff3a79a9597b91659b8f54b40449abb45394d997bfaf9b8bb8c8966e81295ad8" dependencies = [ "actix-files", "actix-web", @@ -3746,7 +3746,7 @@ dependencies = [ [[package]] name = "oxen" -version = "0.18.1" +version = "0.18.2" dependencies = [ "bindgen 0.70.1", "cc", diff --git a/oxen/Cargo.toml b/oxen/Cargo.toml index a2d6d6c..56bcfce 100644 --- a/oxen/Cargo.toml +++ b/oxen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oxen" -version = "0.18.1" +version = "0.18.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -28,7 +28,7 @@ polars = { version = "0.44.0", features = [ ] } serde_json = "1.0.106" uuid = { version = "1.4.1", features = ["serde", "v4"] } -liboxen = "0.24.0" +liboxen = "0.24.1" # liboxen = { path = "../../Oxen/src/lib" } [build-dependencies] diff --git a/oxen/src/py_workspace.rs b/oxen/src/py_workspace.rs index 878b579..9a4dcaf 100644 --- a/oxen/src/py_workspace.rs +++ b/oxen/src/py_workspace.rs @@ -30,6 +30,19 @@ impl PyWorkspace { ) -> Result { let name = name.unwrap_or_else(|| format!("workspace-{}", Uuid::new_v4())); + // Get the workspace by name + let workspace = pyo3_asyncio::tokio::get_runtime().block_on(async { + api::client::workspaces::get_by_name(&repo.repo, &name).await + })?; + + if let Some(workspace) = workspace { + return Ok(Self { + repo, + branch_name: branch_name.clone(), + id: workspace.id, + }); + } + let workspace = pyo3_asyncio::tokio::get_runtime().block_on(async { api::client::workspaces::create_with_path( &repo.repo,