From c47f764ae276811db697dcd92d55165157e4b214 Mon Sep 17 00:00:00 2001 From: Greg Schoeninger Date: Mon, 11 Mar 2024 17:18:00 -0700 Subject: [PATCH] fix scheme in create_repo call --- oxen/python/oxen/remote_repo.py | 4 ++-- oxen/src/py_remote_repo.rs | 2 ++ oxen/src/remote.rs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/oxen/python/oxen/remote_repo.py b/oxen/python/oxen/remote_repo.py index d509d06..bbe991d 100644 --- a/oxen/python/oxen/remote_repo.py +++ b/oxen/python/oxen/remote_repo.py @@ -113,6 +113,8 @@ def __init__( The host to connect to. Defaults to 'hub.oxen.ai' revision: `str` The branch name or commit id to checkout. Defaults to 'main' + scheme: `str` + The scheme to use for the remote url. Default: 'https' """ if host is None: host = "hub.oxen.ai" @@ -131,8 +133,6 @@ def create(self, empty: bool = False, is_public: bool = False): Whether to create an empty repo or not. Default: False is_public: `bool` Whether the repository is public or private. Default: False - scheme: `str` - The scheme to use for the remote url. Default: 'https' """ self._repo.create(empty, is_public) diff --git a/oxen/src/py_remote_repo.rs b/oxen/src/py_remote_repo.rs index 97336eb..6e89548 100644 --- a/oxen/src/py_remote_repo.rs +++ b/oxen/src/py_remote_repo.rs @@ -21,6 +21,7 @@ use crate::py_paginated_dir_entries::PyPaginatedDirEntries; #[pyclass] pub struct PyRemoteRepo { pub repo: RemoteRepository, + #[pyo3(get)] pub host: String, #[pyo3(get)] pub revision: String, @@ -107,6 +108,7 @@ impl PyRemoteRepo { user: user.clone() }]; let mut repo = RepoNew::from_files(&self.repo.namespace, &self.repo.name, files); + repo.host = Some(self.host.clone()); repo.is_public = Some(is_public); repo.scheme = Some(self.scheme.clone()); api::remote::repositories::create(repo).await diff --git a/oxen/src/remote.rs b/oxen/src/remote.rs index 057f501..7652a0f 100644 --- a/oxen/src/remote.rs +++ b/oxen/src/remote.rs @@ -58,6 +58,7 @@ pub fn create_repo( repo.description = Some(description); } repo.is_public = Some(is_public); + repo.scheme = Some(scheme.clone()); liboxen::api::remote::repositories::create_empty(repo).await } else { @@ -73,6 +74,7 @@ pub fn create_repo( repo.description = Some(description); } repo.is_public = Some(is_public); + repo.scheme = Some(scheme.clone()); liboxen::api::remote::repositories::create(repo).await }