-
Notifications
You must be signed in to change notification settings - Fork 87
feat: add rattler_menuinst
crate
#840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Apparently the name can be a dict:
|
Linux is now nearly working. Running
|
We went with directly calling the quoted command with One thing that still needs to be investigated if we need to run |
69e6791
to
6a1ac81
Compare
Cool! Super excited about this for |
🎉 |
crates/rattler_menuinst/src/lib.rs
Outdated
Tracker::MacOs(tracker) => { | ||
#[cfg(target_os = "macos")] | ||
macos::remove_menu_item(tracker).unwrap(); | ||
} | ||
Tracker::Linux(tracker) => { | ||
#[cfg(target_os = "linux")] | ||
linux::remove_menu_item(tracker).unwrap(); | ||
} | ||
Tracker::Windows(tracker) => { | ||
#[cfg(target_os = "windows")] | ||
windows::remove_menu_item(tracker)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want to just return one error here instead of an unwrap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I think there is one more unwrap in the windows specific code that I marked with a TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's align the return type with all the functions, and then also make this function return the removed paths. This is useful in pixi for logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not just paths, though, it's also registry entries on Windows, for example, or entries in the terminal profile configuration file.
Might be more useful to just render the tracker
information in pixi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small set of first comments :)
@@ -0,0 +1,68 @@ | |||
{ | |||
"id_": "https://schemas.conda.io/menuinst-1.schema.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link seems to be broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why is this file needed? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We test that we can parse the defaults.json from upstream menuinst: https://github.com/conda/menuinst/blob/main/menuinst/data/menuinst-1-1-0.default.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seem to find that test. Can you point me to where it is? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[test]
fn test_deserialize_defaults() {
let test_data = test_data();
let schema_path = test_data.join("defaults/defaults.json");
let schema_str = std::fs::read_to_string(schema_path).unwrap();
let schema: super::MenuInstSchema = serde_json::from_str(&schema_str).unwrap();
insta::assert_debug_snapshot!(schema);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That uses test-data/defaults/defaults.json
, not data/menuinst.default.json
af536a1
to
8d84e8c
Compare
Split out of conda#840 since it isn't used anywhere at the moment
TODO:
precreate
code if specified in the menuinstSerialization
Testing
Some notes:
But it makes it harder to test, because that installs to user directorywe should test by overriding XDG_DATA_DIRECTORY and XDG_CONFIG_DIRECTORY 💡