From 0cb55ab88b4e799ba8b781535a26c9e409cc284e Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sun, 13 Oct 2024 19:00:39 -0600 Subject: [PATCH 1/4] Attempting to change the path of embedded AstroData when building with docsrs --- Cargo.toml | 1 - anise/src/almanac/embed.rs | 7 ++++--- data/.cargokeep | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 data/.cargokeep diff --git a/Cargo.toml b/Cargo.toml index 968d3c54..2d2528ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ exclude = [ ".vscode", "*.sh", ] -include = ["data/.cargokeep"] [workspace.dependencies] hifitime = "4.0.0-alpha" diff --git a/anise/src/almanac/embed.rs b/anise/src/almanac/embed.rs index b2b1a1f4..796fadc1 100644 --- a/anise/src/almanac/embed.rs +++ b/anise/src/almanac/embed.rs @@ -8,9 +8,10 @@ use rust_embed::Embed; use snafu::ResultExt; #[derive(Embed)] -#[folder = "$CARGO_MANIFEST_DIR/../data/"] -#[include = "de440s.bsp"] -#[include = "pck11.pca"] +#[cfg_attr(not(docsrs), folder = "$CARGO_MANIFEST_DIR/../data/")] +#[cfg_attr(not(docsrs), include = "de440s.bsp")] +#[cfg_attr(not(docsrs), include = "pck11.pca")] +#[cfg_attr(docsrs, folder = "$OUTDIR")] struct AstroData; impl Almanac { diff --git a/data/.cargokeep b/data/.cargokeep deleted file mode 100644 index eea5b5c1..00000000 --- a/data/.cargokeep +++ /dev/null @@ -1 +0,0 @@ -Required in cargo for documenting the embed_ephem feature \ No newline at end of file From eec5ddd5a31e65b24c596772d3e0ec2120272a25 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sun, 13 Oct 2024 19:11:49 -0600 Subject: [PATCH 2/4] Prep version 0.4.5 --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2d2528ac..c5e36fce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["anise", "anise-cli", "anise-gui", "anise-py"] [workspace.package] -version = "0.4.4" +version = "0.4.5" edition = "2021" authors = ["Christopher Rabotin "] description = "ANISE provides a toolkit and files for Attitude, Navigation, Instrument, Spacecraft, and Ephemeris data. It's a modern replacement of NAIF SPICE file." @@ -50,7 +50,7 @@ serde = "1" serde_derive = "1" serde_dhall = "0.12" -anise = { version = "0.4.4", path = "anise", default-features = false } +anise = { version = "0.4.5", path = "anise", default-features = false } [profile.bench] debug = true From 6fa709094691d4b8cfa7421c966c5db22fc6b85a Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sun, 13 Oct 2024 19:16:09 -0600 Subject: [PATCH 3/4] Fix OUT_DIR path --- anise/src/almanac/embed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anise/src/almanac/embed.rs b/anise/src/almanac/embed.rs index 796fadc1..98eca677 100644 --- a/anise/src/almanac/embed.rs +++ b/anise/src/almanac/embed.rs @@ -11,7 +11,7 @@ use snafu::ResultExt; #[cfg_attr(not(docsrs), folder = "$CARGO_MANIFEST_DIR/../data/")] #[cfg_attr(not(docsrs), include = "de440s.bsp")] #[cfg_attr(not(docsrs), include = "pck11.pca")] -#[cfg_attr(docsrs, folder = "$OUTDIR")] +#[cfg_attr(docsrs, folder = "$OUT_DIR")] struct AstroData; impl Almanac { From 55fd946a7d91f1fe95b7439fc04747b02ea7c617 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sun, 13 Oct 2024 20:38:25 -0600 Subject: [PATCH 4/4] Remove cargokeep from tests --- .github/workflows/rust.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2d41202d..7a755100 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -73,9 +73,6 @@ jobs: - name: Test rust_embed build run: | # Clean up the data folder as if we were on crates.io - cp data/.cargokeep . - rm -rf data/ - mkdir data && mv .cargokeep data/.cargokeep cd anise # Build only the Rust library cargo build --features embed_ephem cargo build --features embed_ephem --release