From b6ccf16f6ef259adfb4638e99d63fbd5691fb773 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Fri, 2 May 2025 09:43:30 -0700 Subject: [PATCH 1/2] chore: Add license information to `**/cargo.toml` --- Cargo.toml | 3 +++ crates/pet-conda/Cargo.toml | 1 + crates/pet-core/Cargo.toml | 1 + crates/pet-env-var-path/Cargo.toml | 1 + crates/pet-fs/Cargo.toml | 1 + crates/pet-global-virtualenvs/Cargo.toml | 1 + crates/pet-homebrew/Cargo.toml | 1 + crates/pet-jsonrpc/Cargo.toml | 3 ++- crates/pet-linux-global-python/Cargo.toml | 1 + crates/pet-mac-commandlinetools/Cargo.toml | 1 + crates/pet-mac-python-org/Cargo.toml | 1 + crates/pet-mac-xcode/Cargo.toml | 1 + crates/pet-pipenv/Cargo.toml | 1 + crates/pet-pixi/Cargo.toml | 1 + crates/pet-poetry/Cargo.toml | 1 + crates/pet-pyenv/Cargo.toml | 1 + crates/pet-python-utils/Cargo.toml | 1 + crates/pet-reporter/Cargo.toml | 1 + crates/pet-telemetry/Cargo.toml | 1 + crates/pet-venv/Cargo.toml | 1 + crates/pet-virtualenv/Cargo.toml | 1 + crates/pet-virtualenvwrapper/Cargo.toml | 1 + crates/pet-windows-registry/Cargo.toml | 1 + crates/pet-windows-store/Cargo.toml | 1 + crates/pet/Cargo.toml | 1 + 25 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a902c513..0612e07e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,9 @@ members = ["crates/*"] resolver = "2" +[workspace.package] +license = "MIT" + [profile.release] # Enable all optimizations opt-level = 3 diff --git a/crates/pet-conda/Cargo.toml b/crates/pet-conda/Cargo.toml index 02a592c3..4f324c48 100644 --- a/crates/pet-conda/Cargo.toml +++ b/crates/pet-conda/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-conda" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-core/Cargo.toml b/crates/pet-core/Cargo.toml index 491cc758..a1161fc5 100644 --- a/crates/pet-core/Cargo.toml +++ b/crates/pet-core/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-core" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-env-var-path/Cargo.toml b/crates/pet-env-var-path/Cargo.toml index 0c517c55..f36cc4a5 100644 --- a/crates/pet-env-var-path/Cargo.toml +++ b/crates/pet-env-var-path/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-env-var-path" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-fs/Cargo.toml b/crates/pet-fs/Cargo.toml index 12352ceb..1774d51a 100644 --- a/crates/pet-fs/Cargo.toml +++ b/crates/pet-fs/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-fs" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-global-virtualenvs/Cargo.toml b/crates/pet-global-virtualenvs/Cargo.toml index c4a60e78..b51ebc39 100644 --- a/crates/pet-global-virtualenvs/Cargo.toml +++ b/crates/pet-global-virtualenvs/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-global-virtualenvs" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-homebrew/Cargo.toml b/crates/pet-homebrew/Cargo.toml index 0537bc19..6b107d4a 100644 --- a/crates/pet-homebrew/Cargo.toml +++ b/crates/pet-homebrew/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-homebrew" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-jsonrpc/Cargo.toml b/crates/pet-jsonrpc/Cargo.toml index 75788852..62974915 100644 --- a/crates/pet-jsonrpc/Cargo.toml +++ b/crates/pet-jsonrpc/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-jsonrpc" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } @@ -11,4 +12,4 @@ serde = { version = "1.0.152", features = ["derive"] } serde_json = "1.0.93" pet-core = { path = "../pet-core" } log = "0.4.21" -env_logger = "0.10.2" \ No newline at end of file +env_logger = "0.10.2" diff --git a/crates/pet-linux-global-python/Cargo.toml b/crates/pet-linux-global-python/Cargo.toml index 00142e26..d6f4ea35 100644 --- a/crates/pet-linux-global-python/Cargo.toml +++ b/crates/pet-linux-global-python/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-linux-global-python" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-mac-commandlinetools/Cargo.toml b/crates/pet-mac-commandlinetools/Cargo.toml index cf37cc86..9a5d0349 100644 --- a/crates/pet-mac-commandlinetools/Cargo.toml +++ b/crates/pet-mac-commandlinetools/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-mac-commandlinetools" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-mac-python-org/Cargo.toml b/crates/pet-mac-python-org/Cargo.toml index f105214c..7128e851 100644 --- a/crates/pet-mac-python-org/Cargo.toml +++ b/crates/pet-mac-python-org/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-mac-python-org" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-mac-xcode/Cargo.toml b/crates/pet-mac-xcode/Cargo.toml index 2ec305e0..fee418b7 100644 --- a/crates/pet-mac-xcode/Cargo.toml +++ b/crates/pet-mac-xcode/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-mac-xcode" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-pipenv/Cargo.toml b/crates/pet-pipenv/Cargo.toml index 633e7c68..9cb5fae5 100644 --- a/crates/pet-pipenv/Cargo.toml +++ b/crates/pet-pipenv/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-pipenv" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-pixi/Cargo.toml b/crates/pet-pixi/Cargo.toml index cdeb5095..6a514a36 100644 --- a/crates/pet-pixi/Cargo.toml +++ b/crates/pet-pixi/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-pixi" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-poetry/Cargo.toml b/crates/pet-poetry/Cargo.toml index 971a9380..2a6b4ded 100644 --- a/crates/pet-poetry/Cargo.toml +++ b/crates/pet-poetry/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-poetry" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-pyenv/Cargo.toml b/crates/pet-pyenv/Cargo.toml index 46c20a80..bf6a95ba 100644 --- a/crates/pet-pyenv/Cargo.toml +++ b/crates/pet-pyenv/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-pyenv" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-python-utils/Cargo.toml b/crates/pet-python-utils/Cargo.toml index f99d6b15..3a4f33ca 100644 --- a/crates/pet-python-utils/Cargo.toml +++ b/crates/pet-python-utils/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-python-utils" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-reporter/Cargo.toml b/crates/pet-reporter/Cargo.toml index 7c1c2416..6dcfc608 100644 --- a/crates/pet-reporter/Cargo.toml +++ b/crates/pet-reporter/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-reporter" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-telemetry/Cargo.toml b/crates/pet-telemetry/Cargo.toml index 38140aa0..67a009f3 100644 --- a/crates/pet-telemetry/Cargo.toml +++ b/crates/pet-telemetry/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-telemetry" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-venv/Cargo.toml b/crates/pet-venv/Cargo.toml index f2749b99..411e1ad9 100644 --- a/crates/pet-venv/Cargo.toml +++ b/crates/pet-venv/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-venv" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-virtualenv/Cargo.toml b/crates/pet-virtualenv/Cargo.toml index 4e906630..db1b5aab 100644 --- a/crates/pet-virtualenv/Cargo.toml +++ b/crates/pet-virtualenv/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-virtualenv" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-virtualenvwrapper/Cargo.toml b/crates/pet-virtualenvwrapper/Cargo.toml index 81e0193f..6ade089c 100644 --- a/crates/pet-virtualenvwrapper/Cargo.toml +++ b/crates/pet-virtualenvwrapper/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-virtualenvwrapper" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(target_os = "windows")'.dependencies] msvc_spectre_libs = { version = "0.1.1", features = ["error"] } diff --git a/crates/pet-windows-registry/Cargo.toml b/crates/pet-windows-registry/Cargo.toml index 62321b91..036b0100 100644 --- a/crates/pet-windows-registry/Cargo.toml +++ b/crates/pet-windows-registry/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-windows-registry" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(windows)'.dependencies] winreg = "0.55.0" diff --git a/crates/pet-windows-store/Cargo.toml b/crates/pet-windows-store/Cargo.toml index a837a834..8ad5647b 100644 --- a/crates/pet-windows-store/Cargo.toml +++ b/crates/pet-windows-store/Cargo.toml @@ -2,6 +2,7 @@ name = "pet-windows-store" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(windows)'.dependencies] winreg = "0.55.0" diff --git a/crates/pet/Cargo.toml b/crates/pet/Cargo.toml index 11e045a7..ee2efdf7 100644 --- a/crates/pet/Cargo.toml +++ b/crates/pet/Cargo.toml @@ -2,6 +2,7 @@ name = "pet" version = "0.1.0" edition = "2021" +license = "MIT" [target.'cfg(windows)'.dependencies] pet-windows-store = { path = "../pet-windows-store" } From 6a06f587e31a3ebd5f5d595ecef76de43565b087 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Fri, 2 May 2025 10:17:00 -0700 Subject: [PATCH 2/2] fix: clippy --- crates/pet-core/src/os_environment.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/pet-core/src/os_environment.rs b/crates/pet-core/src/os_environment.rs index 65ea094d..7577bf27 100644 --- a/crates/pet-core/src/os_environment.rs +++ b/crates/pet-core/src/os_environment.rs @@ -152,8 +152,5 @@ fn get_user_home() -> Option { } fn get_env_var(key: String) -> Option { - match env::var(key) { - Ok(path) => Some(path), - Err(_) => None, - } + env::var(key).ok() }