From 8f4a5db96d2b217a1446f8a434a222a7eb279900 Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Fri, 27 Mar 2026 15:35:57 -0600 Subject: [PATCH 1/5] use a unique python name to avoid the warning from Cargo that the cli and oxen-py produce an artifact with the same name that will be disallowed in the future --- crates/oxen-py/Cargo.toml | 2 +- crates/oxen-py/src/lib.rs | 2 +- oxen-python/python/oxen/__init__.py | 4 ++-- oxen-python/python/oxen/auth.py | 2 +- oxen-python/python/oxen/config.py | 2 +- oxen-python/python/oxen/data_frame.py | 2 +- oxen-python/python/oxen/df_utils.py | 2 +- oxen-python/python/oxen/oxen_fs.py | 2 +- oxen-python/python/oxen/remote_repo.py | 2 +- oxen-python/python/oxen/user.py | 2 +- oxen-python/python/oxen/workspace.py | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/oxen-py/Cargo.toml b/crates/oxen-py/Cargo.toml index 05ddd7c51..bd4d373a3 100644 --- a/crates/oxen-py/Cargo.toml +++ b/crates/oxen-py/Cargo.toml @@ -11,7 +11,7 @@ keywords = { workspace = true } publish = false [lib] -name = "oxen" # Necessary so that we can import the crate as `import oxen` in Python. +name = "_oxen" # The native extension module. Users still `import oxen` via the Python package wrapper. crate-type = ["cdylib"] # PyO3 needs this crate to be a cdylib so it can link against it. [dependencies] diff --git a/crates/oxen-py/src/lib.rs b/crates/oxen-py/src/lib.rs index d81dff009..ca75a8735 100644 --- a/crates/oxen-py/src/lib.rs +++ b/crates/oxen-py/src/lib.rs @@ -28,7 +28,7 @@ pub mod util; /// A Python module implemented in Rust. #[pymodule] -fn oxen(m: Bound<'_, PyModule>) -> PyResult<()> { +fn _oxen(m: Bound<'_, PyModule>) -> PyResult<()> { let py_version = Python::version_info(m.py()); let _ = RuntimeConfig::set( String::from("Python"), diff --git a/oxen-python/python/oxen/__init__.py b/oxen-python/python/oxen/__init__.py index cad71ba9d..ac7380faf 100644 --- a/oxen-python/python/oxen/__init__.py +++ b/oxen-python/python/oxen/__init__.py @@ -1,7 +1,7 @@ """Core Oxen Functionality""" # Rust wrappers -from .oxen import ( +from ._oxen import ( PyRepo, PyStagedData, PyCommit, @@ -13,7 +13,7 @@ PyColumn, __version__, ) -from .oxen import util +from ._oxen import util # Python classes from oxen.repo import Repo diff --git a/oxen-python/python/oxen/auth.py b/oxen-python/python/oxen/auth.py index 9bbedcf4f..f8e17a3c6 100644 --- a/oxen-python/python/oxen/auth.py +++ b/oxen-python/python/oxen/auth.py @@ -1,4 +1,4 @@ -from .oxen import auth, util +from ._oxen import auth, util from oxen.user import config_user from typing import Optional import os diff --git a/oxen-python/python/oxen/config.py b/oxen-python/python/oxen/config.py index 86070be12..487648257 100644 --- a/oxen-python/python/oxen/config.py +++ b/oxen-python/python/oxen/config.py @@ -1,4 +1,4 @@ -from .oxen import util +from ._oxen import util import os diff --git a/oxen-python/python/oxen/data_frame.py b/oxen-python/python/oxen/data_frame.py index cd612a31a..fd92699a9 100644 --- a/oxen-python/python/oxen/data_frame.py +++ b/oxen-python/python/oxen/data_frame.py @@ -1,6 +1,6 @@ from oxen.workspace import Workspace from oxen.remote_repo import RemoteRepo -from .oxen import PyWorkspaceDataFrame, PyColumn +from ._oxen import PyWorkspaceDataFrame, PyColumn import json from typing import List, Union, Optional import os diff --git a/oxen-python/python/oxen/df_utils.py b/oxen-python/python/oxen/df_utils.py index aec8f9ef1..c9d2b488b 100644 --- a/oxen-python/python/oxen/df_utils.py +++ b/oxen-python/python/oxen/df_utils.py @@ -17,7 +17,7 @@ ``` """ -from .oxen import df_utils +from ._oxen import df_utils import os from polars import DataFrame diff --git a/oxen-python/python/oxen/oxen_fs.py b/oxen-python/python/oxen/oxen_fs.py index fd31d8db4..054828bde 100644 --- a/oxen-python/python/oxen/oxen_fs.py +++ b/oxen-python/python/oxen/oxen_fs.py @@ -9,7 +9,7 @@ from fsspec.utils import infer_storage_options from .remote_repo import RemoteRepo -from .oxen import PyEntry +from ._oxen import PyEntry logger = logging.getLogger(__name__) diff --git a/oxen-python/python/oxen/remote_repo.py b/oxen-python/python/oxen/remote_repo.py index 0b25f3899..e9adfc6f1 100644 --- a/oxen-python/python/oxen/remote_repo.py +++ b/oxen-python/python/oxen/remote_repo.py @@ -2,7 +2,7 @@ from typing import Optional from typing import List, Tuple -from .oxen import PyRemoteRepo, remote, PyCommit +from ._oxen import PyRemoteRepo, remote, PyCommit from . import user as oxen_user from .workspace import Workspace diff --git a/oxen-python/python/oxen/user.py b/oxen-python/python/oxen/user.py index db7f08ed7..f046d4a95 100644 --- a/oxen-python/python/oxen/user.py +++ b/oxen-python/python/oxen/user.py @@ -1,4 +1,4 @@ -from .oxen import user, util +from ._oxen import user, util from typing import Optional import os diff --git a/oxen-python/python/oxen/workspace.py b/oxen-python/python/oxen/workspace.py index 98abae7d8..9e6463ccd 100644 --- a/oxen-python/python/oxen/workspace.py +++ b/oxen-python/python/oxen/workspace.py @@ -1,7 +1,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Iterable, Iterator, Optional -from .oxen import PyCommit, PyErrorFileInfo, PyWorkspace +from ._oxen import PyCommit, PyErrorFileInfo, PyWorkspace # Use TYPE_CHECKING for type hints to avoid runtime circular imports if TYPE_CHECKING: From 52f29799b10be1b18bb97bef8f4f501f6fde593f Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Mon, 30 Mar 2026 11:06:58 -0600 Subject: [PATCH 2/5] point maturin to the renamed rust module --- oxen-python/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/oxen-python/pyproject.toml b/oxen-python/pyproject.toml index ef7e513cc..f2a4300dd 100644 --- a/oxen-python/pyproject.toml +++ b/oxen-python/pyproject.toml @@ -40,5 +40,6 @@ build-backend = "maturin" [tool.maturin] manifest-path = "../crates/oxen-py/Cargo.toml" +module-name = "oxen._oxen" python-source = "python" features = ["pyo3/extension-module"] From b31a1ec894840614a440fad1a552f19272afa40f Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Mon, 30 Mar 2026 11:08:41 -0600 Subject: [PATCH 3/5] use oxen_py instead of _oxen --- crates/oxen-py/Cargo.toml | 2 +- crates/oxen-py/src/lib.rs | 2 +- oxen-python/pyproject.toml | 2 +- oxen-python/python/oxen/__init__.py | 4 ++-- oxen-python/python/oxen/auth.py | 2 +- oxen-python/python/oxen/config.py | 2 +- oxen-python/python/oxen/data_frame.py | 2 +- oxen-python/python/oxen/df_utils.py | 2 +- oxen-python/python/oxen/oxen_fs.py | 2 +- oxen-python/python/oxen/remote_repo.py | 2 +- oxen-python/python/oxen/user.py | 2 +- oxen-python/python/oxen/workspace.py | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/oxen-py/Cargo.toml b/crates/oxen-py/Cargo.toml index bd4d373a3..435eb46e5 100644 --- a/crates/oxen-py/Cargo.toml +++ b/crates/oxen-py/Cargo.toml @@ -11,7 +11,7 @@ keywords = { workspace = true } publish = false [lib] -name = "_oxen" # The native extension module. Users still `import oxen` via the Python package wrapper. +name = "oxen_py" # The native extension module. Users still `import oxen` via the Python package wrapper. crate-type = ["cdylib"] # PyO3 needs this crate to be a cdylib so it can link against it. [dependencies] diff --git a/crates/oxen-py/src/lib.rs b/crates/oxen-py/src/lib.rs index ca75a8735..4e7ee7e54 100644 --- a/crates/oxen-py/src/lib.rs +++ b/crates/oxen-py/src/lib.rs @@ -28,7 +28,7 @@ pub mod util; /// A Python module implemented in Rust. #[pymodule] -fn _oxen(m: Bound<'_, PyModule>) -> PyResult<()> { +fn oxen_py(m: Bound<'_, PyModule>) -> PyResult<()> { let py_version = Python::version_info(m.py()); let _ = RuntimeConfig::set( String::from("Python"), diff --git a/oxen-python/pyproject.toml b/oxen-python/pyproject.toml index f2a4300dd..2aa35e2b1 100644 --- a/oxen-python/pyproject.toml +++ b/oxen-python/pyproject.toml @@ -40,6 +40,6 @@ build-backend = "maturin" [tool.maturin] manifest-path = "../crates/oxen-py/Cargo.toml" -module-name = "oxen._oxen" +module-name = "oxen.oxen_py" python-source = "python" features = ["pyo3/extension-module"] diff --git a/oxen-python/python/oxen/__init__.py b/oxen-python/python/oxen/__init__.py index ac7380faf..1bd38bc30 100644 --- a/oxen-python/python/oxen/__init__.py +++ b/oxen-python/python/oxen/__init__.py @@ -1,7 +1,7 @@ """Core Oxen Functionality""" # Rust wrappers -from ._oxen import ( +from .oxen_py import ( PyRepo, PyStagedData, PyCommit, @@ -13,7 +13,7 @@ PyColumn, __version__, ) -from ._oxen import util +from .oxen_py import util # Python classes from oxen.repo import Repo diff --git a/oxen-python/python/oxen/auth.py b/oxen-python/python/oxen/auth.py index f8e17a3c6..92b161212 100644 --- a/oxen-python/python/oxen/auth.py +++ b/oxen-python/python/oxen/auth.py @@ -1,4 +1,4 @@ -from ._oxen import auth, util +from .oxen_py import auth, util from oxen.user import config_user from typing import Optional import os diff --git a/oxen-python/python/oxen/config.py b/oxen-python/python/oxen/config.py index 487648257..1d4406334 100644 --- a/oxen-python/python/oxen/config.py +++ b/oxen-python/python/oxen/config.py @@ -1,4 +1,4 @@ -from ._oxen import util +from .oxen_py import util import os diff --git a/oxen-python/python/oxen/data_frame.py b/oxen-python/python/oxen/data_frame.py index fd92699a9..40f81681c 100644 --- a/oxen-python/python/oxen/data_frame.py +++ b/oxen-python/python/oxen/data_frame.py @@ -1,6 +1,6 @@ from oxen.workspace import Workspace from oxen.remote_repo import RemoteRepo -from ._oxen import PyWorkspaceDataFrame, PyColumn +from .oxen_py import PyWorkspaceDataFrame, PyColumn import json from typing import List, Union, Optional import os diff --git a/oxen-python/python/oxen/df_utils.py b/oxen-python/python/oxen/df_utils.py index c9d2b488b..3532fca75 100644 --- a/oxen-python/python/oxen/df_utils.py +++ b/oxen-python/python/oxen/df_utils.py @@ -17,7 +17,7 @@ ``` """ -from ._oxen import df_utils +from .oxen_py import df_utils import os from polars import DataFrame diff --git a/oxen-python/python/oxen/oxen_fs.py b/oxen-python/python/oxen/oxen_fs.py index 054828bde..eee8077e6 100644 --- a/oxen-python/python/oxen/oxen_fs.py +++ b/oxen-python/python/oxen/oxen_fs.py @@ -9,7 +9,7 @@ from fsspec.utils import infer_storage_options from .remote_repo import RemoteRepo -from ._oxen import PyEntry +from .oxen_py import PyEntry logger = logging.getLogger(__name__) diff --git a/oxen-python/python/oxen/remote_repo.py b/oxen-python/python/oxen/remote_repo.py index e9adfc6f1..97fe86383 100644 --- a/oxen-python/python/oxen/remote_repo.py +++ b/oxen-python/python/oxen/remote_repo.py @@ -2,7 +2,7 @@ from typing import Optional from typing import List, Tuple -from ._oxen import PyRemoteRepo, remote, PyCommit +from .oxen_py import PyRemoteRepo, remote, PyCommit from . import user as oxen_user from .workspace import Workspace diff --git a/oxen-python/python/oxen/user.py b/oxen-python/python/oxen/user.py index f046d4a95..db2f7119e 100644 --- a/oxen-python/python/oxen/user.py +++ b/oxen-python/python/oxen/user.py @@ -1,4 +1,4 @@ -from ._oxen import user, util +from .oxen_py import user, util from typing import Optional import os diff --git a/oxen-python/python/oxen/workspace.py b/oxen-python/python/oxen/workspace.py index 9e6463ccd..2d6e5f2ab 100644 --- a/oxen-python/python/oxen/workspace.py +++ b/oxen-python/python/oxen/workspace.py @@ -1,7 +1,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Iterable, Iterator, Optional -from ._oxen import PyCommit, PyErrorFileInfo, PyWorkspace +from .oxen_py import PyCommit, PyErrorFileInfo, PyWorkspace # Use TYPE_CHECKING for type hints to avoid runtime circular imports if TYPE_CHECKING: From c6b4258909a7c5afd2e37c8f846f0b5bdf75057a Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Mon, 30 Mar 2026 11:47:21 -0600 Subject: [PATCH 4/5] fix import paths --- oxen-python/python/oxen/diff/diff.py | 8 ++++---- oxen-python/python/oxen/diff/line_diff.py | 4 ++-- oxen-python/python/oxen/diff/tabular_diff.py | 4 ++-- oxen-python/python/oxen/diff/text_diff.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/oxen-python/python/oxen/diff/diff.py b/oxen-python/python/oxen/diff/diff.py index db39fb769..b630afdbd 100644 --- a/oxen-python/python/oxen/diff/diff.py +++ b/oxen-python/python/oxen/diff/diff.py @@ -36,15 +36,15 @@ """ -from ..oxen import PyDiff -from ..oxen import diff as py_diff +import os +from typing import Optional from oxen import df_utils from oxen.diff.tabular_diff import TabularDiff from oxen.diff.text_diff import TextDiff -import os -from typing import Optional +from ..oxen_py import PyDiff +from ..oxen_py import diff as py_diff def diff( diff --git a/oxen-python/python/oxen/diff/line_diff.py b/oxen-python/python/oxen/diff/line_diff.py index 6891b51c0..ae83caf28 100644 --- a/oxen-python/python/oxen/diff/line_diff.py +++ b/oxen-python/python/oxen/diff/line_diff.py @@ -1,7 +1,7 @@ -from ..oxen import PyLineDiff, PyChangeType - from oxen.diff.change_type import ChangeType +from ..oxen_py import PyChangeType, PyLineDiff + class LineDiff: """ diff --git a/oxen-python/python/oxen/diff/tabular_diff.py b/oxen-python/python/oxen/diff/tabular_diff.py index 7a0709816..7119bdf52 100644 --- a/oxen-python/python/oxen/diff/tabular_diff.py +++ b/oxen-python/python/oxen/diff/tabular_diff.py @@ -1,7 +1,7 @@ -from ..oxen import PyTabularDiff - from polars import DataFrame +from ..oxen_py import PyTabularDiff + class TabularDiff: """ diff --git a/oxen-python/python/oxen/diff/text_diff.py b/oxen-python/python/oxen/diff/text_diff.py index bea7bfaaf..fe8f492b0 100644 --- a/oxen-python/python/oxen/diff/text_diff.py +++ b/oxen-python/python/oxen/diff/text_diff.py @@ -1,7 +1,7 @@ -from ..oxen import PyTextDiff, PyChangeType - from oxen.diff.line_diff import LineDiff +from ..oxen_py import PyChangeType, PyTextDiff + class TextDiff: """ From 11e6ec0120beae567688c17f8e9c0ba0a463ea00 Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Mon, 30 Mar 2026 11:48:00 -0600 Subject: [PATCH 5/5] fix python tests which had hard-coded oxen-server port --- oxen-python/tests/test_data_frame.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/oxen-python/tests/test_data_frame.py b/oxen-python/tests/test_data_frame.py index 34eaed315..fec25425e 100644 --- a/oxen-python/tests/test_data_frame.py +++ b/oxen-python/tests/test_data_frame.py @@ -14,10 +14,8 @@ def test_data_frame_crud(celeba_remote_repo_fully_pushed): train_path = str(PurePath("annotations", "train.csv")) df = DataFrame( - remote_repo.identifier, + remote_repo, train_path, - host="localhost:3000", - scheme="http", ) _width, og_height = df.size() @@ -51,10 +49,8 @@ def test_data_frame_create_on_insert(celeba_remote_repo_fully_pushed): } df = DataFrame( - remote_repo.identifier, + remote_repo, new_file, - host="localhost:3000", - scheme="http", ) # Add a row and commit @@ -94,10 +90,8 @@ def test_data_frame_create_on_insert_on_branch(celeba_remote_repo_fully_pushed): } df = DataFrame( - remote_repo.identifier, + remote_repo, new_file, - host="localhost:3000", - scheme="http", branch="test-branch", ) @@ -177,10 +171,8 @@ def test_data_frame_commit(celeba_remote_repo_fully_pushed): train_path = str(PurePath("annotations", "train.csv")) df = DataFrame( - remote_repo.identifier, + remote_repo, train_path, - host="localhost:3000", - scheme="http", ) # List commits before