Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/oxen-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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_py" # The native extension module. Users still `import oxen` via the Python package wrapper.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the problem we're fixing. The cli also produces an oxen artifact, which won't be allowed in the same workspace in the future.

crate-type = ["cdylib"] # PyO3 needs this crate to be a cdylib so it can link against it.

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/oxen-py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
1 change: 1 addition & 0 deletions oxen-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ build-backend = "maturin"

[tool.maturin]
manifest-path = "../crates/oxen-py/Cargo.toml"
module-name = "oxen.oxen_py"
python-source = "python"
features = ["pyo3/extension-module"]
4 changes: 2 additions & 2 deletions oxen-python/python/oxen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Core Oxen Functionality"""

# Rust wrappers
from .oxen import (
from .oxen_py import (
PyRepo,
PyStagedData,
PyCommit,
Expand All @@ -13,7 +13,7 @@
PyColumn,
__version__,
)
from .oxen import util
from .oxen_py import util

# Python classes
from oxen.repo import Repo
Expand Down
2 changes: 1 addition & 1 deletion oxen-python/python/oxen/auth.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion oxen-python/python/oxen/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .oxen import util
from .oxen_py import util
import os


Expand Down
2 changes: 1 addition & 1 deletion oxen-python/python/oxen/data_frame.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion oxen-python/python/oxen/df_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
```
"""

from .oxen import df_utils
from .oxen_py import df_utils

import os
from polars import DataFrame
Expand Down
8 changes: 4 additions & 4 deletions oxen-python/python/oxen/diff/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions oxen-python/python/oxen/diff/line_diff.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ..oxen import PyLineDiff, PyChangeType

from oxen.diff.change_type import ChangeType

from ..oxen_py import PyChangeType, PyLineDiff


class LineDiff:
"""
Expand Down
4 changes: 2 additions & 2 deletions oxen-python/python/oxen/diff/tabular_diff.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ..oxen import PyTabularDiff

from polars import DataFrame

from ..oxen_py import PyTabularDiff


class TabularDiff:
"""
Expand Down
4 changes: 2 additions & 2 deletions oxen-python/python/oxen/diff/text_diff.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ..oxen import PyTextDiff, PyChangeType

from oxen.diff.line_diff import LineDiff

from ..oxen_py import PyChangeType, PyTextDiff


class TextDiff:
"""
Expand Down
2 changes: 1 addition & 1 deletion oxen-python/python/oxen/oxen_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
2 changes: 1 addition & 1 deletion oxen-python/python/oxen/remote_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion oxen-python/python/oxen/user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .oxen import user, util
from .oxen_py import user, util
from typing import Optional
import os

Expand Down
2 changes: 1 addition & 1 deletion oxen-python/python/oxen/workspace.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
16 changes: 4 additions & 12 deletions oxen-python/tests/test_data_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Comment on lines 16 to -20
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests were hard-coded to port 3000, but other tests already support running against any port, so we switch to using the same pattern on these ones as well.

)
_width, og_height = df.size()

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
)

Expand Down Expand Up @@ -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
Expand Down
Loading