chore: replace `dotenv` with `dotenvy` (#5285)

The latter one is a maintained fork. This avoids having both crates
after #5282.
pull/24376/head
Marco Neumann 2022-08-03 12:41:38 +00:00 committed by GitHub
parent 7c67b93015
commit 273b3cc165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 21 additions and 27 deletions

18
Cargo.lock generated
View File

@ -1380,12 +1380,6 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]]
name = "dotenv"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "dotenvy"
version = "0.15.1"
@ -2079,7 +2073,7 @@ dependencies = [
"console-subscriber",
"data_types",
"datafusion 0.1.0",
"dotenv",
"dotenvy",
"futures",
"generated_types",
"hashbrown",
@ -2289,7 +2283,7 @@ dependencies = [
"assert_matches",
"async-trait",
"data_types",
"dotenv",
"dotenvy",
"futures",
"iox_time",
"metric",
@ -3218,7 +3212,7 @@ version = "0.1.0"
dependencies = [
"async-trait",
"bytes",
"dotenv",
"dotenvy",
"futures",
"iox_time",
"metric",
@ -5028,7 +5022,7 @@ dependencies = [
name = "sqlx-hotswap-pool"
version = "0.0.0"
dependencies = [
"dotenv",
"dotenvy",
"either",
"futures",
"rand",
@ -5213,7 +5207,7 @@ name = "test_helpers"
version = "0.1.0"
dependencies = [
"async-trait",
"dotenv",
"dotenvy",
"observability_deps",
"parking_lot 0.12.1",
"tempfile",
@ -6201,7 +6195,7 @@ dependencies = [
"async-trait",
"data_types",
"dml",
"dotenv",
"dotenvy",
"futures",
"generated_types",
"hashbrown",

View File

@ -42,7 +42,7 @@ backtrace = "0.3"
bytes = "1.2"
clap = { version = "3", features = ["derive", "env"] }
console-subscriber = { version = "0.1.6", optional = true, features = ["parking_lot"] }
dotenv = "0.15.0"
dotenvy = "0.15.1"
futures = "0.3"
hashbrown = "0.12"
http = "0.2.8"

View File

@ -13,7 +13,7 @@ use crate::commands::{
run::all_in_one,
tracing::{init_logs_and_tracing, init_simple_logs, TroggingGuard},
};
use dotenv::dotenv;
use dotenvy::dotenv;
use influxdb_iox_client::connection::Builder;
use iox_time::{SystemProvider, TimeProvider};
use observability_deps::tracing::warn;
@ -365,7 +365,7 @@ fn get_runtime(num_threads: Option<usize>) -> Result<Runtime, std::io::Error> {
fn load_dotenv() {
match dotenv() {
Ok(_) => {}
Err(dotenv::Error::Io(err)) if err.kind() == std::io::ErrorKind::NotFound => {
Err(dotenvy::Error::Io(err)) if err.kind() == std::io::ErrorKind::NotFound => {
// Ignore this - a missing env file is not an error, defaults will
// be applied when initialising the Config struct.
}

View File

@ -21,7 +21,7 @@ workspace-hack = { path = "../workspace-hack"}
[dev-dependencies] # In alphabetical order
assert_matches = "1.5.0"
dotenv = "0.15.0"
dotenvy = "0.15.1"
mutable_batch_lp = { path = "../mutable_batch_lp" }
paste = "1.0.8"
pretty_assertions = "1.2.1"

View File

@ -2027,7 +2027,7 @@ mod tests {
// variables are not set.
macro_rules! maybe_skip_integration {
($panic_msg:expr) => {{
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let required_vars = ["TEST_INFLUXDB_IOX_CATALOG_DSN"];
let unset_vars: Vec<_> = required_vars

View File

@ -15,6 +15,6 @@ pin-project = "1.0.11"
workspace-hack = { path = "../workspace-hack" }
[dev-dependencies] # In alphabetical order
dotenv = "0.15.0"
dotenvy = "0.15.1"
snafu = "0.7"
tokio = { version = "1.20", features = ["macros", "io-util"] }

View File

@ -16,5 +16,5 @@ futures = "0.3"
workspace-hack = { path = "../workspace-hack"}
[dev-dependencies]
dotenv = "0.15.0"
dotenvy = "0.15.1"
rand = { version = "0.8", features = ["small_rng"] }

View File

@ -148,7 +148,7 @@ mod tests {
// are not set.
macro_rules! maybe_skip_integration {
() => {{
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let required_vars = ["TEST_INFLUXDB_IOX_CATALOG_DSN"];
let unset_vars: Vec<_> = required_vars

View File

@ -5,7 +5,7 @@ authors = ["Paul Dix <paul@pauldix.net>"]
edition = "2021"
[dependencies] # In alphabetical order
dotenv = "0.15.0"
dotenvy = "0.15.1"
parking_lot = "0.12"
tempfile = "3.1.0"
tracing-log = "0.1"

View File

@ -32,7 +32,7 @@ pub fn all_approximately_equal(f1: &[f64], f2: &[f64]) -> bool {
/// Return a temporary directory that is deleted when the object is dropped
pub fn tmp_dir() -> Result<tempfile::TempDir> {
let _ = dotenv::dotenv();
let _ = dotenvy::dotenv();
let root = env::var_os("TEST_INFLUXDB_IOX_DB_DIR").unwrap_or_else(|| env::temp_dir().into());
@ -42,7 +42,7 @@ pub fn tmp_dir() -> Result<tempfile::TempDir> {
}
pub fn tmp_file() -> Result<tempfile::NamedTempFile> {
let _ = dotenv::dotenv();
let _ = dotenvy::dotenv();
let root = env::var_os("TEST_INFLUXDB_IOX_DB_DIR").unwrap_or_else(|| env::temp_dir().into());

View File

@ -57,7 +57,7 @@ pub fn rand_id() -> String {
macro_rules! maybe_skip_integration {
() => {{
use std::env;
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
match (
env::var("TEST_INTEGRATION").is_ok(),

View File

@ -7,7 +7,7 @@ edition = "2021"
async-trait = "0.1"
data_types = { path = "../data_types" }
dml = { path = "../dml" }
dotenv = "0.15.0"
dotenvy = "0.15.1"
futures = "0.3"
generated_types = { path = "../generated_types" }
hashbrown = "0.12"
@ -37,4 +37,4 @@ test_helpers = { path = "../test_helpers" }
[package.metadata.cargo-udeps.ignore]
# used within the `maybe_skip_kafka_integration` macro and cannot be detected by a normal analysis pass
normal = ["dotenv"]
normal = ["dotenvy"]

View File

@ -1453,7 +1453,7 @@ pub mod test_utils {
};
($panic_msg:expr) => {{
use std::env;
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let panic_msg: &'static str = $panic_msg;