Removes dependency on escargot

pull/845/head
Tpt 9 months ago committed by Thomas Tanon
parent 83aa8170ea
commit 58699f36f3
  1. 13
      Cargo.lock
  2. 1
      Cargo.toml
  3. 1
      cli/Cargo.toml
  4. 90
      cli/src/main.rs
  5. 1
      lints/test_debian_compatibility.py

13
Cargo.lock generated

@ -545,18 +545,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "escargot"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f474c6844cbd04e783d0f25757583db4f491770ca618bedf2fb01815fc79939"
dependencies = [
"log",
"once_cell",
"serde",
"serde_json",
]
[[package]]
name = "fastrand"
version = "2.0.2"
@ -1086,7 +1074,6 @@ dependencies = [
"assert_cmd",
"assert_fs",
"clap",
"escargot",
"flate2",
"oxhttp",
"oxigraph",

@ -36,7 +36,6 @@ clap = "4.0"
codspeed-criterion-compat = "2.3.3"
console_error_panic_hook = "0.1.7"
digest = "0.10"
escargot = "0.5"
flate2 = "1.0"
getrandom = "0.2.8"
hex = "0.4"

@ -40,7 +40,6 @@ url.workspace = true
[dev-dependencies]
assert_cmd.workspace = true
assert_fs.workspace = true
escargot.workspace = true
predicates.workspace = true
[lints]

@ -1865,19 +1865,15 @@ mod tests {
use std::fs::remove_dir_all;
use std::io::read_to_string;
fn cli_command() -> Result<Command> {
Ok(Command::from_std(
escargot::CargoBuild::new()
.bin("oxigraph")
.manifest_path(format!("{}/Cargo.toml", env!("CARGO_MANIFEST_DIR")))
.run()?
.command(),
))
fn cli_command() -> Command {
let mut command = Command::new(env!("CARGO"));
command.arg("run").arg("--bin").arg("oxigraph").arg("--");
command
}
fn initialized_cli_store(data: &'static str) -> Result<TempDir> {
let store_dir = TempDir::new()?;
cli_command()?
cli_command()
.arg("load")
.arg("--location")
.arg(store_dir.path())
@ -1889,8 +1885,8 @@ mod tests {
Ok(store_dir)
}
fn assert_cli_state(store_dir: &TempDir, data: &'static str) -> Result<()> {
cli_command()?
fn assert_cli_state(store_dir: &TempDir, data: &'static str) {
cli_command()
.arg("dump")
.arg("--location")
.arg(store_dir.path())
@ -1899,17 +1895,15 @@ mod tests {
.assert()
.stdout(data)
.success();
Ok(())
}
#[test]
fn cli_help() -> Result<()> {
cli_command()?
fn cli_help() {
cli_command()
.assert()
.failure()
.stdout("")
.stderr(predicate::str::starts_with("Oxigraph"));
Ok(())
.stderr(predicate::str::contains("Oxigraph"));
}
#[test]
@ -1917,7 +1911,7 @@ mod tests {
let store_dir = TempDir::new()?;
let input_file = NamedTempFile::new("input.ttl")?;
input_file.write_str("<s> <http://example.com/p> <http://example.com/o> .")?;
cli_command()?
cli_command()
.arg("load")
.arg("--location")
.arg(store_dir.path())
@ -1928,7 +1922,7 @@ mod tests {
.assert()
.success();
cli_command()?
cli_command()
.arg("optimize")
.arg("--location")
.arg(store_dir.path())
@ -1936,7 +1930,7 @@ mod tests {
.success();
let output_file = NamedTempFile::new("output.nt")?;
cli_command()?
cli_command()
.arg("dump")
.arg("--location")
.arg(store_dir.path())
@ -1957,7 +1951,7 @@ mod tests {
let input_file = NamedTempFile::new("input.nq")?;
input_file
.write_str("<http://example.com/s> <http://example.com/p> <http://example.com/o> <http://example.com/g> .")?;
cli_command()?
cli_command()
.arg("load")
.arg("--location")
.arg(store_dir.path())
@ -1967,7 +1961,7 @@ mod tests {
.success();
let output_file = NamedTempFile::new("output.nq")?;
cli_command()?
cli_command()
.arg("dump")
.arg("--location")
.arg(store_dir.path())
@ -1988,7 +1982,7 @@ mod tests {
encoder
.write_all(b"<http://example.com/s> <http://example.com/p> <http://example.com/o> .")?;
file.write_binary(&encoder.finish()?)?;
cli_command()?
cli_command()
.arg("load")
.arg("-l")
.arg(store_dir.path())
@ -1997,7 +1991,7 @@ mod tests {
.assert()
.success();
cli_command()?
cli_command()
.arg("dump")
.arg("-l")
.arg(store_dir.path())
@ -2016,7 +2010,7 @@ mod tests {
input_file.write_str(
"<http://example.com/s> <http://example.com/p> <http://example.com/o> .\n",
)?;
cli_command()?
cli_command()
.arg("load")
.arg("-l")
.arg(store_dir.path())
@ -2028,7 +2022,7 @@ mod tests {
.success();
let output_file = NamedTempFile::new("output.nt")?;
cli_command()?
cli_command()
.arg("dump")
.arg("-l")
.arg(store_dir.path())
@ -2049,7 +2043,7 @@ mod tests {
let input_file = NamedTempFile::new("input")?;
input_file
.write_str("<http://example.com/s> <http://example.com/p> <http://example.com/o> .")?;
cli_command()?
cli_command()
.arg("load")
.arg("-l")
.arg(store_dir.path())
@ -2061,7 +2055,7 @@ mod tests {
.success();
let output_file = NamedTempFile::new("output")?;
cli_command()?
cli_command()
.arg("dump")
.arg("--location")
.arg(store_dir.path())
@ -2081,7 +2075,7 @@ mod tests {
#[test]
fn cli_load_from_stdin_and_dump_to_stdout() -> Result<()> {
let store_dir = TempDir::new()?;
cli_command()?
cli_command()
.arg("load")
.arg("--location")
.arg(store_dir.path())
@ -2091,7 +2085,7 @@ mod tests {
.assert()
.success();
cli_command()?
cli_command()
.arg("dump")
.arg("--location")
.arg(store_dir.path())
@ -2111,7 +2105,7 @@ mod tests {
let backup_dir = TempDir::new()?;
remove_dir_all(backup_dir.path())?; // The directory should not exist yet
cli_command()?
cli_command()
.arg("backup")
.arg("--location")
.arg(store_dir.path())
@ -2123,7 +2117,8 @@ mod tests {
assert_cli_state(
&store_dir,
"<http://example.com/s> <http://example.com/p> <http://example.com/o> .\n",
)
);
Ok(())
}
#[test]
@ -2131,7 +2126,7 @@ mod tests {
let store_dir = initialized_cli_store(
"<http://example.com/s> <http://example.com/p> <http://example.com/o> .",
)?;
cli_command()?
cli_command()
.arg("query")
.arg("--location")
.arg(store_dir.path())
@ -2152,7 +2147,7 @@ mod tests {
let store_dir = initialized_cli_store(
"<http://example.com/s> <http://example.com/p> <http://example.com/o> .",
)?;
cli_command()?
cli_command()
.arg("query")
.arg("--location")
.arg(store_dir.path())
@ -2175,7 +2170,7 @@ mod tests {
let input_file = NamedTempFile::new("input.rq")?;
input_file.write_str("SELECT ?s WHERE { ?s ?p ?o }")?;
let output_file = NamedTempFile::new("output.tsv")?;
cli_command()?
cli_command()
.arg("query")
.arg("--location")
.arg(store_dir.path())
@ -2192,7 +2187,7 @@ mod tests {
#[test]
fn cli_ask_update_inline() -> Result<()> {
let store_dir = TempDir::new()?;
cli_command()?
cli_command()
.arg("update")
.arg("--location")
.arg(store_dir.path())
@ -2205,13 +2200,14 @@ mod tests {
assert_cli_state(
&store_dir,
"<http://example.com/s> <http://example.com/p> <http://example.com/o> .\n",
)
);
Ok(())
}
#[test]
fn cli_construct_update_stdin() -> Result<()> {
let store_dir = TempDir::new()?;
cli_command()?
cli_command()
.arg("update")
.arg("--location")
.arg(store_dir.path())
@ -2223,7 +2219,8 @@ mod tests {
assert_cli_state(
&store_dir,
"<http://example.com/s> <http://example.com/p> <http://example.com/o> .\n",
)
);
Ok(())
}
#[test]
@ -2233,7 +2230,7 @@ mod tests {
input_file.write_str(
"INSERT DATA { <http://example.com/s> <http://example.com/p> <http://example.com/o> }",
)?;
cli_command()?
cli_command()
.arg("update")
.arg("--location")
.arg(store_dir.path())
@ -2244,7 +2241,8 @@ mod tests {
assert_cli_state(
&store_dir,
"<http://example.com/s> <http://example.com/p> <http://example.com/o> .\n",
)
);
Ok(())
}
#[test]
@ -2252,7 +2250,7 @@ mod tests {
let input_file = NamedTempFile::new("input.ttl")?;
input_file.write_str("@prefix schema: <http://schema.org/> .\n<http://example.com#me> a schema:Person ;\n\tschema:name \"Foo Bar\"@en .\n")?;
let output_file = NamedTempFile::new("output.rdf")?;
cli_command()?
cli_command()
.arg("convert")
.arg("--from-file")
.arg(input_file.path())
@ -2268,8 +2266,8 @@ mod tests {
}
#[test]
fn cli_convert_from_default_graph_to_named_graph() -> Result<()> {
cli_command()?
fn cli_convert_from_default_graph_to_named_graph() {
cli_command()
.arg("convert")
.arg("--from-format")
.arg("trig")
@ -2282,12 +2280,11 @@ mod tests {
.assert()
.stdout("<http://example.com/s> <http://example.com/p> <http://example.com/o> <http://example.com/t> .\n")
.success();
Ok(())
}
#[test]
fn cli_convert_from_named_graph() -> Result<()> {
cli_command()?
fn cli_convert_from_named_graph() {
cli_command()
.arg("convert")
.arg("--from-format")
.arg("trig")
@ -2298,7 +2295,6 @@ mod tests {
.write_stdin("@base <http://example.com/> . <s> <p> <o> . <g> { <sg> <pg> <og> . }")
.assert()
.stdout("<http://example.com/sg> <http://example.com/pg> <http://example.com/og> .\n");
Ok(())
}
#[test]

@ -8,7 +8,6 @@ TARGET_DEBIAN_VERSIONS = ["sid"]
IGNORE_PACKAGES = {"oxigraph-js", "oxigraph-testsuite", "pyoxigraph", "sparql-smith"}
ALLOWED_MISSING_PACKAGES = {
"codspeed-criterion-compat",
"escargot",
"json-event-parser",
"oxhttp",
"oxiri",

Loading…
Cancel
Save