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 lib/src/ontology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl OntologyLocation {
OntologyLocation::File(p) => {
// Use the Url crate, just like in the Display impl
let iri = Url::from_file_path(p)
.expect("Failed to create file URL for IRI")
.expect("Failed to create file URL for IRI. Try removing .ontoenv folder as it may contain corrupted or improperly formatted file paths. Then recreate the environment.")
.to_string();
NamedNode::new(iri).unwrap()
}
Expand Down
4 changes: 2 additions & 2 deletions python/ontoenv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Python package shim for the ontoenv extension."""

# These symbols come from the Rust extension module built via maturin.
from ._native import OntoEnv, Ontology, run_cli, version # type: ignore[attr-defined]
from . import _native as _ext # type: ignore[attr-defined]
from ontoenv._native import OntoEnv, Ontology, run_cli, version # type: ignore[attr-defined]
from ontoenv import _native as _ext # type: ignore[attr-defined]

__doc__ = getattr(_ext, "__doc__", None) # type: ignore[assignment]

Expand Down
2 changes: 1 addition & 1 deletion python/ontoenv/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys

from .ontoenv import run_cli as _run_cli
from ontoenv import run_cli as _run_cli


def main(argv: list[str] | None = None) -> int:
Expand Down
2 changes: 1 addition & 1 deletion python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl OntoEnv {
if path.is_none() && root == "." && !recreate && !temporary {
// Use forward slashes for cross-platform compatibility in error messages
return Err(PyValueError::new_err(
"OntoEnv directory not found at: \"./.ontoenv\""
"You must provide a valid path or set recreate=True or temporary=True to create a new OntoEnv.",
));
}
let mut root_path = path.clone().unwrap_or_else(|| PathBuf::from(root));
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_ontoenv_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_init_no_config_no_path_error(self):
os.remove(".ontoenv")
else:
shutil.rmtree(".ontoenv")
with self.assertRaisesRegex(ValueError, "OntoEnv directory not found at: \"./.ontoenv\""):
with self.assertRaisesRegex(ValueError, "You must provide a valid path or set recreate=True or temporary=True to create a new OntoEnv."):
OntoEnv() # No args

def test_init_path_no_env_error(self):
Expand Down