From 1c28232c16a867a644ad28f5df232220cb82bead Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 17 Apr 2022 12:03:53 +0100 Subject: (subplotlib): Do not generate tests for subplotlib if not in-tree Signed-off-by: Daniel Silverstone --- subplotlib/build.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/subplotlib/build.rs b/subplotlib/build.rs index 5b02a27..f22a50c 100644 --- a/subplotlib/build.rs +++ b/subplotlib/build.rs @@ -12,9 +12,9 @@ // ``` use glob::glob; -use std::path::Path; +use std::{fs, path::Path}; -fn main() { +fn gen_tests() { let subplots = glob("*.md").expect("failed to find subplots in subplotlib"); let tests = Path::new("tests"); let subplots = subplots.chain(Some(Ok("../subplot.md".into()))); @@ -32,3 +32,11 @@ fn main() { subplot_build::codegen(Path::new(&entry)).expect("failed to generate code with Subplot"); } } + +fn main() { + // Because we cannot generate tests if we're not fully inside the main subplot tree + // we only generate them if we can see ../subplot.md which is a good indicator. + if fs::metadata("../subplot.md").is_ok() { + gen_tests(); + } +} -- cgit v1.2.1 From 2b6c8c9c96b870091068fc4bcf0f9974e22ec7ab Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 17 Apr 2022 12:04:09 +0100 Subject: (subplotlib): Update release version Signed-off-by: Daniel Silverstone --- Cargo.lock | 2 +- subplotlib/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f687b4e..778bbfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1108,7 +1108,7 @@ dependencies = [ [[package]] name = "subplotlib" -version = "0.4.0" +version = "0.4.1" dependencies = [ "base64", "fehler", diff --git a/subplotlib/Cargo.toml b/subplotlib/Cargo.toml index 7639742..bd4604d 100644 --- a/subplotlib/Cargo.toml +++ b/subplotlib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subplotlib" -version = "0.4.0" +version = "0.4.1" authors = [ "Lars Wirzenius ", "Daniel Silverstone ", -- cgit v1.2.1 From fbfd853fe36c8f635f0b09f5719c5a862668d7e2 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 17 Apr 2022 12:04:46 +0100 Subject: (NEWS): Update for 0.4.1 release Signed-off-by: Daniel Silverstone --- NEWS.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 416673c..2fea0ef 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,11 @@ This file summarises the changes between released versions of Subplot and its associated libraries, especially with regards to changes visible to the user of the Subplot software. -# Version 0.4.0, released XXXX-XX-XX +# Version 0.4.1 (subplotlib only), released 2022-04-17 + +- Fix issue where subplotlib cannot be built out-of-tree + +# Version 0.4.0, released 2022-04-16 - The largest change from the previous release is that Rust based subplot scenario test suites are now considered supported. -- cgit v1.2.1