From e752d8a964595b28ef3cce5884cdbbab6cc62007 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Thu, 18 May 2023 11:37:20 -0500 Subject: [PATCH] remove unused dependencies (#9230) # Description This is a test PR to see if we can remove dependencies. The crates to remove was generated from cargo machete. If ci works, I'll update the PR to remove deps instead of comment them out. # User-Facing Changes # Tests + Formatting # After Submitting --- Cargo.lock | 42 +++++++++++++---------------- Cargo.toml | 17 ++++-------- crates/nu-cli/Cargo.toml | 6 ++--- crates/nu-cmd-lang/Cargo.toml | 5 ---- crates/nu-color-config/Cargo.toml | 4 +-- crates/nu-command/Cargo.toml | 34 +++++++---------------- crates/nu-command/src/system/sys.rs | 4 +-- crates/nu-engine/Cargo.toml | 4 +-- crates/nu-parser/Cargo.toml | 13 +++++---- crates/nu-plugin/Cargo.toml | 8 +++--- crates/nu-protocol/Cargo.toml | 6 +---- crates/nu-system/Cargo.toml | 5 ++-- crates/nu_plugin_formats/Cargo.toml | 2 +- crates/nu_plugin_gstat/Cargo.toml | 1 - 14 files changed, 54 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2996160fad..961ca8a8a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2603,13 +2603,9 @@ version = "0.80.1" dependencies = [ "assert_cmd", "atty", - "chrono", "criterion", "crossterm 0.26.1", "ctrlc", - "hamcrest2", - "is_executable", - "itertools", "log", "miette", "nix", @@ -2633,7 +2629,6 @@ dependencies = [ "nu-utils", "openssl", "pretty_assertions", - "rayon", "reedline", "rstest", "serde_json", @@ -2679,8 +2674,7 @@ dependencies = [ "percent-encoding", "reedline", "rstest", - "sysinfo", - "thiserror", + "sysinfo 0.29.0", "unicode-segmentation", ] @@ -2690,13 +2684,11 @@ version = "0.80.1" dependencies = [ "fancy-regex", "itertools", - "log", "nu-ansi-term", "nu-color-config", "nu-engine", "nu-parser", "nu-protocol", - "nu-test-support", "nu-utils", "shadow-rs", ] @@ -2739,7 +2731,6 @@ dependencies = [ "filesize", "filetime", "fs_extra", - "hamcrest2", "htmlescape", "indexmap", "indicatif", @@ -2799,16 +2790,14 @@ dependencies = [ "serde_yaml", "sha2", "sqlparser 0.32.0", - "sysinfo", + "sysinfo 0.29.0", "tabled", "terminal_size 0.2.6", - "thiserror", "titlecase", "toml", "trash", "umask", "unicode-segmentation", - "unicode-width", "ureq", "url", "users 0.11.0", @@ -2823,13 +2812,11 @@ dependencies = [ name = "nu-engine" version = "0.80.1" dependencies = [ - "chrono", "nu-glob", "nu-path", "nu-protocol", "nu-utils", - "serde", - "sysinfo", + "sysinfo 0.29.0", ] [[package]] @@ -2876,14 +2863,12 @@ dependencies = [ "chrono", "itertools", "log", - "miette", "nu-engine", "nu-path", "nu-plugin", "nu-protocol", "rstest", "serde_json", - "thiserror", ] [[package]] @@ -2902,7 +2887,6 @@ dependencies = [ "bincode", "nu-engine", "nu-protocol", - "rmp", "rmp-serde", "serde", "serde_json", @@ -2935,7 +2919,6 @@ dependencies = [ "serde_json", "strum", "strum_macros", - "sys-locale", "thiserror", "typetag", ] @@ -2955,7 +2938,6 @@ version = "0.80.1" dependencies = [ "atty", "chrono", - "errno 0.3.1", "libc", "libproc", "log", @@ -3038,7 +3020,6 @@ dependencies = [ "eml-parser", "ical", "indexmap", - "nu-engine", "nu-plugin", "nu-protocol", "rust-ini", @@ -3049,7 +3030,6 @@ name = "nu_plugin_gstat" version = "0.80.1" dependencies = [ "git2", - "nu-engine", "nu-plugin", "nu-protocol", ] @@ -3923,7 +3903,7 @@ dependencies = [ "once_cell", "rayon", "smartstring", - "sysinfo", + "sysinfo 0.28.4", ] [[package]] @@ -5076,6 +5056,20 @@ name = "sysinfo" version = "0.28.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" +dependencies = [ + "cfg-if 1.0.0", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "winapi 0.3.9", +] + +[[package]] +name = "sysinfo" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02f1dc6930a439cc5d154221b5387d153f8183529b07c19aca24ea31e0a167e1" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index e7ca5ef0c3..f32a9b79c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,11 +42,6 @@ members = [ ] [dependencies] -chrono = { version = "0.4.23", features = ["serde"] } -crossterm = "0.26" -ctrlc = "3.2.1" -log = "0.4" -miette = { version = "5.7.0", features = ["fancy-no-backtrace"] } nu-cli = { path = "./crates/nu-cli", version = "0.80.1" } nu-color-config = { path = "./crates/nu-color-config", version = "0.80.1" } nu-cmd-lang = { path = "./crates/nu-cmd-lang", version = "0.80.1" } @@ -63,22 +58,22 @@ nu-table = { path = "./crates/nu-table", version = "0.80.1" } nu-term-grid = { path = "./crates/nu-term-grid", version = "0.80.1" } nu-std = { path = "./crates/nu-std", version = "0.80.1" } nu-utils = { path = "./crates/nu-utils", version = "0.80.1" } - nu-ansi-term = "0.47.0" reedline = { version = "0.19.1", features = ["bashisms", "sqlite"]} -rayon = "1.7.0" -is_executable = "1.0.1" +crossterm = "0.26" +ctrlc = "3.2.1" +log = "0.4" +miette = { version = "5.7.0", features = ["fancy-no-backtrace"] } +serde_json = "1.0" simplelog = "0.12.0" time = "0.3.12" -serde_json = "1.0" [target.'cfg(not(target_os = "windows"))'.dependencies] # Our dependencies don't use OpenSSL on Windows openssl = { version = "0.10.48", features = ["vendored"], optional = true } signal-hook = { version = "0.3.14", default-features = false } - [target.'cfg(windows)'.build-dependencies] winresource = "0.1" @@ -98,9 +93,7 @@ assert_cmd = "2.0.2" criterion = "0.4" pretty_assertions = "1.0.0" serial_test = "1.0.0" -hamcrest2 = "0.3.0" rstest = { version = "0.17.0", default-features = false } -itertools = "0.10.3" [features] plugin = [ diff --git a/crates/nu-cli/Cargo.toml b/crates/nu-cli/Cargo.toml index 466c63e947..44376ffa26 100644 --- a/crates/nu-cli/Cargo.toml +++ b/crates/nu-cli/Cargo.toml @@ -22,7 +22,6 @@ nu-parser = { path = "../nu-parser", version = "0.80.1" } nu-protocol = { path = "../nu-protocol", version = "0.80.1" } nu-utils = { path = "../nu-utils", version = "0.80.1" } nu-color-config = { path = "../nu-color-config", version = "0.80.1" } - nu-ansi-term = "0.47.0" reedline = { version = "0.19.1", features = ["bashisms", "sqlite"]} @@ -32,12 +31,11 @@ crossterm = "0.26" fancy-regex = "0.11.0" fuzzy-matcher = "0.3.7" is_executable = "1.0.1" -once_cell = "1.17.0" log = "0.4" miette = { version = "5.7.0", features = ["fancy-no-backtrace"] } +once_cell = "1.17.0" percent-encoding = "2" -sysinfo = "0.28.2" -thiserror = "1.0.31" +sysinfo = "0.29" unicode-segmentation = "1.10.0" [features] diff --git a/crates/nu-cmd-lang/Cargo.toml b/crates/nu-cmd-lang/Cargo.toml index cc7cdd8f87..4be833c61e 100644 --- a/crates/nu-cmd-lang/Cargo.toml +++ b/crates/nu-cmd-lang/Cargo.toml @@ -17,16 +17,11 @@ nu-engine = { path = "../nu-engine", version = "0.80.1" } nu-parser = { path = "../nu-parser", version = "0.80.1" } nu-protocol = { path = "../nu-protocol", version = "0.80.1" } nu-utils = { path = "../nu-utils", version = "0.80.1" } - nu-ansi-term = "0.47.0" fancy-regex = "0.11.0" itertools = "0.10.0" -log = "0.4.14" shadow-rs = { version = "0.21.0", default-features = false } [build-dependencies] shadow-rs = { version = "0.21.0", default-features = false } - -[dev-dependencies] -nu-test-support = { path="../nu-test-support", version = "0.80.1" } diff --git a/crates/nu-color-config/Cargo.toml b/crates/nu-color-config/Cargo.toml index 20a64c61e5..19da226662 100644 --- a/crates/nu-color-config/Cargo.toml +++ b/crates/nu-color-config/Cargo.toml @@ -11,13 +11,13 @@ version = "0.80.1" bench = false [dependencies] -serde = { version="1.0.123", features=["derive"] } - nu-protocol = { path = "../nu-protocol", version = "0.80.1" } nu-ansi-term = "0.47.0" nu-utils = { path = "../nu-utils", version = "0.80.1" } nu-engine = { path = "../nu-engine", version = "0.80.1" } nu-json = { path="../nu-json", version = "0.80.1" } +serde = { version="1.0.123", features=["derive"] } + [dev-dependencies] nu-test-support = { path="../nu-test-support", version = "0.80.1" } diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index ed70fcc0d2..df42492b97 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -30,18 +30,13 @@ nu-utils = { path = "../nu-utils", version = "0.80.1" } num-format = { version = "0.4.3" } nu-ansi-term = "0.47.0" -# Potential dependencies for extras -Inflector = "0.11" alphanumeric-sort = "1.5.0" atty = "0.2.14" base64 = "0.21.0" byteorder = "1.4.3" bytesize = "1.2.0" calamine = "0.19.1" -chrono = { version = "0.4.23", features = [ - "std", - "unstable-locales", -], default-features = false } +chrono = { version = "0.4.23", features = [ "std", "unstable-locales", ], default-features = false } chrono-humanize = "0.2.1" chrono-tz = "0.8.1" crossterm = "0.26" @@ -57,6 +52,7 @@ fs_extra = "1.3.0" htmlescape = "0.3.1" indexmap = { version = "1.7", features = ["serde-1"] } indicatif = "0.17.2" +Inflector = "0.11" is-root = "0.1.2" itertools = "0.10.0" log = "0.4.14" @@ -70,20 +66,17 @@ num = { version = "0.4.0", optional = true } num-traits = "0.2.14" once_cell = "1.17" open = "4.0.2" +os_pipe = "1.1.3" pathdiff = "0.2.1" +percent-encoding = "2.2.0" powierza-coefficient = "1.0.2" +print-positions = "0.6.1" quick-xml = "0.28" rand = "0.8" rayon = "1.7.0" regex = "1.7.1" -ureq = { version = "2.6.2", default-features = false, features = [ - "json", - "charset", - "native-tls", - "gzip", -] } -native-tls = "0.2.11" roxmltree = "0.18.0" +rusqlite = { version = "0.28.0", features = ["bundled"], optional = true } rust-embed = "6.6.0" same-file = "1.0.6" serde = { version = "1.0.123", features = ["derive"] } @@ -91,24 +84,19 @@ serde_json = "1.0" serde_urlencoded = "0.7.0" serde_yaml = "0.9.4" sha2 = "0.10.0" -# Disable default features b/c the default features build Git (very slow to compile) -percent-encoding = "2.2.0" -rusqlite = { version = "0.28.0", features = ["bundled"], optional = true } sqlparser = { version = "0.32.0", features = ["serde"], optional = true } -sysinfo = "0.28.2" +sysinfo = "0.29" tabled = "0.12.0" terminal_size = "0.2.1" -thiserror = "1.0.31" titlecase = "2.0.0" toml = "0.7.1" unicode-segmentation = "1.10.0" -unicode-width = "0.1.10" +ureq = { version = "2.6.2", default-features = false, features = [ "json", "charset", "native-tls", "gzip", ] } +native-tls = "0.2.11" url = "2.2.1" uuid = { version = "1.3.0", features = ["v4"] } wax = { version = "0.5.0" } which = { version = "4.4.0", optional = true } -print-positions = "0.6.1" -os_pipe = "1.1.3" [target.'cfg(windows)'.dependencies] winreg = "0.50.0" @@ -168,10 +156,8 @@ which-support = ["which"] [dev-dependencies] nu-test-support = { path = "../nu-test-support", version = "0.80.1" } -mockito = "1.0.0" - dirs-next = "2.0.0" -hamcrest2 = "0.3.0" +mockito = "1.0.0" quickcheck = "1.0.3" quickcheck_macros = "1.0.0" rstest = { version = "0.17.0", default-features = false } diff --git a/crates/nu-command/src/system/sys.rs b/crates/nu-command/src/system/sys.rs index d7c6bc3232..1188d6812d 100644 --- a/crates/nu-command/src/system/sys.rs +++ b/crates/nu-command/src/system/sys.rs @@ -157,9 +157,9 @@ pub fn disks(span: Span) -> Value { span, }); - cols.push("removable".into()); + cols.push("kind".into()); vals.push(Value::String { - val: format!("{:?}", disk.type_()), + val: format!("{:?}", disk.kind()), span, }); diff --git a/crates/nu-engine/Cargo.toml b/crates/nu-engine/Cargo.toml index 561c915d43..f7a48cf349 100644 --- a/crates/nu-engine/Cargo.toml +++ b/crates/nu-engine/Cargo.toml @@ -16,9 +16,7 @@ nu-path = { path = "../nu-path", version = "0.80.1" } nu-glob = { path = "../nu-glob", version = "0.80.1" } nu-utils = { path = "../nu-utils", version = "0.80.1" } -chrono = { version="0.4.23", features = ["std"], default-features = false } -serde = {version = "1.0.143", default-features = false } -sysinfo ="0.28.2" +sysinfo ="0.29" [features] plugin = [] diff --git a/crates/nu-parser/Cargo.toml b/crates/nu-parser/Cargo.toml index d474df8990..f2abb95c05 100644 --- a/crates/nu-parser/Cargo.toml +++ b/crates/nu-parser/Cargo.toml @@ -11,17 +11,16 @@ version = "0.80.1" bench = false [dependencies] +nu-engine = { path = "../nu-engine", version = "0.80.1" } +nu-path = {path = "../nu-path", version = "0.80.1" } +nu-plugin = { path = "../nu-plugin", optional = true, version = "0.80.1" } +nu-protocol = { path = "../nu-protocol", version = "0.80.1" } + bytesize = "1.2.0" chrono = { default-features = false, features = ['std'], version = "0.4.23" } itertools = "0.10" -miette = {version = "5.7.0", features = ["fancy-no-backtrace"]} -thiserror = "1.0.31" -serde_json = "1.0" -nu-path = {path = "../nu-path", version = "0.80.1" } -nu-protocol = { path = "../nu-protocol", version = "0.80.1" } -nu-plugin = { path = "../nu-plugin", optional = true, version = "0.80.1" } -nu-engine = { path = "../nu-engine", version = "0.80.1" } log = "0.4" +serde_json = "1.0" [dev-dependencies] rstest = { version = "0.17.0", default-features = false } diff --git a/crates/nu-plugin/Cargo.toml b/crates/nu-plugin/Cargo.toml index 5938646a90..d2460087fb 100644 --- a/crates/nu-plugin/Cargo.toml +++ b/crates/nu-plugin/Cargo.toml @@ -11,10 +11,10 @@ version = "0.80.1" bench = false [dependencies] -bincode = "1.3.3" -nu-protocol = { path = "../nu-protocol", version = "0.80.1" } nu-engine = { path = "../nu-engine", version = "0.80.1" } +nu-protocol = { path = "../nu-protocol", version = "0.80.1" } + +bincode = "1.3.3" +rmp-serde = "1.1.0" serde = { version = "1.0.143" } serde_json = { version = "1.0"} -rmp = "0.8.11" -rmp-serde = "1.1.0" diff --git a/crates/nu-protocol/Cargo.toml b/crates/nu-protocol/Cargo.toml index beae7c493b..d51a344004 100644 --- a/crates/nu-protocol/Cargo.toml +++ b/crates/nu-protocol/Cargo.toml @@ -16,10 +16,7 @@ bench = false nu-utils = { path = "../nu-utils", version = "0.80.1" } byte-unit = "4.0.9" -chrono = { version = "0.4.23", features = [ - "serde", - "std", -], default-features = false } +chrono = { version = "0.4.23", features = [ "serde", "std", ], default-features = false } chrono-humanize = "0.2.1" fancy-regex = "0.11.0" indexmap = { version = "1.7" } @@ -30,7 +27,6 @@ serde = { version = "1.0.143", default-features = false } serde_json = { version = "1.0", optional = true } strum = "0.24" strum_macros = "0.24" -sys-locale = "0.3.0" thiserror = "1.0.31" typetag = "0.2.5" diff --git a/crates/nu-system/Cargo.toml b/crates/nu-system/Cargo.toml index ab346651fc..1dba34d23d 100644 --- a/crates/nu-system/Cargo.toml +++ b/crates/nu-system/Cargo.toml @@ -17,19 +17,18 @@ libc = "0.2" log = "0.4" [target.'cfg(target_family = "unix")'.dependencies] -nix = { version = "0.26", default-features = false, features = ["fs", "term", "process", "signal"]} atty = "0.2" +nix = { version = "0.26", default-features = false, features = ["fs", "term", "process", "signal"]} [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] procfs = "0.15.1" [target.'cfg(target_os = "macos")'.dependencies] libproc = "0.12.0" -errno = "0.3" mach2 = "0.4" [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version = "0.3.9", features = ["tlhelp32", "fileapi", "handleapi", "ifdef", "ioapiset", "minwindef", "pdh", "psapi", "synchapi", "sysinfoapi", "winbase", "winerror", "winioctl", "winnt", "oleauto", "wbemcli", "rpcdce", "combaseapi", "objidl", "powerbase", "netioapi", "lmcons", "lmaccess", "lmapibuf", "memoryapi", "shellapi", "std", "securitybaseapi"] } chrono = "0.4.23" ntapi = "0.4" once_cell = "1.17" +winapi = { version = "0.3.9", features = ["tlhelp32", "fileapi", "handleapi", "ifdef", "ioapiset", "minwindef", "pdh", "psapi", "synchapi", "sysinfoapi", "winbase", "winerror", "winioctl", "winnt", "oleauto", "wbemcli", "rpcdce", "combaseapi", "objidl", "powerbase", "netioapi", "lmcons", "lmaccess", "lmapibuf", "memoryapi", "shellapi", "std", "securitybaseapi"] } diff --git a/crates/nu_plugin_formats/Cargo.toml b/crates/nu_plugin_formats/Cargo.toml index 72213cf207..ce7776a657 100644 --- a/crates/nu_plugin_formats/Cargo.toml +++ b/crates/nu_plugin_formats/Cargo.toml @@ -11,7 +11,7 @@ version = "0.80.1" [dependencies] nu-plugin = { path = "../nu-plugin", version = "0.80.1" } nu-protocol = { path = "../nu-protocol", version = "0.80.1", features = ["plugin"] } -nu-engine = { path = "../nu-engine", version = "0.80.1" } + indexmap = { version = "1.7", features = ["serde-1"] } eml-parser = "0.1.0" diff --git a/crates/nu_plugin_gstat/Cargo.toml b/crates/nu_plugin_gstat/Cargo.toml index cc505f6181..88b1bf3134 100644 --- a/crates/nu_plugin_gstat/Cargo.toml +++ b/crates/nu_plugin_gstat/Cargo.toml @@ -18,6 +18,5 @@ bench = false [dependencies] nu-plugin = { path="../nu-plugin", version = "0.80.1" } nu-protocol = { path="../nu-protocol", version = "0.80.1" } -nu-engine = { path="../nu-engine", version = "0.80.1" } git2 = "0.17.0"