summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-04-17 11:17:16 +0000
committerLars Wirzenius <liw@liw.fi>2022-04-17 11:17:16 +0000
commite66003da3b6c67c4287234d6374bf86736214321 (patch)
tree0fc6d4ac14da26a6582eb8cccc3b6636593452b0
parent99e947c92737d72f41ecca4cddf359b3643c11a9 (diff)
parentfbfd853fe36c8f635f0b09f5719c5a862668d7e2 (diff)
downloadsubplot-e66003da3b6c67c4287234d6374bf86736214321.tar.gz
Merge branch 'fix-release' into 'main'0.4.1
(subplotlib): Do not generate tests for subplotlib if not in-tree See merge request subplot/subplot!271
-rw-r--r--Cargo.lock2
-rw-r--r--NEWS.md6
-rw-r--r--subplotlib/Cargo.toml2
-rw-r--r--subplotlib/build.rs12
4 files changed, 17 insertions, 5 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/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.
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 <liw@liw.fi>",
"Daniel Silverstone <dsilvers@digital-scurf.org>",
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();
+ }
+}