Skip to content

Commit cf6a13f

Browse files
committed
Merge remote-tracking branch 'origin/main' into sjackman/sj/serde_with
Signed-off-by: Andrei Gherghescu <[email protected]>
2 parents 95d0119 + d22e25f commit cf6a13f

File tree

8 files changed

+39
-18
lines changed

8 files changed

+39
-18
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: cargo
5+
directory: /
6+
schedule:
7+
interval: daily

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: CI
33
on:
44
workflow_dispatch:
55
pull_request:
6-
branches: [ master ]
6+
branches: [ main ]
77
push:
8-
branches: [ master ]
8+
branches: [ main ]
99

1010
# Cancel any in-flight jobs for the same PR/branch so there's only one active
1111
# at a time
@@ -27,7 +27,7 @@ jobs:
2727
components: rustfmt
2828
- run: cargo fmt --all -- --check
2929
- run: cd ${{ github.workspace }}/examples && cargo fmt --all -- --check
30-
30+
3131
clippy:
3232
name: Clippy
3333
runs-on: ubuntu-latest
@@ -57,7 +57,9 @@ jobs:
5757
- uses: actions/checkout@v3
5858
- uses: dtolnay/rust-toolchain@stable
5959
- run: cargo test --features plotly_ndarray,plotly_image,kaleido
60-
60+
- if: ${{ matrix.os == 'windows-latest' }}
61+
run: gci -recurse -filter "*example*"
62+
6163
code-coverage:
6264
name: Code Coverage
6365
runs-on: ubuntu-latest
@@ -70,7 +72,7 @@ jobs:
7072
# we are skipping anything to do with wasm here
7173
- run: cargo llvm-cov --workspace --features plotly_ndarray,plotly_image,kaleido --lcov --output-path lcov.info
7274
- uses: codecov/codecov-action@v3
73-
75+
7476
build_examples:
7577
name: Build Examples
7678
strategy:
@@ -94,7 +96,7 @@ jobs:
9496
- uses: actions/checkout@v3
9597
- uses: dtolnay/rust-toolchain@stable
9698
- run: cd ${{ github.workspace }}/examples/${{ matrix.example }} && cargo build
97-
99+
98100
build_wasm_examples:
99101
name: Build Wasm Examples
100102
strategy:

examples/statistical_charts/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ fn fully_styled_box_plot() {
345345
v
346346
};
347347

