From 5a739ae43cd64c2fe20d5b9f16ef643c0d3aaa47 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Mon, 31 Jul 2023 15:43:02 +0200 Subject: [PATCH] chore(rust): Fix `make pre-commit` command --- Cargo.toml | 2 ++ crates/polars-algo/Cargo.toml | 3 +++ crates/polars-algo/build.rs | 7 +++++++ crates/polars-arrow/Cargo.toml | 3 +++ crates/polars-arrow/build.rs | 7 +++++++ crates/polars-core/Cargo.toml | 3 +++ crates/polars-core/build.rs | 7 +++++++ crates/polars-error/Cargo.toml | 3 +++ crates/polars-error/build.rs | 7 +++++++ crates/polars-io/Cargo.toml | 3 +++ crates/polars-io/build.rs | 7 +++++++ crates/polars-json/Cargo.toml | 3 +++ crates/polars-json/build.rs | 7 +++++++ crates/polars-lazy/Cargo.toml | 3 +++ crates/polars-lazy/build.rs | 7 +++++++ crates/polars-ops/Cargo.toml | 3 +++ crates/polars-ops/build.rs | 7 +++++++ crates/polars-pipe/Cargo.toml | 3 +++ crates/polars-pipe/build.rs | 7 +++++++ crates/polars-plan/Cargo.toml | 3 +++ crates/polars-plan/build.rs | 7 +++++++ crates/polars-row/Cargo.toml | 3 +++ crates/polars-row/build.rs | 7 +++++++ crates/polars-sql/Cargo.toml | 3 +++ crates/polars-sql/build.rs | 7 +++++++ crates/polars-time/Cargo.toml | 3 +++ crates/polars-time/build.rs | 7 +++++++ crates/polars-utils/Cargo.toml | 3 +++ crates/polars-utils/build.rs | 7 +++++++ crates/polars/Cargo.toml | 2 +- py-polars/Cargo.lock | 14 ++++++++++++++ 31 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 crates/polars-algo/build.rs create mode 100644 crates/polars-arrow/build.rs create mode 100644 crates/polars-core/build.rs create mode 100644 crates/polars-error/build.rs create mode 100644 crates/polars-io/build.rs create mode 100644 crates/polars-json/build.rs create mode 100644 crates/polars-lazy/build.rs create mode 100644 crates/polars-ops/build.rs create mode 100644 crates/polars-pipe/build.rs create mode 100644 crates/polars-plan/build.rs create mode 100644 crates/polars-row/build.rs create mode 100644 crates/polars-sql/build.rs create mode 100644 crates/polars-time/build.rs create mode 100644 crates/polars-utils/build.rs diff --git a/Cargo.toml b/Cargo.toml index b120f74a44f12..f6d1d6f6742f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,8 @@ smartstring = { version = "1" } multiversion = "0.7" either = "1.8" strum_macros = "0.25" +version_check = "0.9.4" + [workspace.dependencies.arrow] package = "arrow2" diff --git a/crates/polars-algo/Cargo.toml b/crates/polars-algo/Cargo.toml index f3b2dc979ccfd..da44d920b03b6 100644 --- a/crates/polars-algo/Cargo.toml +++ b/crates/polars-algo/Cargo.toml @@ -13,6 +13,9 @@ polars-core = { version = "0.31.1", path = "../polars-core", features = ["dtype- polars-lazy = { version = "0.31.1", path = "../polars-lazy", features = ["asof_join", "concat_str", "strings"] } polars-ops = { version = "0.31.1", path = "../polars-ops", features = ["dtype-categorical", "asof_join"], default-features = false } +[build-dependencies] +version_check = { workspace = true } + [package.metadata.docs.rs] all-features = true # defines the configuration attribute `docsrs` diff --git a/crates/polars-algo/build.rs b/crates/polars-algo/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-algo/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-arrow/Cargo.toml b/crates/polars-arrow/Cargo.toml index ef42608fe1cc0..e28b975a2977c 100644 --- a/crates/polars-arrow/Cargo.toml +++ b/crates/polars-arrow/Cargo.toml @@ -21,6 +21,9 @@ polars-error = { version = "0.31.1", path = "../polars-error" } serde = { version = "1", features = ["derive"], optional = true } thiserror.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] dtype-decimal = ["atoi", "ethnum"] dtype-array = [] diff --git a/crates/polars-arrow/build.rs b/crates/polars-arrow/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-arrow/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-core/Cargo.toml b/crates/polars-core/Cargo.toml index 695ea1fc613eb..2b5142eed89f4 100644 --- a/crates/polars-core/Cargo.toml +++ b/crates/polars-core/Cargo.toml @@ -186,6 +186,9 @@ wasm-timer = "0.2.5" bincode = "1" serde_json = "1" +[build-dependencies] +version_check = { workspace = true } + [package.metadata.docs.rs] # not all because arrow 4.3 does not compile with simd # all-features = true diff --git a/crates/polars-core/build.rs b/crates/polars-core/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-core/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-error/Cargo.toml b/crates/polars-error/Cargo.toml index 1f4fb3a9a393f..8c85b54403940 100644 --- a/crates/polars-error/Cargo.toml +++ b/crates/polars-error/Cargo.toml @@ -12,3 +12,6 @@ description = "Error definitions for the Polars DataFrame library" arrow.workspace = true regex = { version = "1.6", optional = true } thiserror.workspace = true + +[build-dependencies] +version_check = { workspace = true } diff --git a/crates/polars-error/build.rs b/crates/polars-error/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-error/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-io/Cargo.toml b/crates/polars-io/Cargo.toml index 09209622a32d4..6578604c913e4 100644 --- a/crates/polars-io/Cargo.toml +++ b/crates/polars-io/Cargo.toml @@ -94,6 +94,9 @@ url = { version = "2.3.1", optional = true } [dev-dependencies] tempdir = "0.3.7" +[build-dependencies] +version_check = { workspace = true } + [package.metadata.docs.rs] all-features = true # defines the configuration attribute `docsrs` diff --git a/crates/polars-io/build.rs b/crates/polars-io/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-io/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-json/Cargo.toml b/crates/polars-json/Cargo.toml index bc3fef2e38fa1..1faee33d1010a 100644 --- a/crates/polars-json/Cargo.toml +++ b/crates/polars-json/Cargo.toml @@ -20,3 +20,6 @@ polars-arrow = { version = "0.31.1", path = "../polars-arrow", default-features polars-error = { version = "0.31.1", path = "../polars-error" } polars-utils = { version = "0.31.1", path = "../polars-utils" } simd-json = { version = "0.10", features = ["allow-non-simd", "known-key"] } + +[build-dependencies] +version_check = { workspace = true } diff --git a/crates/polars-json/build.rs b/crates/polars-json/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-json/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-lazy/Cargo.toml b/crates/polars-lazy/Cargo.toml index fe0eb9e029c7c..3f4794ffc1f01 100644 --- a/crates/polars-lazy/Cargo.toml +++ b/crates/polars-lazy/Cargo.toml @@ -30,6 +30,9 @@ pyo3 = { version = "0.19", optional = true } rayon.workspace = true smartstring.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] nightly = ["polars-core/nightly", "polars-pipe/nightly", "polars-plan/nightly"] compile = ["polars-plan/compile"] diff --git a/crates/polars-lazy/build.rs b/crates/polars-lazy/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-lazy/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-ops/Cargo.toml b/crates/polars-ops/Cargo.toml index 9b3129326a610..b913c2051dd9d 100644 --- a/crates/polars-ops/Cargo.toml +++ b/crates/polars-ops/Cargo.toml @@ -28,6 +28,9 @@ serde = { version = "1", features = ["derive"], optional = true } serde_json = { version = "1", optional = true } smartstring.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] simd = ["argminmax/nightly_simd"] nightly = ["polars-utils/nightly"] diff --git a/crates/polars-ops/build.rs b/crates/polars-ops/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-ops/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-pipe/Cargo.toml b/crates/polars-pipe/Cargo.toml index 0770f40e5b8e6..e2a0b690bb977 100644 --- a/crates/polars-pipe/Cargo.toml +++ b/crates/polars-pipe/Cargo.toml @@ -24,6 +24,9 @@ polars-utils = { version = "0.31.1", path = "../polars-utils", features = ["sysi rayon.workspace = true smartstring = { version = "1" } +[build-dependencies] +version_check = { workspace = true } + [features] compile = ["crossbeam-channel", "crossbeam-queue"] csv = ["polars-plan/csv", "polars-io/csv"] diff --git a/crates/polars-pipe/build.rs b/crates/polars-pipe/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-pipe/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-plan/Cargo.toml b/crates/polars-plan/Cargo.toml index a741fd14ab348..d8667857f86bf 100644 --- a/crates/polars-plan/Cargo.toml +++ b/crates/polars-plan/Cargo.toml @@ -32,6 +32,9 @@ serde = { version = "1", features = ["derive", "rc"], optional = true } smartstring.workspace = true strum_macros.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] # debugging utility debugging = [] diff --git a/crates/polars-plan/build.rs b/crates/polars-plan/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-plan/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-row/Cargo.toml b/crates/polars-row/Cargo.toml index 5ccc9a647763d..e47c54d68ef30 100644 --- a/crates/polars-row/Cargo.toml +++ b/crates/polars-row/Cargo.toml @@ -12,3 +12,6 @@ description = "Row encodings for the Polars DataFrame library" arrow.workspace = true polars-error = { version = "0.31.1", path = "../polars-error" } polars-utils = { version = "0.31.1", path = "../polars-utils" } + +[build-dependencies] +version_check = { workspace = true } diff --git a/crates/polars-row/build.rs b/crates/polars-row/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-row/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-sql/Cargo.toml b/crates/polars-sql/Cargo.toml index d1ecce7d1c7c8..02ea735229682 100644 --- a/crates/polars-sql/Cargo.toml +++ b/crates/polars-sql/Cargo.toml @@ -23,3 +23,6 @@ serde = "1" serde_json = { version = "1" } # sqlparser = { git = "https://github.com/sqlparser-rs/sqlparser-rs.git", rev = "ae3b5844c839072c235965fe0d1bddc473dced87" } sqlparser = "0.34" + +[build-dependencies] +version_check = { workspace = true } diff --git a/crates/polars-sql/build.rs b/crates/polars-sql/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-sql/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-time/Cargo.toml b/crates/polars-time/Cargo.toml index 44fd531155736..e464a6b6d550c 100644 --- a/crates/polars-time/Cargo.toml +++ b/crates/polars-time/Cargo.toml @@ -23,6 +23,9 @@ regex = "1.7.1" serde = { version = "1", features = ["derive"], optional = true } smartstring.workspace = true +[build-dependencies] +version_check = { workspace = true } + [features] dtype-date = ["polars-core/dtype-date", "polars-core/temporal"] dtype-datetime = ["polars-core/dtype-date", "polars-core/temporal"] diff --git a/crates/polars-time/build.rs b/crates/polars-time/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-time/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars-utils/Cargo.toml b/crates/polars-utils/Cargo.toml index 5b847234f4ec0..3afd2589da713 100644 --- a/crates/polars-utils/Cargo.toml +++ b/crates/polars-utils/Cargo.toml @@ -18,6 +18,9 @@ rayon.workspace = true smartstring.workspace = true sysinfo = { version = "0.29", default-features = false, optional = true } +[build-dependencies] +version_check = { workspace = true } + [features] bigidx = [] nightly = [] diff --git a/crates/polars-utils/build.rs b/crates/polars-utils/build.rs new file mode 100644 index 0000000000000..3e4ab64620ace --- /dev/null +++ b/crates/polars-utils/build.rs @@ -0,0 +1,7 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let channel = version_check::Channel::read().unwrap(); + if channel.is_nightly() { + println!("cargo:rustc-cfg=feature=\"nightly\""); + } +} diff --git a/crates/polars/Cargo.toml b/crates/polars/Cargo.toml index 4a5c0576aed19..0c097700b1cd3 100644 --- a/crates/polars/Cargo.toml +++ b/crates/polars/Cargo.toml @@ -330,7 +330,7 @@ ahash = "0.8" rand = "0.8" [build-dependencies] -version_check = "0.9.4" +version_check = { workspace = true } [package.metadata.docs.rs] # all-features = true diff --git a/py-polars/Cargo.lock b/py-polars/Cargo.lock index 3bba5be51c84b..cf9fa202a0d56 100644 --- a/py-polars/Cargo.lock +++ b/py-polars/Cargo.lock @@ -1445,6 +1445,7 @@ dependencies = [ "polars-core", "polars-lazy", "polars-ops", + "version_check", ] [[package]] @@ -1462,6 +1463,7 @@ dependencies = [ "polars-error", "serde", "thiserror", + "version_check", ] [[package]] @@ -1493,6 +1495,7 @@ dependencies = [ "serde_json", "smartstring", "thiserror", + "version_check", "wasm-timer", "xxhash-rust", ] @@ -1504,6 +1507,7 @@ dependencies = [ "arrow2", "regex", "thiserror", + "version_check", ] [[package]] @@ -1539,6 +1543,7 @@ dependencies = [ "simd-json", "simdutf8", "tokio", + "version_check", ] [[package]] @@ -1555,6 +1560,7 @@ dependencies = [ "polars-error", "polars-utils", "simd-json", + "version_check", ] [[package]] @@ -1577,6 +1583,7 @@ dependencies = [ "pyo3", "rayon", "smartstring", + "version_check", ] [[package]] @@ -1600,6 +1607,7 @@ dependencies = [ "serde", "serde_json", "smartstring", + "version_check", ] [[package]] @@ -1620,6 +1628,7 @@ dependencies = [ "polars-utils", "rayon", "smartstring", + "version_check", ] [[package]] @@ -1644,6 +1653,7 @@ dependencies = [ "serde", "smartstring", "strum_macros 0.25.1", + "version_check", ] [[package]] @@ -1653,6 +1663,7 @@ dependencies = [ "arrow2", "polars-error", "polars-utils", + "version_check", ] [[package]] @@ -1666,6 +1677,7 @@ dependencies = [ "serde", "serde_json", "sqlparser", + "version_check", ] [[package]] @@ -1685,6 +1697,7 @@ dependencies = [ "regex", "serde", "smartstring", + "version_check", ] [[package]] @@ -1699,6 +1712,7 @@ dependencies = [ "rayon", "smartstring", "sysinfo", + "version_check", ] [[package]]