From 97e0dfaf9b1a83559d140153bf5fbd9edc5f7954 Mon Sep 17 00:00:00 2001 From: Tristan Murphy <72839119+HyperCodec@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:42:32 +0000 Subject: [PATCH 1/2] include README --- genetic-rs/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/genetic-rs/Cargo.toml b/genetic-rs/Cargo.toml index 89e8454..dbe29cf 100644 --- a/genetic-rs/Cargo.toml +++ b/genetic-rs/Cargo.toml @@ -10,6 +10,7 @@ homepage.workspace = true repository.workspace = true keywords = ["genetic", "algorithm", "rust"] categories = ["algorithms", "science", "simulation"] +include = ["../README.md"] [features] default = ["builtin", "genrand", "crossover"] From ca1a74b9916ccc5ad8daca18c57cc1181071112f Mon Sep 17 00:00:00 2001 From: Tristan Murphy <72839119+HyperCodec@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:08:39 +0000 Subject: [PATCH 2/2] =?UTF-8?q?prevent=20Schr=C3=B6dinger's=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 2 +- genetic-rs/Cargo.toml | 4 +++- genetic-rs/src/lib.rs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 715ddfb..f090c72 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,4 +17,4 @@ jobs: - name: "Publish macros" run: cargo +nightly publish -p genetic-rs-macros --token ${{ secrets.CARGO_TOKEN }} - name: "Publish main" - run: cargo +nightly publish -p genetic-rs --token ${{ secrets.CARGO_TOKEN }} \ No newline at end of file + run: cargo +nightly publish -p genetic-rs --cfg publish --token ${{ secrets.CARGO_TOKEN }} \ No newline at end of file diff --git a/genetic-rs/Cargo.toml b/genetic-rs/Cargo.toml index dbe29cf..08fcc8a 100644 --- a/genetic-rs/Cargo.toml +++ b/genetic-rs/Cargo.toml @@ -10,7 +10,6 @@ homepage.workspace = true repository.workspace = true keywords = ["genetic", "algorithm", "rust"] categories = ["algorithms", "science", "simulation"] -include = ["../README.md"] [features] default = ["builtin", "genrand", "crossover"] @@ -26,6 +25,9 @@ tracing = ["genetic-rs-common/tracing"] genetic-rs-common = { path = "../genetic-rs-common", version = "1.0.0" } genetic-rs-macros = { path = "../genetic-rs-macros", version = "1.0.0", optional = true } +[lints.rust] +unexpected-cfgs = {level = "allow", check-cfg = ["cfg(publish)"]} + [dev-dependencies] rand = "0.9.2" diff --git a/genetic-rs/src/lib.rs b/genetic-rs/src/lib.rs index 95b5b06..016d673 100644 --- a/genetic-rs/src/lib.rs +++ b/genetic-rs/src/lib.rs @@ -1,5 +1,6 @@ #![allow(clippy::needless_doctest_main)] -#![doc = include_str!("../../README.md")] +#![cfg_attr(publish, doc = include_str!(env!("CARGO_PKG_README")))] +#![cfg_attr(not(publish), doc = include_str!(concat!("../", env!("CARGO_PKG_README"))))] pub mod prelude { pub use genetic_rs_common::prelude::*;