Skip to content

Commit f21294c

Browse files
committed
try different flag behavior
1 parent bbf9dc7 commit f21294c

File tree

7 files changed

+27
-25
lines changed

7 files changed

+27
-25
lines changed

.github/workflows/artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515

1616
jobs:
1717
binary_linux:
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-24.04
1919
steps:
2020
- uses: actions/checkout@v4
2121
with:

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ members = [
77
resolver = "2"
88

99
[workspace.package]
10-
version = "0.2.0-a6"
10+
version = "0.2.0-a7"
1111
authors = ["Gabe Fierro <[email protected]>"]
1212
license = "BSD-3-Clause"
1313
edition = "2021"
@@ -35,7 +35,7 @@ clap = { version = "4.4.18", features = ["derive"] }
3535
derive_builder = "0.20"
3636
oxigraph = "0.4.4"
3737

38-
ontoenv = { version = "0.2.0-a6", path = "lib" }
38+
ontoenv = { version = "0.2.0-a7", path = "lib" }
3939

4040
[profile.profiling]
4141
inherits = "release"

lib/src/api.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ impl OntoEnv {
175175
true => Box::new(crate::io::ReadOnlyPersistentGraphIO::new(
176176
ontoenv_dir.into(),
177177
config.offline,
178-
config.strict,
179178
)?),
180179
false => Box::new(crate::io::PersistentGraphIO::new(
181180
ontoenv_dir.into(),

lib/src/io.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,18 +270,16 @@ impl GraphIO for PersistentGraphIO {
270270
pub struct ReadOnlyPersistentGraphIO {
271271
store: Store,
272272
offline: bool,
273-
strict: bool,
274273
store_path: PathBuf,
275274
}
276275

277276
impl ReadOnlyPersistentGraphIO {
278-
pub fn new(path: PathBuf, offline: bool, strict: bool) -> Result<Self> {
277+
pub fn new(path: PathBuf, offline: bool) -> Result<Self> {
279278
let store_path = path.join("store.db");
280279
let store = Store::open_read_only(store_path.clone())?;
281280
Ok(Self {
282281
store,
283282
offline,
284-
strict,
285283
store_path,
286284
})
287285
}

python/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ name = "ontoenv"
1515
crate-type = ["cdylib"]
1616

1717
[dependencies]
18-
pyo3 = { version = "0.23", features = ["extension-module"] }
18+
pyo3 = { version = "0.24", features = ["extension-module"] }
1919
ontoenv.workspace = true
2020
anyhow.workspace = true
2121
oxigraph.workspace = true
2222
env_logger.workspace = true
2323
log.workspace = true
2424

2525
[build-dependencies]
26-
pyo3-build-config = "0.23"
26+
pyo3-build-config = "0.24"
2727

2828
[features]
2929
abi3 = ["pyo3/abi3-py39"]

python/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,13 @@ impl OntoEnv {
195195
// If no config but a valid path is given, attempt to load from the directory
196196
OntoEnvRs::load_from_directory(config_path.as_ref().unwrap().clone(), read_only)
197197
.map_err(anyhow_to_pyerr)
198+
} else if !recreate {
199+
// if recreate is 'false', try to load from the directory
200+
OntoEnvRs::load_from_directory(config_path.as_ref().unwrap().clone(), read_only)
201+
.map_err(anyhow_to_pyerr)
198202
} else if let Some(c) = config {
199-
// If a config is provided, initialize a new OntoEnv
203+
// If a config is provided, initialize a new OntoEnv. 'recreate' will be true here
204+
// (else it would have been loaded from the directory in the previous step)
200205
OntoEnvRs::init(c.cfg, recreate).map_err(anyhow_to_pyerr)
201206
} else {
202207
// Return an error if neither a valid path nor a config is provided

0 commit comments

Comments
 (0)