348-
let x_data = vec![
348+
let x_data = [
349349
"Carmelo<br>Anthony",
350350
"Dwyane<br>Wade",
351351
"Deron<br>Williams",

plotly/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ wasm-bindgen-futures = { version = "0.4", optional = true }
4141
[dev-dependencies]
4242
csv = "1.1.6"
4343
image = "0.24.4"
44-
itertools = "0.10.3"
44+
itertools = ">=0.10, <0.13"
4545
itertools-num = "0.1.3"
4646
ndarray = "0.15.4"
4747
plotly_kaleido = { version = "0.8.4", path = "../plotly_kaleido" }

plotly/src/plot.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl Traces {
162162
///
163163
/// let layout = Layout::new().title("<b>Line and Scatter Plot</b>".into());
164164
/// plot.set_layout(layout);
165-
///
165+
///
166166
/// # if false { // We don't actually want to try and display the plot in a browser when running a doctest.
167167
/// plot.show();
168168
/// # }
@@ -650,6 +650,7 @@ mod tests {
650650
assert!(!dst.exists());
651651
}
652652

653+
#[cfg(not(target_os = "windows"))]
653654
#[test]
654655
#[cfg(feature = "kaleido")]
655656
fn test_save_to_png() {
@@ -661,6 +662,7 @@ mod tests {
661662
assert!(!dst.exists());
662663
}
663664

665+
#[cfg(not(target_os = "windows"))]
664666
#[test]
665667
#[cfg(feature = "kaleido")]
666668
fn test_save_to_jpeg() {
@@ -672,6 +674,7 @@ mod tests {
672674
assert!(!dst.exists());
673675
}
674676

677+
#[cfg(not(target_os = "windows"))]
675678
#[test]
676679
#[cfg(feature = "kaleido")]
677680
fn test_save_to_svg() {
@@ -683,6 +686,7 @@ mod tests {
683686
assert!(!dst.exists());
684687
}
685688

689+
#[cfg(not(target_os = "windows"))]
686690
#[test]
687691
#[ignore] // This seems to fail unpredictably on MacOs.
688692
#[cfg(feature = "kaleido")]
@@ -695,6 +699,7 @@ mod tests {
695699
assert!(!dst.exists());
696700
}
697701

702+
#[cfg(not(target_os = "windows"))]
698703
#[test]
699704
#[cfg(feature = "kaleido")]
700705
fn test_save_to_pdf() {
@@ -706,6 +711,7 @@ mod tests {
706711
assert!(!dst.exists());
707712
}
708713

714+
#[cfg(not(target_os = "windows"))]
709715
#[test]
710716
#[cfg(feature = "kaleido")]
711717
fn test_save_to_webp() {

plotly_kaleido/Cargo.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ serde = { version = "1.0.132", features = ["derive"] }
1919
serde_json = "1.0.73"
2020
base64 = "0.13.0"
2121
dunce = "1.0.2"
22-
directories = "4.0.1"
23-
24-
[dev-dependencies]
25-
zip = "0.5.13"
22+
directories = ">=4, <6"
2623

2724
[build-dependencies]
28-
zip = "0.5.13"
29-
directories = "4.0.1"
30-
25+
zip = "1.1"
26+
directories = ">=4, <6"

plotly_kaleido/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ use std::process::Command;
1010

1111
use directories::ProjectDirs;
1212

13-
#[cfg(target_os = "linux")]
13+
#[cfg(all(target_arch = "x86_64", target_os = "linux"))]
1414
const KALEIDO_URL: &str =
1515
"https://github.com/plotly/Kaleido/releases/download/v0.2.1/kaleido_linux_x64.zip";
1616

17+
#[cfg(all(target_arch = "aarch64", target_os = "linux"))]
18+
const KALEIDO_URL: &str =
19+
"https://github.com/plotly/Kaleido/releases/download/v0.2.1/kaleido_linux_arm64.zip";
20+
1721
#[cfg(target_os = "windows")]
1822
const KALEIDO_URL: &str =
1923
"https://github.com/plotly/Kaleido/releases/download/v0.2.1/kaleido_win_x64.zip";

plotly_kaleido/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl Kaleido {
163163
}
164164

165165
let output_lines = BufReader::new(process.stdout.unwrap()).lines();
166-
for line in output_lines.flatten() {
166+
for line in output_lines.map_while(Result::ok) {
167167
let res = KaleidoResult::from(line.as_str());
168168
if let Some(image_data) = res.result {
169169
let data: Vec<u8> = match format {
@@ -237,6 +237,7 @@ mod tests {
237237
assert_eq!(to_value(kaleido_data).unwrap(), expected);
238238
}
239239

240+
#[cfg(not(target_os = "windows"))]
240241
#[test]
241242
fn test_save_png() {
242243
let test_plot = create_test_plot();
@@ -247,6 +248,7 @@ mod tests {
247248
assert!(std::fs::remove_file(dst.as_path()).is_ok());
248249
}
249250

251+
#[cfg(not(target_os = "windows"))]
250252
#[test]
251253
fn test_save_jpeg() {
252254
let test_plot = create_test_plot();
@@ -257,6 +259,7 @@ mod tests {
257259
assert!(std::fs::remove_file(dst.as_path()).is_ok());
258260
}
259261

262+
#[cfg(not(target_os = "windows"))]
260263
#[test]
261264
fn test_save_webp() {
262265
let test_plot = create_test_plot();
@@ -267,6 +270,7 @@ mod tests {
267270
assert!(std::fs::remove_file(dst.as_path()).is_ok());
268271
}
269272

273+
#[cfg(not(target_os = "windows"))]
270274
#[test]
271275
fn test_save_svg() {
272276
let test_plot = create_test_plot();
@@ -277,6 +281,7 @@ mod tests {
277281
assert!(std::fs::remove_file(dst.as_path()).is_ok());
278282
}
279283

284+
#[cfg(not(target_os = "windows"))]
280285
#[test]
281286
fn test_save_pdf() {
282287
let test_plot = create_test_plot();
@@ -287,6 +292,7 @@ mod tests {
287292
assert!(std::fs::remove_file(dst.as_path()).is_ok());
288293
}
289294

295+
#[cfg(not(target_os = "windows"))]
290296
#[test]
291297
#[ignore]
292298
fn test_save_eps() {

0 commit comments

Comments
 (0)